commit fd34e56b6bdcea115fad8a29301bd9b3c73c39c8 Author: gleimar Date: Wed Jun 27 18:01:07 2012 +0000 copia do projeto scia git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@19145 d1611594-4594-4d17-8e1d-87c2c4800839 diff --git a/.classpath b/.classpath new file mode 100644 index 000000000..359220ba8 --- /dev/null +++ b/.classpath @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 000000000..ce2331f5d --- /dev/null +++ b/.project @@ -0,0 +1,36 @@ + + + modelWeb + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipselabs.tapiji.tools.core.I18NBuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipselabs.tapiji.tools.core.nature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..6c2400ab6 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,276 @@ +#Wed Feb 08 15:49:36 BRST 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=9999 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..9a388386b --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,4 @@ +#Wed Feb 08 15:49:36 BRST 2012 +eclipse.preferences.version=1 +formatter_profile=_rjconsultores +formatter_settings_version=11 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 000000000..b1279627b --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,6 @@ + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 000000000..0b51b220a --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.settings/org.hibernate.eclipse.console.prefs b/.settings/org.hibernate.eclipse.console.prefs new file mode 100644 index 000000000..1f629b5cf --- /dev/null +++ b/.settings/org.hibernate.eclipse.console.prefs @@ -0,0 +1,4 @@ +#Fri Nov 04 10:48:34 BRST 2011 +default.configuration= +eclipse.preferences.version=1 +hibernate3.enabled=false diff --git a/.settings/org.jboss.ide.eclipse.as.core.prefs b/.settings/org.jboss.ide.eclipse.as.core.prefs new file mode 100644 index 000000000..6c0f5e101 --- /dev/null +++ b/.settings/org.jboss.ide.eclipse.as.core.prefs @@ -0,0 +1,3 @@ +#Tue Oct 18 15:19:18 BRST 2011 +eclipse.preferences.version=1 +org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 000000000..ee8f8df13 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.8.2 +Created-By: 1.7.0-b147 (Oracle Corporation) \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/AjusteEventoExtraDAO.java b/src/com/rjconsultores/ventaboletos/dao/AjusteEventoExtraDAO.java new file mode 100644 index 000000000..94040913f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AjusteEventoExtraDAO.java @@ -0,0 +1,7 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra; + +public interface AjusteEventoExtraDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/AlertaCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/AlertaCtrlDAO.java new file mode 100644 index 000000000..d82d6a5e7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AlertaCtrlDAO.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AlertaCtrlDAO extends GenericDAO { + + public List buscar(Parada origem, Parada destino, Ruta ruta, ClaseServicio claseServicio, Integer tiempoAlta, Integer tiempoBaja, BigDecimal percAlta, BigDecimal percBaja); + + public List buscarCorrida(Corrida corrida); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ArticuloDAO.java b/src/com/rjconsultores/ventaboletos/dao/ArticuloDAO.java new file mode 100644 index 000000000..c087197db --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ArticuloDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ArticuloDAO extends GenericDAO { + + public List buscar(String descarticulo); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/AsientoExclusivoDAO.java b/src/com/rjconsultores/ventaboletos/dao/AsientoExclusivoDAO.java new file mode 100644 index 000000000..062d691cf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AsientoExclusivoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.AsientoExclusivo; + +/** + * + * @author rodrigo + */ +public interface AsientoExclusivoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/AutobusDAO.java b/src/com/rjconsultores/ventaboletos/dao/AutobusDAO.java new file mode 100644 index 000000000..40f48aeb4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AutobusDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutobusDAO extends GenericDAO { + + public List buscar(String numautobus, DiagramaAutobus diagramaAutobus); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/AutorizacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/AutorizacionDAO.java new file mode 100644 index 000000000..1ef21c4b4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AutorizacionDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutorizacionDAO extends GenericDAO { + + public List buscar(String nombautorizacion, String descautorizacion); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/AutorizacionPerfilDAO.java b/src/com/rjconsultores/ventaboletos/dao/AutorizacionPerfilDAO.java new file mode 100644 index 000000000..c3c48e8d9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AutorizacionPerfilDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutorizacionPerfilDAO extends GenericDAO { + + public List buscar(Autorizacion autorizacion, Perfil perfil); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/BancoDAO.java b/src/com/rjconsultores/ventaboletos/dao/BancoDAO.java new file mode 100644 index 000000000..9fae21447 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/BancoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Banco; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface BancoDAO extends GenericDAO { + + public List buscar(Banco nombbanco); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CancelacionCargoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CancelacionCargoDAO.java new file mode 100644 index 000000000..8a25a04f7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CancelacionCargoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; + +/** + * + * @author Rafius + */ +public interface CancelacionCargoDAO extends GenericDAO{ +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CancelacionCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/CancelacionCtrlDAO.java new file mode 100644 index 000000000..e2804acde --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CancelacionCtrlDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface CancelacionCtrlDAO extends GenericDAO { + + public List buscar(Date tiempoprevsalida, PuntoVenta puntoVenta, Parada paradaOrigem, Parada paradaDestino, Marca marca); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaClaseDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaClaseDAO.java new file mode 100644 index 000000000..27378f2cf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaClaseDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaClaseDAO extends GenericDAO { + + public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaCorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaCorridaDAO.java new file mode 100644 index 000000000..7bdac568f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaCorridaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaCorridaDAO extends GenericDAO { + + public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaCtrlDAO.java new file mode 100644 index 000000000..7a34ef59d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaCtrlDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaCtrlDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaDAO.java new file mode 100644 index 000000000..e641e515a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface CategoriaDAO extends GenericDAO { + + public List buscar(String desccategoria); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaDescuentoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaDescuentoDAO.java new file mode 100644 index 000000000..af055e7b0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaDescuentoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; + +/** + * + * @author Administrador + */ +public interface CategoriaDescuentoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaMarcaDAO.java new file mode 100644 index 000000000..c91e9f833 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaMarcaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; + +/** + * + * @author Administrador + */ +public interface CategoriaMarcaDAO extends GenericDAO { + + public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaMercadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaMercadoDAO.java new file mode 100644 index 000000000..984c55ea4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaMercadoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; + +/** + * + * @author Administrador + */ +public interface CategoriaMercadoDAO extends GenericDAO { + + public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaPeriodoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaPeriodoDAO.java new file mode 100644 index 000000000..f0d04d6b8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaPeriodoDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface CategoriaPeriodoDAO extends GenericDAO { + + public List buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo); + + public List obtenerPorCategoriaDescuento(CategoriaDescuento categoriaDescuento); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CategoriaTipoPtoVtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CategoriaTipoPtoVtaDAO.java new file mode 100644 index 000000000..ab1ec784b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CategoriaTipoPtoVtaDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface CategoriaTipoPtoVtaDAO extends GenericDAO { + + public List buscarPorPuntoVenta(TipoPuntoVenta tipoPuntoVenta); + + public void borrarFisico(CategoriaTipoPtoVta cd); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CiudadDAO.java b/src/com/rjconsultores/ventaboletos/dao/CiudadDAO.java new file mode 100644 index 000000000..66e7bdac8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CiudadDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; + +/** + * + * @author MCosso + */ +public interface CiudadDAO extends GenericDAO { + + public List buscar(String nombciudad, Estado estado, Plaza plaza); + + public List buscaLike(String strCiudad); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ClaseservicioEquivalenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ClaseservicioEquivalenciaDAO.java new file mode 100644 index 000000000..7b981f37e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ClaseservicioEquivalenciaDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ClaseservicioEquivalenciaDAO + extends GenericDAO { + + public List buscar(ClaseServicio ClaseServicio, ComisionistaExterno comisionistaExterno); + + public List buscarEquivalencia(ClaseservicioEquivalencia claseServicioEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ClasseServicoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ClasseServicoDAO.java new file mode 100644 index 000000000..405f97ee8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ClasseServicoDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ClasseServicoDAO extends GenericDAO { + + public List buscarPorNome(String nomeClaseServicio); + + public List buscarTodosExceto(Integer ... idClase); +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/ColoniaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ColoniaDAO.java new file mode 100644 index 000000000..de775c0de --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ColoniaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ColoniaDAO extends GenericDAO { + + public List buscar(String desccolonia); + public List buscarPorCiudad(Ciudad ciudad); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ComisionistaExternoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ComisionistaExternoDAO.java new file mode 100644 index 000000000..481d7f0fc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ComisionistaExternoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ComisionistaExternoDAO extends GenericDAO { + + public List buscar(String desccomisionista); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CompaniaBancariaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CompaniaBancariaDAO.java new file mode 100644 index 000000000..45f77be0d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CompaniaBancariaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface CompaniaBancariaDAO extends GenericDAO { + + public List buscar(CompaniaBancaria companiaBancaria); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ConductorDAO.java b/src/com/rjconsultores/ventaboletos/dao/ConductorDAO.java new file mode 100644 index 000000000..ab3521d40 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ConductorDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Conductor; + +/** + * + * @author Administrador + */ +public interface ConductorDAO extends GenericDAO { + + public Conductor buscar(String claveConductor, String contraSenha); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ConfigRestriccionPagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ConfigRestriccionPagoDAO.java new file mode 100644 index 000000000..4fcf2d176 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ConfigRestriccionPagoDAO.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import java.util.List; +import java.util.Map; + +/** + * + * @author Administrador + */ +public interface ConfigRestriccionPagoDAO extends GenericDAO { + + public List buscar(FormaPago formaPago, + RestriccionPago restriccionPago); + + public Map buscar(FormaPago formaPago); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ConstanteDAO.java b/src/com/rjconsultores/ventaboletos/dao/ConstanteDAO.java new file mode 100644 index 000000000..c1dfa1b5e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ConstanteDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ConstanteDAO extends GenericDAO { + + public Constante buscarPorNomeConstante(String nomeConstante); + + public List buscar(String nombconstante); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ConvenioDAO.java b/src/com/rjconsultores/ventaboletos/dao/ConvenioDAO.java new file mode 100644 index 000000000..8558b37ed --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ConvenioDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Convenio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ConvenioDAO extends GenericDAO { + + public List buscar(String descconvenio, String cveconvenio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ConvenioDetDAO.java b/src/com/rjconsultores/ventaboletos/dao/ConvenioDetDAO.java new file mode 100644 index 000000000..d95a1649b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ConvenioDetDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; + +/** + * + * @author Administrador + */ +public interface ConvenioDetDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaCtrlDAO.java new file mode 100644 index 000000000..cc711a5f7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaCtrlDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.util.Date; + +/** + * + * @author Administrador + */ +public interface CorridaCtrlDAO extends GenericDAO { + + public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, Date horario, boolean pisoExtra); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java new file mode 100644 index 000000000..241ba3492 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Corrida.Id; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +/** + * + * @author rodrigo + */ +public interface CorridaDAO extends GenericDAO { + + /** + * Indica si existe una corrida de acuerdo el id + * + * No lleva en consideración el campo activo + * + * @param id + * @param dataGeracao + * @return + */ + public Boolean existe(Id id); + + public List buscarPorAutobusCorridasFuturas(DiagramaAutobus diagramaAutobus); + + public List buscarPorRolOperativoCorridasFuturas(DiagramaAutobus diagramaAutobus); + + public List buscarPorFecCorrida(Date value); + + public Long count(Ruta ruta); + + public List buscarPorId(Integer idCorrida); + + public List buscarFiltro(Parada ori, Parada des, Date hora, ClaseServicio cs); + + /** + * Hace la b�squeda de corridas con distinct para: origen, destino, claseServicio,hora + * + * @param ori + * @param des + * @param horaSalidaInicio + * @param horaSalidaFin + * @param cs + * @param corridaId + * @return + */ + public List buscarDistinct(Parada ori, Parada des, Date horaSalidaInicio, Date horaSalidaFin, ClaseServicio cs, Integer corridaId); + + boolean existe(Ruta ruta, Date dataGeracao, Date horario, ClaseServicio claseServicio, Marca marca, boolean pisoExtra); + + boolean count(Parada origem, Parada destino, Date feccorrida, ClaseServicio claseServicio, boolean pisoExtra); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java new file mode 100644 index 000000000..6af40d53a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.math.BigDecimal; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; + +public interface CorridaTramoDAO extends GenericDAO { + + public List obtenerTramoTarjetaEmitida(); + + public List buscarTarjetaMesmaCorrida(CorridaTramo ct); + + public BigDecimal buscarSumTarjetaMesmaCorrida(CorridaTramo ct); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CortesiaBeneficiarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/CortesiaBeneficiarioDAO.java new file mode 100644 index 000000000..70c9f6a23 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CortesiaBeneficiarioDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; + +/** + * + * @author Shiro + */ +public interface CortesiaBeneficiarioDAO extends GenericDAO { + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CortesiaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CortesiaDAO.java new file mode 100644 index 000000000..05a2492da --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CortesiaDAO.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CortesiaDAO extends GenericDAO { + + public List pesquisar(Empleado empleado); + + + public Cortesia buscar(Cortesia cortesia); + + public List buscarDplicidad(Cortesia cortesia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CortesiaDireccionDAO.java b/src/com/rjconsultores/ventaboletos/dao/CortesiaDireccionDAO.java new file mode 100644 index 000000000..45ceca2c3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CortesiaDireccionDAO.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.util.Date; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CortesiaDireccionDAO extends GenericDAO { + + public List pesquisar(Marca marca, ClaseServicio claseServicio, Date fecInicio, Date fecFinal); + + public List buscar(CortesiaDireccion cortesiaDireccion); + + public List buscarFolio(CortesiaDireccion cortesiaDireccion); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CuponConvenioDAO.java b/src/com/rjconsultores/ventaboletos/dao/CuponConvenioDAO.java new file mode 100644 index 000000000..3dacfcb51 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CuponConvenioDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CuponConvenioDAO extends GenericDAO{ + + public List pesquisar(TipoConvenio tipoConvenio); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/CuponSecretariaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CuponSecretariaDAO.java new file mode 100644 index 000000000..f6ab3ca39 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/CuponSecretariaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; + +/** + * + * @author Administrador + */ +public interface CuponSecretariaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/DepositoBancarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/DepositoBancarioDAO.java new file mode 100644 index 000000000..0edafef1b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/DepositoBancarioDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.DepositoBancario; + +/** + * + * @author Rafius + */ +public interface DepositoBancarioDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/DetDiagramaAutobusDAO.java b/src/com/rjconsultores/ventaboletos/dao/DetDiagramaAutobusDAO.java new file mode 100644 index 000000000..251fc6a9e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/DetDiagramaAutobusDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; + +/** + * + * @author Administrador + */ +public interface DetDiagramaAutobusDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/DiagramaAutobusDAO.java b/src/com/rjconsultores/ventaboletos/dao/DiagramaAutobusDAO.java new file mode 100644 index 000000000..798a3e622 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/DiagramaAutobusDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface DiagramaAutobusDAO extends GenericDAO { + + public List buscar(String descDiagrama, Short maxparados, + Short cantasientos); + + public List buscar(String descDiagrama); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/DivisionDAO.java b/src/com/rjconsultores/ventaboletos/dao/DivisionDAO.java new file mode 100644 index 000000000..a97ac77be --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/DivisionDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Division; + +public interface DivisionDAO extends GenericDAO { + + public List obtenerTodos(); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpleadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpleadoDAO.java new file mode 100644 index 000000000..8b712855e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EmpleadoDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface EmpleadoDAO extends GenericDAO{ + + public List pesquisaClave(String empleadoClave); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java new file mode 100644 index 000000000..c1ad27c29 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface EmpresaDAO extends GenericDAO { + + public List buscarTodosExceto(Integer... idEmpresa); + + public List obtenerIndExternoFalse(); + + public List obtenerIndTipo1(); + + public List buscar(String nombempresa, Boolean indExterna, Short indTipo); + + public List obtenerIndTipo2(); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpresaEquivalenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpresaEquivalenciaDAO.java new file mode 100644 index 000000000..9723bbc93 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EmpresaEquivalenciaDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface EmpresaEquivalenciaDAO extends GenericDAO { + + public List buscar(Empresa empresa, ComisionistaExterno comisionistaExterno); + + public List buscar(EmpresaEquivalencia empresaEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EsquemaAsientoDAO.java b/src/com/rjconsultores/ventaboletos/dao/EsquemaAsientoDAO.java new file mode 100644 index 000000000..a33bce20d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EsquemaAsientoDAO.java @@ -0,0 +1,21 @@ + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaAsientoDAO extends GenericDAO { + + public List obtenerPorCorrida(EsquemaCorrida esquemaCorrida); + + public EsquemaAsiento obtenerPorCorridaeAsiento(EsquemaCorrida esquemaCorrida, String asiento); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EsquemaCorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/EsquemaCorridaDAO.java new file mode 100644 index 000000000..b6cb1c146 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EsquemaCorridaDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; + +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaCorridaDAO extends GenericDAO { + + public List buscarPorEsquemaOperacional(EsquemaOperacional eo); + + public List buscar(Marca marca, RolOperativo rolOperativo, + Ruta ruta, ClaseServicio claseServicio); + + public List buscar(EsquemaCorrida ec); + + /** + * Indica se el esquema corrida es hijo de un esquemCorrida. + * + * @param esquemaCorrida + * @return + */ + public boolean esHijoRebote(EsquemaCorrida esquemaCorrida); + + /** + * Busca los esquema corrida que tiene esquema operacional en la fecha indicada + * @param dataGeracao + * @return + */ + public List buscaDentroVigencia(Date dataGeracao); + + public boolean buscarEsquemaCorridaExisteTramo(Tramo tramo); + + /** + * Indica cuál son los Id's de EsquemaCorrida que tienen la paradaId en su secuencia + * + * @param ruta + * @param paradaId + * @return - El Id de EsquemaCorrida + */ + public List existe(Ruta ruta , Integer paradaId); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EsquemaOperacionalDAO.java b/src/com/rjconsultores/ventaboletos/dao/EsquemaOperacionalDAO.java new file mode 100644 index 000000000..5adb543a7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EsquemaOperacionalDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaOperacionalDAO extends GenericDAO { + + public List dentroVigenciaEsquemaOperacional(Date dataGeracao); + + public List dentroVigenciaEsquemaOperacional(Date dataDe, Date dataAte); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EsquemaTramoDAO.java b/src/com/rjconsultores/ventaboletos/dao/EsquemaTramoDAO.java new file mode 100644 index 000000000..6919a955a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EsquemaTramoDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaTramoDAO extends GenericDAO { + + public List obtenerPorEsquemaCorrida(EsquemaCorrida ec); + + public List obtenerPorEsquemaCorridaOrderNumSec(EsquemaCorrida ec); + + public List obtenerAtivosDesativosPorEsquemaCorrida(EsquemaCorrida esquemaCorrida); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java new file mode 100644 index 000000000..93f3f8b01 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface EstacionDAO extends GenericDAO { + + public List buscar(String descEstacion, String descMac, + Long nunCaja, PuntoVenta pv); + + public List buscar(String descMac); + + /** + * Hace la búsqueda de las estciones ativas por el numCaja y puntoVenta + * + * @param numCaja + * @param puntoVenta + * @return + */ + public List buscar(Long numCaja,PuntoVenta puntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EstadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/EstadoDAO.java new file mode 100644 index 000000000..896542ece --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EstadoDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; + +/** + * + * @author MCosso + */ +public interface EstadoDAO extends GenericDAO { + + public List buscar(String nombestado, Pais pais); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EventoExtraDAO.java b/src/com/rjconsultores/ventaboletos/dao/EventoExtraDAO.java new file mode 100644 index 000000000..103b44320 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EventoExtraDAO.java @@ -0,0 +1,10 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.EventoExtra; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +public interface EventoExtraDAO extends GenericDAO{ + public List obtenerPorTipo(TipoEventoExtra tipoEventoExtra); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ExcepcionRedondoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ExcepcionRedondoDAO.java new file mode 100644 index 000000000..77826835c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ExcepcionRedondoDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ExcepcionRedondoDAO extends GenericDAO { + + public List buscar(String indTipo, Parada origem, Parada destino); + + /** + * Hace la búsqueda de las excepcion activas por origen y destino. + * @param origem + * @param destino + * @return + */ + public List buscar(Parada origem, Parada destino); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java new file mode 100644 index 000000000..5958f90c0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface FormaPagoDAO extends GenericDAO { + + public List buscarPorDescricao(String descpago); + + public List buscarTodosExceto(Integer... idFormaPago); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/FormaPagoDetDAO.java b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDetDAO.java new file mode 100644 index 000000000..4c10fbf5b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDetDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; + +/** + * + * @author Administrador + */ +public interface FormaPagoDetDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/FuncionSistemaDAO.java b/src/com/rjconsultores/ventaboletos/dao/FuncionSistemaDAO.java new file mode 100644 index 000000000..5583a0b74 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/FuncionSistemaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; + +/** + * + * @author rodrigo + */ +public interface FuncionSistemaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GenericDAO.java b/src/com/rjconsultores/ventaboletos/dao/GenericDAO.java new file mode 100644 index 000000000..2a6e180f1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GenericDAO.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +/** + * + * @author Administrador + */ +public interface GenericDAO { + + public List obtenerTodos(); + + public T obtenerID(ID id); + + public T suscribir(T entidad); + + public T actualizacion(T entidad); + + public void borrar(T entidad); + + public Long count(String campo,Object o); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GenericDAOInforme.java b/src/com/rjconsultores/ventaboletos/dao/GenericDAOInforme.java new file mode 100644 index 000000000..3dd02327a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GenericDAOInforme.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.Map; + +/** + * + * @author Administrador + */ +public interface GenericDAOInforme { + + public ResultSet executarSQL(Connection conn, Map parameters); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GrupoCortesiasDAO.java b/src/com/rjconsultores/ventaboletos/dao/GrupoCortesiasDAO.java new file mode 100644 index 000000000..68ce34a84 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GrupoCortesiasDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import java.util.List; + + +/** + * + * @author Shiro + */ +public interface GrupoCortesiasDAO extends GenericDAO{ + + public List buscar(String descgrupo); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/InformeCategoriaVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/InformeCategoriaVentaDAO.java new file mode 100644 index 000000000..75d15cf53 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/InformeCategoriaVentaDAO.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +/** + * + * @author Administrador + */ +public interface InformeCategoriaVentaDAO extends GenericDAOInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/InformePasajeroServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/InformePasajeroServicioDAO.java new file mode 100644 index 000000000..ae412d27e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/InformePasajeroServicioDAO.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +/** + * + * @author Administrador + */ +public interface InformePasajeroServicioDAO extends GenericDAOInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/InformeServicioDiarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/InformeServicioDiarioDAO.java new file mode 100644 index 000000000..a8f1e6812 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/InformeServicioDiarioDAO.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +/** + * + * @author Administrador + */ +public interface InformeServicioDiarioDAO extends GenericDAOInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/InformeVentasPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/InformeVentasPuntoVentaDAO.java new file mode 100644 index 000000000..65c3365ed --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/InformeVentasPuntoVentaDAO.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +/** + * + * @author Administrador + */ +public interface InformeVentasPuntoVentaDAO extends GenericDAOInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MarcaClaseServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/MarcaClaseServicioDAO.java new file mode 100644 index 000000000..c7c47de6f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MarcaClaseServicioDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicioPK; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MarcaClaseServicioDAO + extends GenericDAO { + + /** + * Regresa las Marcas activas vinculadas a la clase de servicio informada + * @param clase + * @return + */ + public List buscar(ClaseServicio clase); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/MarcaDAO.java new file mode 100644 index 000000000..22a73db80 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MarcaDAO.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MarcaDAO extends GenericDAO { + + public List buscarPorNome(String nomeMarca); + + public List buscarTodosExceto(Integer... idMarca); + + public List buscarDescricaoIdMarca(); + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/MercadoCompetidoDAO.java b/src/com/rjconsultores/ventaboletos/dao/MercadoCompetidoDAO.java new file mode 100644 index 000000000..6a1f58af4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MercadoCompetidoDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface MercadoCompetidoDAO extends GenericDAO { + + public boolean existe(ClaseServicio claseServicio, Parada origem, + Parada destino); + + public List buscar(Parada origem, Parada destino); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MerchantBancarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/MerchantBancarioDAO.java new file mode 100644 index 000000000..06e212c56 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MerchantBancarioDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; + +/** + * + * @author Rafius + */ +public interface MerchantBancarioDAO extends GenericDAO { + + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MonedaDAO.java b/src/com/rjconsultores/ventaboletos/dao/MonedaDAO.java new file mode 100644 index 000000000..c6215e10f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MonedaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MonedaDAO extends GenericDAO { + + public List buscar(String descmoneda); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MotivoCancelacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/MotivoCancelacionDAO.java new file mode 100644 index 000000000..ffa4b81f5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MotivoCancelacionDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MotivoCancelacionDAO extends GenericDAO { + + public List buscar(String descmotivo, String tipomotivo); + + public List obtenerTodosTipoMotivoB(); + + public List obtenerTodosEspecificos(Integer[] motivos); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MotivoReimpresionDAO.java b/src/com/rjconsultores/ventaboletos/dao/MotivoReimpresionDAO.java new file mode 100644 index 000000000..3d1fb3302 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MotivoReimpresionDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MotivoReimpresionDAO extends GenericDAO { + + public List buscar(String descmotivo); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MotivoViajeDAO.java b/src/com/rjconsultores/ventaboletos/dao/MotivoViajeDAO.java new file mode 100644 index 000000000..6fd76ba4e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MotivoViajeDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; + +/** + * + * @author Shiro + */ +public interface MotivoViajeDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/MotivocancelacionEquivalenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/MotivocancelacionEquivalenciaDAO.java new file mode 100644 index 000000000..1ccee5ea0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/MotivocancelacionEquivalenciaDAO.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MotivocancelacionEquivalenciaDAO + extends GenericDAO { + + public List buscar(ComisionistaExterno comisionistaExterno, + MotivoCancelacion motivoCancelacion); + + public List buscarEquivalencia(MotivocancelacionEquivalencia motivoCancelacionEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/NodoDAO.java b/src/com/rjconsultores/ventaboletos/dao/NodoDAO.java new file mode 100644 index 000000000..abc213328 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/NodoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Nodo; + +/** + * + * @author Administrador + */ +public interface NodoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PaisDAO.java b/src/com/rjconsultores/ventaboletos/dao/PaisDAO.java new file mode 100644 index 000000000..a058a920c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PaisDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PaisDAO extends GenericDAO { + + public List buscar(String nombpais); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParadaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParadaDAO.java new file mode 100644 index 000000000..93ce36ad6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParadaDAO.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ParadaDAO extends GenericDAO { + + public List buscar(String descparada, String cveparada, Ciudad ciudad, + TipoParada tipoParada, Nodo nodo); + + public List buscar(String descparada); + + public List buscarCVE(String cveparada); + + public List buscaLike(String descparada); + + public Long count(TipoParada tipoParada); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParadaEquivalenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParadaEquivalenciaDAO.java new file mode 100644 index 000000000..c8c680d8a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParadaEquivalenciaDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ParadaEquivalenciaDAO extends GenericDAO { + + public List buscar(Parada parada, ComisionistaExterno comisionistaExterno, String equivalencia); + + public List buscarEquivalencia(String equivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaMasivoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaMasivoDAO.java new file mode 100644 index 000000000..acec450b2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaMasivoDAO.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamAcumulaMasivoDAO extends GenericDAO { + + + public List buscar(ParamAcumulaMasivo paramAcumulaMasivo); + + public List buscar(Empresa emp, Integer min, Integer max, Date fecIni, Date fecFim); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaPuntoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaPuntoDAO.java new file mode 100644 index 000000000..830523460 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamAcumulaPuntoDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamAcumulaPuntoDAO extends GenericDAO { + + public List buscar(Parada origem, Parada destino, Date ini, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamArticuloDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamArticuloDAO.java new file mode 100644 index 000000000..9e3c7faa9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamArticuloDAO.java @@ -0,0 +1,7 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ParamArticulo; + +public interface ParamArticuloDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamCanjePuntoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamCanjePuntoDAO.java new file mode 100644 index 000000000..99391fe5b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamCanjePuntoDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCanjePuntoDAO extends GenericDAO { + + public List buscar(Parada origem, Parada destino, Date ini, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamCompraPuntoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamCompraPuntoDAO.java new file mode 100644 index 000000000..bad3c9212 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamCompraPuntoDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCompraPuntoDAO extends GenericDAO { + + public List buscar(Date ini, Date fim); + + public List buscar(Date ini, Date fim, Integer cantPuntos, BigDecimal costoPunto); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamCostoTarjetaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamCostoTarjetaDAO.java new file mode 100644 index 000000000..49d2513dd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamCostoTarjetaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCostoTarjetaDAO extends GenericDAO { + + public List buscar(ParamCostoTarjeta paramCostoTarjeta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ParamRecoleccionDAO.java b/src/com/rjconsultores/ventaboletos/dao/ParamRecoleccionDAO.java new file mode 100644 index 000000000..43f4cbac8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ParamRecoleccionDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; + +/** + * + * @author Desenvolvimento + */ +public interface ParamRecoleccionDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PerfilDAO.java b/src/com/rjconsultores/ventaboletos/dao/PerfilDAO.java new file mode 100644 index 000000000..43d492a88 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PerfilDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface PerfilDAO extends GenericDAO { + public List buscar(String dscPerfil); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PerfilFuncionDAO.java b/src/com/rjconsultores/ventaboletos/dao/PerfilFuncionDAO.java new file mode 100644 index 000000000..85736e728 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PerfilFuncionDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; + +/** + * + * @author rodrigo + */ +public interface PerfilFuncionDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PeriodoVacacionalDAO.java b/src/com/rjconsultores/ventaboletos/dao/PeriodoVacacionalDAO.java new file mode 100644 index 000000000..281e9247b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PeriodoVacacionalDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PeriodoVacacionalDAO extends GenericDAO { + + public List buscar(Date dataInicio, Date dataFim); + + public List buscarFechaTraslapa(PeriodoVacacional periodoVacacional); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PlazaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PlazaDAO.java new file mode 100644 index 000000000..f2d5dc9f6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PlazaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface PlazaDAO extends GenericDAO { + + public List buscar(String nombplaza); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingAnticipacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingAnticipacionDAO.java new file mode 100644 index 000000000..494f6eff8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingAnticipacionDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface PricingAnticipacionDAO extends GenericDAO { + + public List obtenerPorPricing(Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java new file mode 100644 index 000000000..7dffd65dc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingAsientoDAO extends GenericDAO { + + public List obtenerPricingCategoria(Pricing pricing, Integer asiento); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingCategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingCategoriaDAO.java new file mode 100644 index 000000000..7884de6c2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingCategoriaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; + +/** + * + * @author Rafius + */ +public interface PricingCategoriaDAO extends GenericDAO { + + public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingClaseDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingClaseDAO.java new file mode 100644 index 000000000..7d9c43069 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingClaseDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingClase; + +/** + * + * @author Rafius + */ +public interface PricingClaseDAO extends GenericDAO { + + public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingCorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingCorridaDAO.java new file mode 100644 index 000000000..68de7ba48 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingCorridaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; + +/** + * + * @author Rafius + */ +public interface PricingCorridaDAO extends GenericDAO { + + public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java new file mode 100644 index 000000000..ea86afddd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingDAO extends GenericDAO { + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo); + + public List buscarPorNombre(String nombPricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingDiaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingDiaDAO.java new file mode 100644 index 000000000..0cb9b89e6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingDiaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingDiaDAO extends GenericDAO { + + public List buscarTraslapa(PricingDia pricingDia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingEspecificoDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingEspecificoDAO.java new file mode 100644 index 000000000..1457a8aa5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingEspecificoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingEspecificoDAO extends GenericDAO { + + public List buscarPorNome(PricingEspecifico pricingEspecifico); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingImporteDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingImporteDAO.java new file mode 100644 index 000000000..ff0de3546 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingImporteDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingImporteDAO extends GenericDAO { + + public List buscarMoneda(PricingImporte pricingImporte, Moneda moneda); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingMarcaDAO.java new file mode 100644 index 000000000..3e2f3ea7c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingMarcaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; + +/** + * + * @author Rafius + */ +public interface PricingMarcaDAO extends GenericDAO { + + public Boolean obtenerPricingMarca(Pricing pricing, Marca marca); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingMercadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingMercadoDAO.java new file mode 100644 index 000000000..b0508d1f2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingMercadoDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; + +/** + * + * @author Rafius + */ +public interface PricingMercadoDAO extends GenericDAO { + + public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingOcupacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingOcupacionDAO.java new file mode 100644 index 000000000..cc541a3b6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingOcupacionDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingOcupacionDAO extends GenericDAO { + + public Boolean podeSalvar(Pricing pricing, BigDecimal min, BigDecimal max); + + public List podeSalvar(Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingPuntoVentaDAO.java new file mode 100644 index 000000000..15f172d0a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingPuntoVentaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +/** + * + * @author Rafius + */ +public interface PricingPuntoVentaDAO extends GenericDAO { + + public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingRutaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingRutaDAO.java new file mode 100644 index 000000000..44cce2268 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingRutaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +/** + * + * @author Rafius + */ +public interface PricingRutaDAO extends GenericDAO { + + public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingTipoPtoVtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingTipoPtoVtaDAO.java new file mode 100644 index 000000000..b76bea53e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingTipoPtoVtaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; + +/** + * + * @author Rafius + */ +public interface PricingTipoPtoVtaDAO extends GenericDAO { + + public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingTipoServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingTipoServicioDAO.java new file mode 100644 index 000000000..e249fa52c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingTipoServicioDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; + +/** + * + * @author Desenvolvimento + */ +public interface PricingTipoServicioDAO extends GenericDAO { + + public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingVigenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingVigenciaDAO.java new file mode 100644 index 000000000..e4c98391e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingVigenciaDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingVigenciaDAO extends GenericDAO { + + public List buscarPorVigencias(PricingVigencia pv); + + public Boolean podeSalvar(Pricing pricing, PricingVigencia pricingVigencia, + Date inicio, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdClaseServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdClaseServicioDAO.java new file mode 100644 index 000000000..914fd82c9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdClaseServicioDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; + +/** + * + * @author Rafius + */ +public interface ProdClaseServicioDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdFormaPagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdFormaPagoDAO.java new file mode 100644 index 000000000..abce37883 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdFormaPagoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; + +/** + * + * @author Rafius + */ +public interface ProdFormaPagoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdMarcaDAO.java new file mode 100644 index 000000000..cb77755bc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdMarcaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdMarca; + +/** + * + * @author Rafius + */ +public interface ProdMarcaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdMercadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdMercadoDAO.java new file mode 100644 index 000000000..4eb36295d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdMercadoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdMercado; + +/** + * + * @author Rafius + */ +public interface ProdMercadoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdPrecioDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdPrecioDAO.java new file mode 100644 index 000000000..fbfda688f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdPrecioDAO.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ProdPrecioDAO extends GenericDAO { + + /** + * Hace una busqueda en los prodPrecio que estan ativos y con los filtros indicados + * @param marca + * @param productoservicio + * @return + */ + public List buscar(Marca marca, ProductoServicio productoservicio); + + /** + * Hace una busqueda en los prodPrecio que estan ativos y con los filtros indicados + * @param marca + * @return + */ + public List buscar(Marca marca); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdPuntoVentaDAO.java new file mode 100644 index 000000000..727bf9618 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdPuntoVentaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; + +/** + * + * @author Rafius + */ +public interface ProdPuntoVentaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdRutaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdRutaDAO.java new file mode 100644 index 000000000..62377f84e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdRutaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdRuta; + +/** + * + * @author Rafius + */ +public interface ProdRutaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdTipoptovtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdTipoptovtaDAO.java new file mode 100644 index 000000000..8cdd95127 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdTipoptovtaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; + +/** + * + * @author Rafius + */ +public interface ProdTipoptovtaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProdVigenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProdVigenciaDAO.java new file mode 100644 index 000000000..4978f84e4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProdVigenciaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ProdVigenciaDAO extends GenericDAO { + + public List buscarTraslapa(ProdVigencia prodVigencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ProductoServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/ProductoServicioDAO.java new file mode 100644 index 000000000..cd4ae3e34 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ProductoServicioDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface ProductoServicioDAO extends GenericDAO{ + + public List obtener(ProductoServicio ps); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PtoVtaUsuarioBancarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/PtoVtaUsuarioBancarioDAO.java new file mode 100644 index 000000000..2da71abbe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PtoVtaUsuarioBancarioDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; + +/** + * + * @author Desenvolvimento + */ +public interface PtoVtaUsuarioBancarioDAO extends GenericDAO { + + public void borrarFisico(PtoVtaUsuarioBancario pto2); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PtovtaEmpresaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PtovtaEmpresaDAO.java new file mode 100644 index 000000000..f2411b97e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PtovtaEmpresaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface PtovtaEmpresaDAO extends GenericDAO { + + public List buscar(PtovtaEmpresa ptovtaEmpresa); + + public void borrarFisico(PtovtaEmpresa pto); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/PuntoVentaDAO.java new file mode 100644 index 000000000..8a6070fd2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PuntoVentaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface PuntoVentaDAO extends GenericDAO { + + public List buscaLike(String strEstacion); + + public List busca(PuntoVenta puntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RedondeoCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/RedondeoCtrlDAO.java new file mode 100644 index 000000000..f7b76b6c7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RedondeoCtrlDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoCtrlDAO extends GenericDAO { + + public List buscar(RedondeoCtrl redondeoCtrl); + + public List buscarTraslapa(Short[] iDMarcas, BigDecimal valorinicial, BigDecimal valorfinal, Boolean indaplicadescuento, Boolean indaplicapricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RedondeoDAO.java b/src/com/rjconsultores/ventaboletos/dao/RedondeoDAO.java new file mode 100644 index 000000000..f425af0f8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RedondeoDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoDAO extends GenericDAO { + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal, + BigDecimal valorRedondeo); + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RedondeoMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/RedondeoMarcaDAO.java new file mode 100644 index 000000000..8abbaaacd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RedondeoMarcaDAO.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoMarcaDAO extends GenericDAO { + + public List buscar(Marca marca); + + public List obtenerTodasMarcas(Short[] iDMarcas); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionCategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionCategoriaDAO.java new file mode 100644 index 000000000..ff664873d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionCategoriaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; + +/** + * + * @author Administrador + */ +public interface ReservacionCategoriaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionClaseDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionClaseDAO.java new file mode 100644 index 000000000..449b882ce --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionClaseDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; + +/** + * + * @author Administrador + */ +public interface ReservacionClaseDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionCtrlDAO.java new file mode 100644 index 000000000..304fdf798 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionCtrlDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ReservacionCtrlDAO extends GenericDAO { + + public List buscar(ReservacionCtrl reservacionCtrl); + + public List buscarFechaTraslapa(ReservacionCtrl reservacionCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionMarcaDAO.java new file mode 100644 index 000000000..42ea81d08 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionMarcaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; + +/** + * + * @author Administrador + */ +public interface ReservacionMarcaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionMercadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionMercadoDAO.java new file mode 100644 index 000000000..83eea9c18 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionMercadoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; + +/** + * + * @author Administrador + */ +public interface ReservacionMercadoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ReservacionPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ReservacionPuntoVentaDAO.java new file mode 100644 index 000000000..f0c3b2732 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ReservacionPuntoVentaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; + +/** + * + * @author Rafius + */ +public interface ReservacionPuntoVentaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RestriccionPagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/RestriccionPagoDAO.java new file mode 100644 index 000000000..9a547682f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RestriccionPagoDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; + +/** + * + * @author Administrador + */ +public interface RestriccionPagoDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RhPagoConductorDAO.java b/src/com/rjconsultores/ventaboletos/dao/RhPagoConductorDAO.java new file mode 100644 index 000000000..088478e73 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RhPagoConductorDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.RhPagoConductor; + +/** + * + * @author Desenvolvimento + */ +public interface RhPagoConductorDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RolOperativoDAO.java b/src/com/rjconsultores/ventaboletos/dao/RolOperativoDAO.java new file mode 100644 index 000000000..a52bb9c17 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RolOperativoDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RolOperativoDAO extends GenericDAO{ + + public List pesquisar(DiagramaAutobus diagrama,String rol); + + public List buscar(String descroloperativo); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RutaCombinacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/RutaCombinacionDAO.java new file mode 100644 index 000000000..3eead10e1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RutaCombinacionDAO.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaCombinacionDAO extends GenericDAO { + + public boolean busquedaRutaTramo(Ruta ruta, Tramo tramo, Boolean ativo); + + public RutaCombinacion busquedaTramoRutaTramo(Ruta ruta, Tramo trBuscaOrigemDestino); + + /** + * Regreso el tramo de la entidade RutaCobinacion donde el tramo tines el origen-destino igual y la Rua sea la misma de RutaCombinacion + * + * @param ruta + * @param origen + * @param destino + * @return + */ + public Tramo busqueda(Ruta ruta, Parada origen, Parada destino); + + public RutaCombinacion busquedaTramoRutaOrigemDestino(Ruta ruta, Parada origem, Parada destino); + + public List obtenerPorRuta(Ruta ruta); + + public boolean buscarRutaCombinacionExisteTramo(Tramo tramo); + + /** + * Hace una búsquena en los tramos faltantes en la combinacion de la ruta informada + * @param rutaId + * @return + */ + List tramosFaltantes(Integer rutaId); + + + public int borrarCombinaciones(Ruta ruta); + + public void activar(Ruta ruta, Tramo trBuscaOrigemDestino); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RutaDAO.java b/src/com/rjconsultores/ventaboletos/dao/RutaDAO.java new file mode 100644 index 000000000..0d26359d0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RutaDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaDAO extends GenericDAO { + + public List buscarPorTramo(Tramo tramo); + + public List buscarPorRutaPorEmpresa(Ruta ruta, Empresa empresa); + + public List buscarPorClaseServicio(ClaseServicio claseServicio); + + public List buscar(String nomeRuta, ClaseServicio claseServicio, + Boolean nomeObrigatorio); + + public List obtenerPorEmpresa(Empresa empresa); + + public List buscarTodosExceto(Integer... idRuta); + + /** + * Regresa la origen de la ruta + * @param ruta + * @return + */ + public Parada buscarOrigen(Ruta ruta); + + /** + * Regresa el destino de la ruta + * @param ruta + * @return + */ + public Parada buscarDestino(Ruta ruta); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RutaEmpresaDAO.java b/src/com/rjconsultores/ventaboletos/dao/RutaEmpresaDAO.java new file mode 100644 index 000000000..7ffbc533a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RutaEmpresaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; + +/** + * + * @author Administrador + */ +public interface RutaEmpresaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/RutaSecuenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/RutaSecuenciaDAO.java new file mode 100644 index 000000000..34d095699 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/RutaSecuenciaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaSecuenciaDAO extends GenericDAO { + + public List buscarSecuenciaOrdenado(Ruta ruta); + public int borrarSecuencias(Ruta ruta); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/SecretariaDAO.java b/src/com/rjconsultores/ventaboletos/dao/SecretariaDAO.java new file mode 100644 index 000000000..e01f04529 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/SecretariaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface SecretariaDAO extends GenericDAO { + + public List buscar(String descsecretaria, String cvesecretaria); + + public List buscar(String descsecretaria); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/SistemaDAO.java b/src/com/rjconsultores/ventaboletos/dao/SistemaDAO.java new file mode 100644 index 000000000..2bc5ce1a7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/SistemaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Sistema; + +/** + * + * @author rodrigo + */ +public interface SistemaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarifaCategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaCategoriaDAO.java new file mode 100644 index 000000000..8db0b1cb9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaCategoriaDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaCategoriaDAO extends GenericDAO { + + public List buscarPorCategoria(Categoria categoria); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarifaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaDAO.java new file mode 100644 index 000000000..1a60a4e0b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaDAO extends GenericDAO { + + public List pesquisar(Marca marca, Parada origem, Parada destino, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, + Categoria categoria, TipoPuntoVenta tipoPuntoVenta); + + public boolean existe(Marca marca, Tramo tramo, Moneda moneda, ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa); + + public List pesquisar(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa); + + public Tarifa buscar(Tramo tramo, Marca marca, ClaseServicio claseServicio, + VigenciaTarifa vigenciaTarifa, Moneda moneda); + + public List buscarPorVigencia(VigenciaTarifa vigencia); + + public List pesquisar(List lsMoneda, List lsMarca, + List lsClaseServicio, List lsCategoria, + List lsEmpresa, List lsRuta, + List lsTipoPuntoVenta, List lsVigenciaTarifa); + + public List buscarExisteVigencia(VigenciaTarifa vigenciaTarifa); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarifaHistDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaHistDAO.java new file mode 100644 index 000000000..8849438a5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaHistDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TarifaHist; + +/** + * + * @author rodrigo + */ +public interface TarifaHistDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarifaMinimaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaMinimaDAO.java new file mode 100644 index 000000000..423cdc31f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaMinimaDAO.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaMinimaDAO extends GenericDAO { + + public List pesquisarPlaza(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Plaza plaza); + + public List pesquisar(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Moneda moneda); + + public List buscarPorPlaza(Plaza plaza); + + public List buscarPorPlazaMoneda(Plaza plaza, Moneda moneda); + + public List pesquisar(BigDecimal valor, Moneda moneda, + Plaza plaza, Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio); + + public List pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda); + + public List buscarPorMarcaMoneda(Marca marca, Moneda moneda); + + public List buscarPorClaseServicioMoneda(ClaseServicio claseServicio, + Moneda moneda); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarifaTipoptovtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaTipoptovtaDAO.java new file mode 100644 index 000000000..38e282681 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaTipoptovtaDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; + +/** + * + * @author rodrigo + */ +public interface TarifaTipoptovtaDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarjetaFidelidadDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarjetaFidelidadDAO.java new file mode 100644 index 000000000..a6d76f044 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarjetaFidelidadDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidadCuenta; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TarjetaFidelidadDAO extends GenericDAO{ + + public List obtenerCantDesc(); + + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarjetaRecaudacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarjetaRecaudacionDAO.java new file mode 100644 index 000000000..a41efa37f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarjetaRecaudacionDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacionPK; + +/** + * + * @author Administrador + */ +public interface TarjetaRecaudacionDAO extends + GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TarjetaViajeDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarjetaViajeDAO.java new file mode 100644 index 000000000..51eb57c00 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarjetaViajeDAO.java @@ -0,0 +1,21 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import java.util.Date; +import java.util.List; + +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; + +public interface TarjetaViajeDAO extends GenericDAO { + + public List buscarTarjetaPorFiltros(Integer autoIni, Integer autoFin, Date dataIni, Date dataFin, Comboitem empresa); + + public List buscarTarjetasParaEnvioNomina(Date fecIni, Date fecFin); + + public List buscarTarjetaPorFiltros(TarjetaViaje tarjeta); + + public boolean buscarTarjetaExisteVolta(TarjetaViaje t); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoCambioCiudadDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoCambioCiudadDAO.java new file mode 100644 index 000000000..b2b06ee59 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoCambioCiudadDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; + +/** + * + * @author Administrador + */ +public interface TipoCambioCiudadDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoCambioCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoCambioCtrlDAO.java new file mode 100644 index 000000000..d28a610aa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoCambioCtrlDAO.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; + +/** + * + * @author Administrador + */ +public interface TipoCambioCtrlDAO extends GenericDAO { +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoConvenioDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoConvenioDAO.java new file mode 100644 index 000000000..dbc5b2025 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoConvenioDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; + +/** + * + * @author Shiro + */ +public interface TipoConvenioDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoCorteDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoCorteDAO.java new file mode 100644 index 000000000..b99886b5f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoCorteDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoCorteDAO extends GenericDAO { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDAO.java new file mode 100644 index 000000000..914c05d5f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TipoCortesiaDAO extends GenericDAO { + + public List buscar(String descTipo); + + public List obtenerGrupoCortesia(int i); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDescuentoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDescuentoDAO.java new file mode 100644 index 000000000..a9338beb1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoCortesiaDescuentoDAO.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TipoCortesiaDescuentoDAO extends + GenericDAO { + + public List pesquisar(TipoCortesia tipoCortesia); + + public List buscar(BigDecimal porcentaje, + TipoCortesia tipoCortesia); + + public List Onchangue(TipoCortesia Tcselec); + + public List obtenerTipoCortesia(int i); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoDomicilioDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoDomicilioDAO.java new file mode 100644 index 000000000..97d7057f1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoDomicilioDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoDomicilioDAO extends GenericDAO { + + public List buscar(String desctipo, String cvetipodomicilio); + + public List buscarClave(String cvetipodomicilio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoEmpleadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoEmpleadoDAO.java new file mode 100644 index 000000000..9020424c0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoEmpleadoDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoEmpleado; + +/** + * + * @author Shiro + */ +public interface TipoEmpleadoDAO extends GenericDAO{ + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java new file mode 100644 index 000000000..6e3b7a7a7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +public interface TipoEventoExtraDAO extends + GenericDAO { + + public List buscar(String descingreso); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoMovimientoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoMovimientoDAO.java new file mode 100644 index 000000000..cbb5c3927 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoMovimientoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoMovimientoDAO extends GenericDAO { + + public List buscar(String descmovimiento); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoOcupacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoOcupacionDAO.java new file mode 100644 index 000000000..4ad29afe7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoOcupacionDAO.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoOcupacionDAO extends GenericDAO { + + public List buscar(String desctipo, String cvetipoocupacion); + + public List buscarClave(String cvetipoocupacion); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoParadaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoParadaDAO.java new file mode 100644 index 000000000..c27b1184c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoParadaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoParadaDAO extends GenericDAO { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoPuntoVentaDAO.java new file mode 100644 index 000000000..f38666c38 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoPuntoVentaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoPuntoVentaDAO extends GenericDAO { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoServicioDAO.java new file mode 100644 index 000000000..9a4192215 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoServicioDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TipoServicioDAO extends GenericDAO { + + public List buscar(String descservicio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoVentaDAO.java new file mode 100644 index 000000000..b875ce2ff --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoVentaDAO.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TipoVentaDAO extends GenericDAO{ + + public List buscar(String desctipoventa); + + public TipoVenta obtenerID(Short tipoventaId); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java new file mode 100644 index 000000000..b88c912bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TramoDAO extends GenericDAO { + + public Tramo obtenerPorOrigemDestino(Parada origem, Parada destino); + + public List obtenerListPorOrigemDestino(Parada origem, Parada destino); + + public Tramo obtenerTramotPorOrigemDestinoVia(Parada origem, Parada destino, Via via); + + public Tramo busca(Parada origem, Parada destino, Via via); + + + /** + * Hace la búsqueda del tramo que tiene origen - destino - via - clase servicio. + * + * @param origem + * @param destino + * @param via + * @param claseServicio + * @return + */ + public Tramo obtenerTramoUnicoRuta(Parada origem, Parada destino, Via via, ClaseServicio claseServicio); + + public List buscarCveParada(String origen, String destino, String via); + + public Long count(Via via); + public List obtenerViasOrigemDestino(Parada origem, Parada destino); + public List obtenerPorOrigemDestinoFetchLazy(Parada origem, Parada destino) ; +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TramoKmServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/TramoKmServicioDAO.java new file mode 100644 index 000000000..55f2f1b69 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TramoKmServicioDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface TramoKmServicioDAO extends GenericDAO { + + public List buscar(TramoKmServicio tramoKmServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TramoServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/TramoServicioDAO.java new file mode 100644 index 000000000..32390e66d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TramoServicioDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; + +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TramoServicioDAO extends GenericDAO { + + public List buscarPorTramo(Tramo tramo); + + public List buscarPorTramo(Tramo tramo, ClaseServicio clase); + + /** + * Hace la búsqueda del tramo tiempo activo de acuerdo los parametros. + * + * El filtrado tambien se el tramo asociado es activo + * + * @param origen + * @param destino + * @param via + * @param clase + * @return + */ + public TramoServicio buscar(Parada origen,Parada destino,Via via,ClaseServicio clase); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TramoTiempoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TramoTiempoDAO.java new file mode 100644 index 000000000..cea5ba462 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TramoTiempoDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; + +import java.util.Date; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TramoTiempoDAO extends GenericDAO { + + public List buscarPorTramo(Tramo tramo); + + public List buscarPorTramo(Tramo tramo,ClaseServicio clase); + /** + * Hace una búsqueda por los tramoTiempo activos, con la clase informado y donde traslapa feIni y fecFin con horainicio y horafin. + * + * @param tramo + * @param clase + * @param fecIni - Es la hora de inicio + * @param fecFin - Es la hora de fin + * @return + */ + public List buscar(Tramo tramo,ClaseServicio clase,Date fecIni, Date fecFin); + + + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TurnoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TurnoDAO.java new file mode 100644 index 000000000..bce02d5be --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TurnoDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Turno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TurnoDAO extends GenericDAO { + + public List buscar(String descturno); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/UsuarioBancarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/UsuarioBancarioDAO.java new file mode 100644 index 000000000..389ca14b4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/UsuarioBancarioDAO.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; + +/** + * + * @author Rafius + */ +public interface UsuarioBancarioDAO extends GenericDAO { + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/UsuarioDAO.java b/src/com/rjconsultores/ventaboletos/dao/UsuarioDAO.java new file mode 100644 index 000000000..8270c7f11 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/UsuarioDAO.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface UsuarioDAO extends GenericDAO { + + public List buscarPeloNome(String nome); + + public Usuario buscarPeloNomeSenha(String stUsuario, String senha); + + public List buscarPorEmpleado(Empleado empleado); + + public List buscarPelaCveUsuario(String cveUsuario); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/UsuarioPerfilDAO.java b/src/com/rjconsultores/ventaboletos/dao/UsuarioPerfilDAO.java new file mode 100644 index 000000000..9778fd053 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/UsuarioPerfilDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface UsuarioPerfilDAO extends GenericDAO { + + public List obtenerPorUsuario(Usuario usuario); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/UsuarioUbicacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/UsuarioUbicacionDAO.java new file mode 100644 index 000000000..513bffe63 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/UsuarioUbicacionDAO.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface UsuarioUbicacionDAO extends GenericDAO { + + public List buscarPorUsuario(Usuario usuario); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ViaDAO.java b/src/com/rjconsultores/ventaboletos/dao/ViaDAO.java new file mode 100644 index 000000000..467eda04f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ViaDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ViaDAO extends GenericDAO { + + public List buscar(String nombvia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/VigenciaTarifaDAO.java b/src/com/rjconsultores/ventaboletos/dao/VigenciaTarifaDAO.java new file mode 100644 index 000000000..ec697ea5e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/VigenciaTarifaDAO.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.util.Date; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface VigenciaTarifaDAO extends GenericDAO { + + public List pesquisar(Date inicio, Date fim); + + + + /** + * Regresa las vigencia que traslapa + * @param vigenciaTarifa + * @return + */ + public List buscarVigenciasIntervalo(VigenciaTarifa vigenciaTarifa); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AjusteEventoExtraHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AjusteEventoExtraHibernateDAO.java new file mode 100644 index 000000000..e68a2ed52 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AjusteEventoExtraHibernateDAO.java @@ -0,0 +1,34 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.AjusteEventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra; + +@Repository("ajusteEventoExtraDAO") +public class AjusteEventoExtraHibernateDAO extends + GenericHibernateDAO implements + AjusteEventoExtraDAO { + + @Autowired + public AjusteEventoExtraHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AlertaCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AlertaCtrlHibernateDAO.java new file mode 100644 index 000000000..6cc0a4c9f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AlertaCtrlHibernateDAO.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.AlertaCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("alertaCtrlDAO") +public class AlertaCtrlHibernateDAO extends GenericHibernateDAO + implements AlertaCtrlDAO { + + @Autowired + public AlertaCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(Parada origem, Parada destino, Ruta ruta, + ClaseServicio claseServicio, Integer tiempoAlta, + Integer tiempoBaja, BigDecimal percAlta, BigDecimal percBaja) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + + return c.list(); + } + + public List buscarCorrida(Corrida corrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("corrida", corrida)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ArticuloHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ArticuloHibernateDAO.java new file mode 100644 index 000000000..2dcf1a8de --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ArticuloHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ArticuloDAO; +import com.rjconsultores.ventaboletos.entidad.Articulo; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("articuloDAO") +public class ArticuloHibernateDAO extends GenericHibernateDAO + implements ArticuloDAO { + + @Autowired + public ArticuloHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descarticulo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descarticulo", descarticulo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AsientoExclusivoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AsientoExclusivoHibernateDAO.java new file mode 100644 index 000000000..e62e7b0d7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AsientoExclusivoHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.AsientoExclusivoDAO; +import com.rjconsultores.ventaboletos.entidad.AsientoExclusivo; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("asientoExclusivoDAO") +public class AsientoExclusivoHibernateDAO extends GenericHibernateDAO + implements AsientoExclusivoDAO { + + @Autowired + public AsientoExclusivoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AutobusHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutobusHibernateDAO.java new file mode 100644 index 000000000..5127bd095 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutobusHibernateDAO.java @@ -0,0 +1,49 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.AutobusDAO; +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("autobusDAO") +public class AutobusHibernateDAO extends GenericHibernateDAO + implements AutobusDAO { + + @Autowired + public AutobusHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("numautobus")); + + return c.list(); + } + + public List buscar(String numautobus, DiagramaAutobus diagramaAutobus) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("numautobus", numautobus)); + c.add(Restrictions.eq("diagramaAutobus", diagramaAutobus)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionHibernateDAO.java new file mode 100644 index 000000000..c537cfbfa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionHibernateDAO.java @@ -0,0 +1,49 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.AutorizacionDAO; +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.Perfil; + +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("autorizacionDAO") +public class AutorizacionHibernateDAO extends GenericHibernateDAO + implements AutorizacionDAO { + + @Autowired + public AutorizacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombautorizacion")); + + return c.list(); + } + + public List buscar(String nombautorizacion, String descautorizacion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("nombautorizacion", nombautorizacion)); + c.add(Restrictions.eq("descautorizacion", descautorizacion)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionPerfilHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionPerfilHibernateDAO.java new file mode 100644 index 000000000..3ff50cfdd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AutorizacionPerfilHibernateDAO.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.AutorizacionPerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("autorizacionPerfilDAO") +public class AutorizacionPerfilHibernateDAO extends GenericHibernateDAO + implements AutorizacionPerfilDAO { + + @Autowired + public AutorizacionPerfilHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Autorizacion autorizacion, Perfil perfil) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("autorizacion", autorizacion)); + c.add(Restrictions.eq("perfil", perfil)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/BancoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/BancoHibernateDAO.java new file mode 100644 index 000000000..9ee11427c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/BancoHibernateDAO.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.BancoDAO; +import com.rjconsultores.ventaboletos.entidad.Banco; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("bancoDAO") +public class BancoHibernateDAO extends GenericHibernateDAO + implements BancoDAO { + + @Autowired + public BancoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscar(Banco banco) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("puntoVenta", banco.getPuntoVenta())); + c.add(Restrictions.eq("empresa", banco.getEmpresa())); + c.add(Restrictions.eq("moneda", banco.getMoneda())); + c.add(Restrictions.eq("nombbanco", banco.getNombbanco().trim())); + c.add(Restrictions.eq("refcontrato", banco.getRefcontrato().trim())); + c.add(Restrictions.eq("numcuenta", banco.getNumcuenta())); + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCargoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCargoHibernateDAO.java new file mode 100644 index 000000000..079d896a5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCargoHibernateDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CancelacionCargoDAO; +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("cancelacionCargoDAO") +public class CancelacionCargoHibernateDAO extends GenericHibernateDAO + implements CancelacionCargoDAO { + + @Autowired + public CancelacionCargoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCtrlHibernateDAO.java new file mode 100644 index 000000000..a2b55ecb7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CancelacionCtrlHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CancelacionCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("cancelacionCtrlDAO") +public class CancelacionCtrlHibernateDAO extends GenericHibernateDAO + implements CancelacionCtrlDAO { + + @Autowired + public CancelacionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(Date tiempoprevsalida, PuntoVenta puntoVenta, Parada paradaOrigem, + Parada paradaDestino, Marca marca) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("tiempoprevsalida", tiempoprevsalida)); + c.add(Restrictions.eq("puntoVenta", puntoVenta)); + c.add(Restrictions.eq("paradaOrigem", paradaOrigem)); + c.add(Restrictions.eq("paradaDestino", paradaDestino)); + c.add(Restrictions.eq("marca", marca)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaClaseHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaClaseHibernateDAO.java new file mode 100644 index 000000000..199636b48 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaClaseHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaClaseDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaClaseDAO") +public class CategoriaClaseHibernateDAO extends GenericHibernateDAO + implements CategoriaClaseDAO { + + @Autowired + public CategoriaClaseHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl)); + + return (CategoriaClase) c.uniqueResult(); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCorridaHibernateDAO.java new file mode 100644 index 000000000..b20b81a80 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCorridaHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaCorridaDAO") +public class CategoriaCorridaHibernateDAO extends GenericHibernateDAO + implements CategoriaCorridaDAO { + + @Autowired + public CategoriaCorridaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl)); + + return (CategoriaCorrida) c.uniqueResult(); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCtrlHibernateDAO.java new file mode 100644 index 000000000..4ec3086f9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaCtrlHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaCtrlDAO") +public class CategoriaCtrlHibernateDAO extends GenericHibernateDAO + implements CategoriaCtrlDAO { + + @Autowired + public CategoriaCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaDescuentoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaDescuentoHibernateDAO.java new file mode 100644 index 000000000..da17a82ac --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaDescuentoHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaDescuentoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaDescuentoDAO") +public class CategoriaDescuentoHibernateDAO + extends GenericHibernateDAO + implements CategoriaDescuentoDAO { + + @Autowired + public CategoriaDescuentoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaHibernateDAO.java new file mode 100644 index 000000000..e935d3d32 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaDAO") +public class CategoriaHibernateDAO extends GenericHibernateDAO + implements CategoriaDAO { + + @Autowired + public CategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desccategoria")); + + return c.list(); + } + + public List buscar(String desccategoria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desccategoria", desccategoria)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMarcaHibernateDAO.java new file mode 100644 index 000000000..e8cbc17d6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMarcaHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaMarcaDAO") +public class CategoriaMarcaHibernateDAO extends GenericHibernateDAO + implements CategoriaMarcaDAO { + + @Autowired + public CategoriaMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl)); + + return (CategoriaMarca) c.uniqueResult(); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMercadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMercadoHibernateDAO.java new file mode 100644 index 000000000..84ad8a3c6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaMercadoHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaMercadoDAO") +public class CategoriaMercadoHibernateDAO + extends GenericHibernateDAO + implements CategoriaMercadoDAO { + + @Autowired + public CategoriaMercadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl)); + + return (CategoriaMercado) c.uniqueResult(); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaPeriodoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaPeriodoHibernateDAO.java new file mode 100644 index 000000000..6ca33d17a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaPeriodoHibernateDAO.java @@ -0,0 +1,77 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaPeriodoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Query; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("categoriaPeriodoDAO") +public class CategoriaPeriodoHibernateDAO + extends GenericHibernateDAO + implements CategoriaPeriodoDAO { + + @Autowired + public CategoriaPeriodoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo) { + + Calendar feciniciovigencia = Calendar.getInstance(); + feciniciovigencia.setTime(cPeriodo.getFecinicio()); + feciniciovigencia.set(Calendar.MILLISECOND, 0); + feciniciovigencia.set(Calendar.SECOND, 0); + + Calendar fecfinvigencia = Calendar.getInstance(); + fecfinvigencia.setTime(cPeriodo.getFecfin()); + fecfinvigencia.set(Calendar.MILLISECOND, 0); + fecfinvigencia.set(Calendar.SECOND, 0); + + Criteria c = this.getSession().createCriteria(CategoriaPeriodo.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfin", feciniciovigencia.getTime())); + c.add(Restrictions.le("fecinicio", fecfinvigencia.getTime())); + c.add(Restrictions.eq("categoriaDescuento", cPeriodo.getCategoriaDescuento())); + + + return c.list(); + } + + @Override + public List obtenerPorCategoriaDescuento(CategoriaDescuento categoriaDescuento) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("categoriaDescuento", categoriaDescuento)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaTipoPtoVtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaTipoPtoVtaHibernateDAO.java new file mode 100644 index 000000000..5cc9c0d84 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CategoriaTipoPtoVtaHibernateDAO.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CategoriaTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("categoriaTipoPtoVtaDAO") +public class CategoriaTipoPtoVtaHibernateDAO extends GenericHibernateDAO + implements CategoriaTipoPtoVtaDAO { + + @Autowired + public CategoriaTipoPtoVtaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tipoPuntoVenta", tipoPuntoVenta)); + + return c.list(); + } + + public void borrarFisico(CategoriaTipoPtoVta cd) { + + String hql = " delete from CategoriaTipoPtoVta where categoriatipoptovtaId = " + cd.getCategoriatipoptovtaId(); + Query sq = getSession().createQuery(hql); + sq.executeUpdate(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CiudadHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CiudadHibernateDAO.java new file mode 100644 index 000000000..338e73885 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CiudadHibernateDAO.java @@ -0,0 +1,60 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CiudadDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.MatchMode; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author MCosso + */ +@Repository("ciudadDAO") +public class CiudadHibernateDAO extends GenericHibernateDAO + implements CiudadDAO { + + @Autowired + public CiudadHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombciudad")); + + return c.list(); + } + + public List buscar(String nombciudad, Estado estado, Plaza plaza) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombciudad", nombciudad)); + c.add(Restrictions.eq("estado", estado)); + + return c.list(); + } + + public List buscaLike(String strCiudad) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.like("nombciudad", strCiudad, MatchMode.START)); + c.addOrder(Order.asc("nombciudad")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ClaseservicioEquivalenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClaseservicioEquivalenciaHibernateDAO.java new file mode 100644 index 000000000..4276dc1b3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClaseservicioEquivalenciaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ClaseservicioEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("claseservicioEquivalenciaDAO") +public class ClaseservicioEquivalenciaHibernateDAO + extends GenericHibernateDAO + implements ClaseservicioEquivalenciaDAO { + + @Autowired + public ClaseservicioEquivalenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(ClaseServicio claseServicio, ComisionistaExterno comisionistaExterno) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("claseservicio", claseServicio)); + c.add(Restrictions.eq("comisionistaExterno", comisionistaExterno)); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarEquivalencia(ClaseservicioEquivalencia claseServicioEquivalencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("equivalenciaId", claseServicioEquivalencia.getEquivalenciaId())); + + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ClasseServicoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClasseServicoHibernateDAO.java new file mode 100644 index 000000000..e960a0252 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClasseServicoHibernateDAO.java @@ -0,0 +1,57 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ClasseServicoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("claseServicioDAO") +public class ClasseServicoHibernateDAO extends GenericHibernateDAO + implements ClasseServicoDAO { + + @Autowired + public ClasseServicoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descclase")); + + return c.list(); + } + + public List buscarPorNome(String nomeClaseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descclase", nomeClaseServicio)); + + return c.list(); + } + public List buscarTodosExceto(Integer ... idClase){ + Criteria c = this.makeCriteria(); + for (Integer id : idClase) { + c.add(Restrictions.ne("claseservicioId", id.shortValue())); + } + c.add(Restrictions.eq("activo",Boolean.TRUE)); + c.addOrder(Order.asc("descclase")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ColoniaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ColoniaHibernateDAO.java new file mode 100644 index 000000000..61977859a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ColoniaHibernateDAO.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ColoniaDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import java.util.List; +import org.hibernate.criterion.Order; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("coloniaDAO") +public class ColoniaHibernateDAO extends GenericHibernateDAO + implements ColoniaDAO { + + @Autowired + public ColoniaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desccolonia")); + + return c.list(); + } + + public List buscar(String desccolonia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desccolonia", desccolonia)); + + return c.list(); + } + + public List buscarPorCiudad(Ciudad ciudad) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("ciudad", ciudad)); + c.addOrder(Order.asc("desccolonia")); + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ComisionistaExternoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ComisionistaExternoHibernateDAO.java new file mode 100644 index 000000000..8a3adcb70 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ComisionistaExternoHibernateDAO.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ComisionistaExternoDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("comisionistaExternoDAO") +public class ComisionistaExternoHibernateDAO extends GenericHibernateDAO + implements ComisionistaExternoDAO { + + @Autowired + public ComisionistaExternoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desccomisionista")); + + return c.list(); + } + + public List buscar(String desccomisionista) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desccomisionista", desccomisionista)); + + c.addOrder(Order.asc("desccomisionista")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CompaniaBancariaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CompaniaBancariaHibernateDAO.java new file mode 100644 index 000000000..62c742f20 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CompaniaBancariaHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CompaniaBancariaDAO; +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("companiaBancariaDAO") +public class CompaniaBancariaHibernateDAO extends GenericHibernateDAO + implements CompaniaBancariaDAO { + + @Autowired + public CompaniaBancariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(CompaniaBancaria companiaBancaria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.eq("cvecompania", companiaBancaria.getCvecompania())); + c.add(Restrictions.eq("cvesucursal", companiaBancaria.getCvesucursal())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ConductorHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConductorHibernateDAO.java new file mode 100644 index 000000000..f9ba60bcb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConductorHibernateDAO.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ConductorDAO; +import com.rjconsultores.ventaboletos.entidad.Conductor; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("conductorDAO") +public class ConductorHibernateDAO extends GenericHibernateDAO + implements ConductorDAO { + + @Autowired + public ConductorHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Conductor buscar(String claveConductor, String contraSenha) { + Conductor c = new Conductor(1); + c.setNombconductor("Rodrigo"); + + return c; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ConfigRestriccionPagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConfigRestriccionPagoHibernateDAO.java new file mode 100644 index 000000000..73c1cf39f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConfigRestriccionPagoHibernateDAO.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ConfigRestriccionPagoDAO; +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("configRestriccionPagoDAO") +public class ConfigRestriccionPagoHibernateDAO + extends GenericHibernateDAO + implements ConfigRestriccionPagoDAO { + + @Autowired + public ConfigRestriccionPagoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(FormaPago formaPago, + RestriccionPago restriccionPago) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("restriccion", restriccionPago)); + c.add(Restrictions.eq("formaPago", formaPago)); + + return c.list(); + } + + public Map buscar(FormaPago formaPago) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("formaPago", formaPago)); + + Map mapRespuesta = new LinkedHashMap(); + + List list = c.list(); + if (!list.isEmpty()) { + for (ConfigRestriccionPago crp : list) { + mapRespuesta.put(crp.getRestriccion().getRestriccionId().intValue(), crp); + } + } + + return mapRespuesta; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ConstanteHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConstanteHibernateDAO.java new file mode 100644 index 000000000..cec1db24f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConstanteHibernateDAO.java @@ -0,0 +1,57 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ConstanteDAO; +import com.rjconsultores.ventaboletos.entidad.Constante; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("constanteDAO") +public class ConstanteHibernateDAO extends GenericHibernateDAO + implements ConstanteDAO { + + @Autowired + public ConstanteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombconstante")); + + return c.list(); + } + + public Constante buscarPorNomeConstante(String nomeConstante) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombconstante", nomeConstante)); + + return (Constante) c.uniqueResult(); + } + + public List buscar(String nombconstante) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombconstante", nombconstante)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioDetHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioDetHibernateDAO.java new file mode 100644 index 000000000..1cdb9cf8f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioDetHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ConvenioDetDAO; +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("convenioDetDAO") +public class ConvenioDetHibernateDAO extends GenericHibernateDAO + implements ConvenioDetDAO { + + @Autowired + public ConvenioDetHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioHibernateDAO.java new file mode 100644 index 000000000..e92fb815b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ConvenioHibernateDAO.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.Convenio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("convenioDAO") +public class ConvenioHibernateDAO extends GenericHibernateDAO + implements ConvenioDAO { + + @Autowired + public ConvenioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descconvenio")); + + return c.list(); + } + + public List buscar(String descconvenio, String cveconvenio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descconvenio", descconvenio)); + c.add(Restrictions.eq("cveconvenio", cveconvenio)); + + c.addOrder(Order.asc("descconvenio")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaCtrlHibernateDAO.java new file mode 100644 index 000000000..a1be403a2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaCtrlHibernateDAO.java @@ -0,0 +1,59 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CorridaCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("corridaCtrlDAO") +public class CorridaCtrlHibernateDAO extends GenericHibernateDAO + implements CorridaCtrlDAO { + + @Autowired + public CorridaCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, + Date horario, boolean isPisoExtra) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("horario", horario)); + + if (isPisoExtra) { + //CorridaCtrl para Piso Extra + c.add(Restrictions.eq("pisoExtra", true)); + } else { + //num piso == null ou false + c.add(Restrictions.or(Restrictions.not(Restrictions.eq("pisoExtra", true)), Restrictions.isNull("pisoExtra"))); + } + + List lsCorridaCtrl = c.list(); + + if ((lsCorridaCtrl == null) || (lsCorridaCtrl.isEmpty())) { + return null; + } else { + return lsCorridaCtrl.get(0); + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java new file mode 100644 index 000000000..7505d0473 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java @@ -0,0 +1,305 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.CorridaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Corrida.Id; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; + +/** + * + * @author rodrigo + */ +@Repository("corridaDAO") +public class CorridaHibernateDAO extends GenericHibernateDAO implements CorridaDAO { + + private static Logger log = Logger.getLogger(CorridaHibernateDAO.class); + + @Autowired + public CorridaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public Boolean existe(Id id) { + + Criteria c = makeCriteria(); + c.setProjection(Projections.rowCount()); + c.add(Restrictions.eq("id", id)); + + Long cant = HibernateFix.count(c.list()); + + return (cant > 0); + + } + + @Override + public Corrida suscribir(Corrida entity) { + + if (ApplicationProperties.getInstance().gerarCampoEquivalenciaCorrida()) { + Object o = this.getSession().createSQLQuery("SELECT VTABOL.CORRIDA_EQUIVALENCIA_SEQ.NEXTVAL FROM DUAL").uniqueResult(); + entity.setEquivalenciaId(o.toString()); + } + + Corrida corrida = super.suscribir(entity); + this.getSession().flush(); + return corrida; + } + + public List buscarPorAutobusCorridasFuturas(DiagramaAutobus diagramaAutobus) { + String hql = " select co from Corrida co, Autobus ab " + + " where ab.autobusId = co.autobus.autobusId " + + " and ab.diagramaAutobus.diagramaautobusId = " + diagramaAutobus.getDiagramaautobusId() + + " and co.id.feccorrida > current_timestamp()"; + + Query sq = getSession().createQuery(hql); + List lsCorridas = sq.list(); + + return lsCorridas; + } + + public List buscarPorRolOperativoCorridasFuturas(DiagramaAutobus diagramaAutobus) { + String hql = " select co from Corrida co, RolOperativo rol " + + " where rol.roloperativoId = co.rolOperativo.roloperativoId " + + " and rol.diagramaAutobus.diagramaautobusId = " + diagramaAutobus.getDiagramaautobusId() + + " and co.id.feccorrida > current_timestamp()"; + + Query sq = getSession().createQuery(hql); + List lsCorridas = sq.list(); + + return lsCorridas; + } + + public List buscarPorFecCorrida(Date value) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("id.feccorrida", value)); + + return c.list(); + } + + public Long count(Ruta ruta) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.setProjection(Projections.rowCount()); + + return HibernateFix.count(c.list()); + + } + + public List buscarPorId(Integer idCorrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("id.corridaId", idCorrida)); + + return c.list(); + } + + // Metodo Ok. + public List buscarFiltro(Parada ori, Parada des, Date hora, ClaseServicio cs) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + // SimpleDateFormat sf = new + // SimpleDateFormat("dd/MM/yyyy HH:mm:ss,SSS"); + // log.debug("Hora Corrida : " + sf.format(hora)); + // log.debug("Hora Corrida INI : " + + // sf.format(getDiaGeracaoHoraIni(hora))); + // log.debug("Hora Corrida FIM : " + + // sf.format(getDiaGeracaoHoraFim(hora))); + // log.debug("Origem : " + ori.getParadaId()); + // log.debug("Destino : " + des.getParadaId()); + // log.debug("Classe de Ser: " + cs.getClaseservicioId()); + + c.add(Restrictions.eq("origem", ori)); + c.add(Restrictions.eq("destino", des)); + c.add(Restrictions.between("fechorsalida", getDiaGeracaoHoraIni(hora), getDiaGeracaoHoraFim(hora))); + c.add(Restrictions.eq("claseServicio", cs)); + + return c.list(); + } + + @Override + public boolean count(Parada ori, Parada des, Date hora, ClaseServicio cs, boolean pisoExtra) { + + Criteria c = makeCriteria(); + c.setProjection(Projections.rowCount()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("origem", ori)); + c.add(Restrictions.eq("destino", des)); + c.add(Restrictions.between("fechorsalida", getDiaGeracaoHoraIni(hora), getDiaGeracaoHoraFim(hora))); + c.add(Restrictions.eq("claseServicio", cs)); + + // Se for piso extra numPiso = 2 + if (pisoExtra) { + // Corrida Piso Extra + c.add(Restrictions.eq("numPiso", 2)); + } else { + // num piso == null ou diferente de 2 + c.add(Restrictions.or(Restrictions.not(Restrictions.eq("numPiso", 2)), Restrictions.isNull("numPiso"))); + } + + Long cant = HibernateFix.count(c.list()); + + return (cant > 0); + } + + private Date getDiaGeracaoHoraIni(Date hora) { + Date dataCorreta = new Date(); + + // para pegar a hora e adicionar ao dia da geracao: + GregorianCalendar gAux = new GregorianCalendar(); + gAux.setTime(hora); + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(hora); + gcalendar.set(Calendar.HOUR_OF_DAY, gAux.get(Calendar.HOUR_OF_DAY)); + gcalendar.set(Calendar.MINUTE, gAux.get(Calendar.MINUTE)); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 0); + + dataCorreta = gcalendar.getTime(); + + return dataCorreta; + } + + private Date getDiaGeracaoHoraFim(Date hora) { + Date dataCorreta = new Date(); + + // para pegar a hora e adicionar ao dia da geracao: + GregorianCalendar gAux = new GregorianCalendar(); + gAux.setTime(hora); + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(hora); + gcalendar.set(Calendar.HOUR_OF_DAY, gAux.get(Calendar.HOUR_OF_DAY)); + gcalendar.set(Calendar.MINUTE, gAux.get(Calendar.MINUTE)); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 59); + + dataCorreta = gcalendar.getTime(); + + return dataCorreta; + } + + @Override + public List buscarDistinct(Parada ori, Parada des, Date horaSalidaInicio, Date horaSalidaFin, ClaseServicio cs, Integer corridaId) { + StringBuilder hql = new StringBuilder(""); + hql.append("select distinct "); + hql.append(" new com.rjconsultores.ventaboletos.entidad.Corrida("); + hql.append(" c.marca, "); + hql.append(" c.id.corridaId, "); + hql.append(" c.origem, "); + hql.append(" c.destino, "); + hql.append(" c.claseServicio, "); + hql.append(" c.corridaCtrl.horario) "); + hql.append("from "); + hql.append(" Corrida c "); + hql.append("where "); + hql.append(" 1 = 1 "); + if (ori != null) { + hql.append(" and c.origem = :origen "); + } + if (des != null) { + hql.append(" and c.destino = :destino"); + } + if (cs != null) { + hql.append(" and c.claseServicio = :claseServicio "); + } + if (corridaId != null) { + hql.append(" and c.id.corridaId = :corridaId "); + } + if (horaSalidaInicio != null) { + + hql.append(" and c.corridaCtrl.horario >= :horaSalidaInicio"); + } + if (horaSalidaFin != null) { + + hql.append(" and c.corridaCtrl.horario <= :horaSalidaFin"); + } + + hql.append(" order by c.id.corridaId,c.corridaCtrl.horario"); + + Query query = getSession().createQuery(hql.toString());// .setResultTransformer(new + // AliasToBeanResultTransformer(Corrida.class)); + if (ori != null) { + query.setParameter("origen", ori); + } + if (des != null) { + query.setParameter("destino", des); + } + if (cs != null) { + query.setParameter("claseServicio", cs); + } + if (corridaId != null) { + query.setParameter("corridaId", corridaId); + } + + if (horaSalidaInicio != null) { + + query.setParameter("horaSalidaInicio", horaSalidaInicio); + } + if (horaSalidaFin != null) { + query.setParameter("horaSalidaFin", horaSalidaFin); + + } + + return query.list(); + } + + @Override + public boolean existe(Ruta ruta, Date fecCorrida, Date horaCorrida, ClaseServicio claseServicio, Marca marca, boolean pisoExtra) { + Calendar soloFecha = Calendar.getInstance(); + soloFecha.setTime(fecCorrida); + soloFecha.set(Calendar.HOUR, 0); + soloFecha.set(Calendar.MINUTE, 0); + soloFecha.set(Calendar.SECOND, 0); + soloFecha.set(Calendar.MILLISECOND, 0); + + Criteria c = makeCriteria(); + c.setProjection(Projections.rowCount()); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("id.feccorrida", soloFecha.getTime())); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("marca", marca)); + + // Se for piso extra numPiso = 2 + if (pisoExtra) { + // Corrida Piso Extra + c.add(Restrictions.eq("numPiso", 2)); + } else { + // num piso == null ou diferente de 2 + c.add(Restrictions.or(Restrictions.not(Restrictions.eq("numPiso", 2)), Restrictions.isNull("numPiso"))); + } + + Criteria cCorridaCtrl = c.createCriteria("corridaCtrl"); + cCorridaCtrl.add(Restrictions.eq("horario", horaCorrida)); + + Long cant = HibernateFix.count(c.list()); + + return (cant > 0); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java new file mode 100644 index 000000000..e81429213 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java @@ -0,0 +1,62 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.CorridaTramoDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import java.math.BigDecimal; +import org.hibernate.Query; + +@Repository("corridaTramoDAO") +public class CorridaTramoHibernateDAO extends GenericHibernateDAO implements CorridaTramoDAO { + + @Autowired + public CorridaTramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTramoTarjetaEmitida() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.isNotNull("fechortarjetaviaje")); + c.add(Restrictions.isNull("indmanttarjeta")); + c.add(Restrictions.eq("numsecuencia", (short) 1)); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarTarjetaMesmaCorrida(CorridaTramo ct) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("corrida", ct.getCorrida())); + + return c.list(); + } + + public BigDecimal buscarSumTarjetaMesmaCorrida(CorridaTramo ct) { + + String hql = " select sum(t.kmReal) from CorridaTramo ct, Tramo t " + + " where ct.tramo.tramoId = t.tramoId and ct.activo = 1 " + + " and ct.corrida.id.corridaId = :id " + + " and ct.corrida.id.feccorrida = :data " + + " group by ct.corrida.id.corridaId,ct.corrida.id.feccorrida "; + + Query sq = getSession().createQuery(hql); + sq.setParameter("id", ct.getCorrida().getId().getCorridaId()); + sq.setDate("data", ct.getCorrida().getId().getFeccorrida()); + + BigDecimal km = (BigDecimal) sq.uniqueResult(); + + return km; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaBeneficiarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaBeneficiarioHibernateDAO.java new file mode 100644 index 000000000..75245e218 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaBeneficiarioHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CortesiaBeneficiarioDAO; +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("cortesiaBeneficiarioDAO") +public class CortesiaBeneficiarioHibernateDAO extends GenericHibernateDAO + implements CortesiaBeneficiarioDAO { + + @Autowired + public CortesiaBeneficiarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaDireccionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaDireccionHibernateDAO.java new file mode 100644 index 000000000..a2f28fe3d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaDireccionHibernateDAO.java @@ -0,0 +1,115 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CortesiaDireccionDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.hibernate.Query; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("cortesiaDireccionDAO") +public class CortesiaDireccionHibernateDAO extends GenericHibernateDAO + implements CortesiaDireccionDAO { + + @Autowired + public CortesiaDireccionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(Marca marca, ClaseServicio claseServicio, + Date fecInicio, Date fecFinal) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (marca != null) { + c.add(Restrictions.eq("marca", marca)); + } + + if (claseServicio != null) { + c.add(Restrictions.eq("claseServicio", claseServicio)); + } + + if (fecInicio != null) { + c.add(Restrictions.eq("fecInicioV", fecInicio)); + } + + if (fecFinal != null) { + c.add(Restrictions.eq("fecFinV", fecFinal)); + } + + return c.list(); + } + + public List buscar(CortesiaDireccion cortesiaDireccion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + +// if (cortesiaDireccion.getFecInicioV() != null) { +// c.add(Restrictions.eq("fecInicioV", cortesiaDireccion.getFecInicioV())); +// } +// +// if (cortesiaDireccion.getFecFinV() != null) { +// c.add(Restrictions.eq("fecFinV", cortesiaDireccion.getFecFinV())); +// } + + if (cortesiaDireccion.getClaseServicio() != null) { + c.add(Restrictions.eq("claseServicio", cortesiaDireccion.getClaseServicio())); + } + + if (cortesiaDireccion.getMarca() != null) { + c.add(Restrictions.eq("marca", cortesiaDireccion.getMarca())); + } + + if (cortesiaDireccion.getTipocortesiaDescuento() != null) { + c.add(Restrictions.eq("tipocortesiaDescuento", + cortesiaDireccion.getTipocortesiaDescuento())); + } + + return c.list(); + } + + public List buscarFolio(CortesiaDireccion cortesiaDireccion) { + + Integer folioInicio = cortesiaDireccion.getNumFolioInicio(); + Integer folioFim = cortesiaDireccion.getNumFolioFin(); + + String hql = "select pv from CortesiaDireccion pv " + + " where pv.activo = 1 " + + " and tipocortesiaDescuento = " + cortesiaDireccion.getTipocortesiaDescuento().getTipocortesiadescuentoId() + + " and marca = " + cortesiaDireccion.getMarca().getMarcaId() + + " and claseServicio = " + cortesiaDireccion.getClaseServicio().getClaseservicioId() + + " and (((( " + folioInicio + " BETWEEN numFolioInicio AND numFolioFin ) " + + " OR " + folioFim + " BETWEEN numFolioInicio AND numFolioFin)) " + + " OR ((numFolioInicio BETWEEN " + folioInicio + " AND " + folioFim + ") " + + " OR (numFolioFin BETWEEN " + folioInicio + " AND " + folioFim + "))) "; + + Query sq = getSession().createQuery(hql); + + return sq.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java new file mode 100644 index 000000000..78068d3a7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CortesiaDAO; +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("cortesiaDAO") +public class CortesiaHibernateDAO extends GenericHibernateDAO + implements CortesiaDAO { + + @Autowired + public CortesiaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(Empleado empleado) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + if (empleado != null) { + c.add(Restrictions.eq("empleado", empleado)); + } + return c.list(); + } + + public Cortesia buscar(Cortesia cortesia) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + if (cortesia != null) { + c.add(Restrictions.eq("empleado", cortesia)); + } + return (Cortesia) c.uniqueResult(); + } + + public List buscarDplicidad(Cortesia cortesia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("empleado", cortesia.getEmpleado())); + c.add(Restrictions.eq("marca", cortesia.getMarca())); + c.add(Restrictions.eq("claseServicio", cortesia.getClaseServicio())); + c.add(Restrictions.eq("origem", cortesia.getOrigem())); + c.add(Restrictions.eq("destino", cortesia.getDestino())); + c.add(Restrictions.eq("fecinicio", cortesia.getFecinicio())); + c.add(Restrictions.eq("fecfinal", cortesia.getFecfinal())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponConvenioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponConvenioHibernateDAO.java new file mode 100644 index 000000000..e529234bb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponConvenioHibernateDAO.java @@ -0,0 +1,49 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CuponConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("cuponConvenioDAO") +public class CuponConvenioHibernateDAO extends GenericHibernateDAO + implements CuponConvenioDAO { + + @Autowired + public CuponConvenioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(TipoConvenio tipoConvenio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (tipoConvenio != null) { + c.add(Restrictions.eq("tipoConvenio", tipoConvenio)); + } + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponSecretariaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponSecretariaHibernateDAO.java new file mode 100644 index 000000000..b3ed0965a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CuponSecretariaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.CuponSecretariaDAO; +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("cuponSecretariaDAO") +public class CuponSecretariaHibernateDAO extends GenericHibernateDAO + implements CuponSecretariaDAO { + + @Autowired + public CuponSecretariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/DepositoBancarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/DepositoBancarioHibernateDAO.java new file mode 100644 index 000000000..7143a1043 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/DepositoBancarioHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.DepositoBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.DepositoBancario; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("depositoBancarioDAO") +public class DepositoBancarioHibernateDAO extends GenericHibernateDAO + implements DepositoBancarioDAO { + + @Autowired + public DepositoBancarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/DetDiagramaAutobusHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/DetDiagramaAutobusHibernateDAO.java new file mode 100644 index 000000000..8e52d2410 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/DetDiagramaAutobusHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.DetDiagramaAutobusDAO; +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("detDiagramaAutobusDAO") +public class DetDiagramaAutobusHibernateDAO extends GenericHibernateDAO + implements DetDiagramaAutobusDAO { + + @Autowired + public DetDiagramaAutobusHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/DiagramaAutobusHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/DiagramaAutobusHibernateDAO.java new file mode 100644 index 000000000..beae5a277 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/DiagramaAutobusHibernateDAO.java @@ -0,0 +1,60 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.DiagramaAutobusDAO; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("diagramaAutobusDAO") +public class DiagramaAutobusHibernateDAO extends GenericHibernateDAO + implements DiagramaAutobusDAO { + + @Autowired + public DiagramaAutobusHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descDiagrama")); + + return c.list(); + } + + public List buscar(String descDiagrama, Short maxparados, + Short cantasientos) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("cantasientos", cantasientos)); + c.add(Restrictions.eq("maxparados", maxparados)); + c.add(Restrictions.eq("descDiagrama", descDiagrama)); + + return c.list(); + } + + public List buscar(String descDiagrama) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descDiagrama", descDiagrama)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/DivisionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/DivisionHibernateDAO.java new file mode 100644 index 000000000..8d9ef3167 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/DivisionHibernateDAO.java @@ -0,0 +1,32 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.DivisionDAO; +import com.rjconsultores.ventaboletos.entidad.Division; + + +@Repository("divisionDAO") +public class DivisionHibernateDAO extends GenericHibernateDAO +implements DivisionDAO { + + @Autowired + public DivisionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpladoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpladoHibernateDAO.java new file mode 100644 index 000000000..3304e022c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpladoHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EmpleadoDAO; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("empladoDAO") +public class EmpladoHibernateDAO extends GenericHibernateDAO + implements EmpleadoDAO { + + @Autowired + public EmpladoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisaClave(String empleadoClave) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("cveEmpleado", empleadoClave)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaEquivalenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaEquivalenciaHibernateDAO.java new file mode 100644 index 000000000..2981ad4c2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaEquivalenciaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EmpresaEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("empresaEquivalenciaDAO") +public class EmpresaEquivalenciaHibernateDAO + extends GenericHibernateDAO + implements EmpresaEquivalenciaDAO { + + @Autowired + public EmpresaEquivalenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Empresa empresa, ComisionistaExterno comisionistaExterno) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("empresa", empresa)); + c.add(Restrictions.eq("comisionistaExterno", comisionistaExterno)); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(EmpresaEquivalencia empresaEquivalencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("equivalenciaId", empresaEquivalencia.getEquivalenciaId())); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java new file mode 100644 index 000000000..e5e481891 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java @@ -0,0 +1,96 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("empresaDAO") +public class EmpresaHibernateDAO extends GenericHibernateDAO + implements EmpresaDAO { + + @Autowired + public EmpresaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombempresa")); + + return c.list(); + } + + public List buscar(String nombempresa, Boolean indExterna, Short indTipo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombempresa", nombempresa)); + c.add(Restrictions.eq("indExterna", indExterna)); + c.add(Restrictions.eq("indTipo", indTipo)); + + return c.list(); + } + + public List buscarTodosExceto(Integer... idEmpresa) { + Criteria c = this.makeCriteria(); + for (Integer id : idEmpresa) { + c.add(Restrictions.ne("empresaId", id)); + } + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombempresa")); + return c.list(); + + } + + public List obtenerIndExternoFalse() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("indExterna", Boolean.FALSE)); + + c.addOrder(Order.asc("nombempresa")); + + return c.list(); + } + + public List obtenerIndTipo1() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("indTipo", new Short("1"))); + + //Nao Buscar Empresa todas + c.add(Restrictions.ne("empresaId", -1)); + + c.addOrder(Order.asc("nombempresa")); + + return c.list(); + } + + public List obtenerIndTipo2() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("indTipo", new Short("2"))); + + //Nao Buscar Empresa todas + c.add(Restrictions.ne("empresaId", -1)); + + c.addOrder(Order.asc("nombempresa")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaAsientoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaAsientoHibernateDAO.java new file mode 100644 index 000000000..5cf26b3ef --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaAsientoHibernateDAO.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EsquemaAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("esquemaAsientoHibernateDAO") +public class EsquemaAsientoHibernateDAO extends GenericHibernateDAO + implements EsquemaAsientoDAO { + + @Autowired + public EsquemaAsientoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List obtenerPorCorrida(EsquemaCorrida esquemaCorrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("esquemaCorrida", esquemaCorrida)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public EsquemaAsiento obtenerPorCorridaeAsiento(EsquemaCorrida esquemaCorrida, String asiento) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("esquemaCorrida", esquemaCorrida)); + c.add(Restrictions.eq("numasiento", asiento)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + EsquemaAsiento ea = new EsquemaAsiento(); + if (c.list().size() > 0) { + ea = (EsquemaAsiento) c.uniqueResult(); + } + return ea; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaCorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaCorridaHibernateDAO.java new file mode 100644 index 000000000..f15f035cf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaCorridaHibernateDAO.java @@ -0,0 +1,222 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.Date; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Disjunction; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; + +/** + * + * @author Rafius + */ +@Repository("esquemaCorridaDAO") +public class EsquemaCorridaHibernateDAO extends GenericHibernateDAO implements EsquemaCorridaDAO { + + @Autowired + public EsquemaCorridaHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorEsquemaOperacional( + EsquemaOperacional eo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("esquemaOperacional", eo)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(Marca marca, RolOperativo rolOperativo, + Ruta ruta, ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("rolOperativo", rolOperativo)); + + return c.list(); + } + + public List buscar(EsquemaCorrida ec) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + // if (ec.getHorasalida() != null) { + // c.add(Restrictions.eq("horasalida", ec.getHorasalida())); + // } + + // c.add(Restrictions.eq("esquemaOperacional.fecfinvigencia", + // ec.getEsquemaOperacional().getFecfinvigencia())); + // c.add(Restrictions.eq("esquemaOperacional.fecniciovigencia", + // ec.getEsquemaOperacional().getFecniciovigencia())); + + c.createCriteria("esquemaOperacional").add(Restrictions.and(Restrictions.eq("fecfinvigencia", ec.getEsquemaOperacional().getFecfinvigencia()), + Restrictions.eq("fecniciovigencia", ec.getEsquemaOperacional().getFecniciovigencia()))); + + // c.createCriteria("esquemaOperacional").add(Restrictions.eq("fecniciovigencia", + // ec.getEsquemaOperacional().getFecniciovigencia())); + + if (ec.getIndlunes() != null) { + c.add(Restrictions.eq("indlunes", ec.getIndlunes())); + } + + if (ec.getIndmartes() != null) { + c.add(Restrictions.eq("indmartes", ec.getIndmartes())); + } + + if (ec.getIndmiercoles() != null) { + c.add(Restrictions.eq("indmiercoles", ec.getIndmiercoles())); + } + + if (ec.getIndjueves() != null) { + c.add(Restrictions.eq("indjueves", ec.getIndjueves())); + } + + if (ec.getIndviernes() != null) { + c.add(Restrictions.eq("indviernes", ec.getIndviernes())); + } + + if (ec.getIndsabado() != null) { + c.add(Restrictions.eq("indsabado", ec.getIndsabado())); + } + + if (ec.getInddomingo() != null) { + c.add(Restrictions.eq("inddomingo", ec.getInddomingo())); + } + + if (ec.getCantparados() != null) { + c.add(Restrictions.eq("cantparados", ec.getCantparados())); + } + + if (ec.getStatusCorrida() != null) { + c.add(Restrictions.eq("statusCorrida", ec.getStatusCorrida())); + } + + if (ec.getRuta() != null) { + c.add(Restrictions.eq("ruta", ec.getRuta())); + } + + if (ec.getRolOperativo() != null) { + c.add(Restrictions.eq("rolOperativo", ec.getRolOperativo())); + } + + if (ec.getMarca() != null) { + c.add(Restrictions.eq("marca", ec.getMarca())); + } + + // c.add(Restrictions.eq("esquemaOperacional", + // ec.getEsquemaOperacional())); + + if (ec.getEmpresa() != null) { + c.add(Restrictions.eq("empresa", ec.getEmpresa())); + } + + if (ec.getEmpresa1() != null) { + c.add(Restrictions.eq("empresa1", ec.getEmpresa1())); + } + + if (ec.getClaseServicio() != null) { + c.add(Restrictions.eq("claseServicio", ec.getClaseServicio())); + } + + if (ec.getTipocorrida() != null) { + c.add(Restrictions.eq("tipocorrida", ec.getTipocorrida())); + } + + String cs = c.toString(); + + return c.list(); + } + + public boolean esHijoRebote(EsquemaCorrida esquemaCorrida) { + Criteria c = makeCriteria(); + c.setProjection(Projections.rowCount()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("esquemaCorridaRebote", esquemaCorrida)); + + Long cant = HibernateFix.count(c.list()); + + return (cant > 0); + } + + @Override + public List buscaDentroVigencia(Date dataGeracao) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cEsquemaOperacional = c.createCriteria("esquemaOperacional"); + cEsquemaOperacional.add(Restrictions.le("fecniciovigencia", dataGeracao)); + cEsquemaOperacional.add(Restrictions.ge("fecfinvigencia", dataGeracao)); + cEsquemaOperacional.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public boolean buscarEsquemaCorridaExisteTramo(Tramo tramo) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cEsquemaOperacional = c.createCriteria("esquemaTramoList"); + cEsquemaOperacional.add(Restrictions.eq("tramo", tramo)); + + if (c.list().isEmpty()) { + return false; + } else { + return true; + } + } + + public List existe(Ruta ruta, Integer paradaId) { + + Criteria c = makeCriteria(); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cEsquemaTramo = c.createCriteria("esquemaTramoList"); + cEsquemaTramo.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cTramo = cEsquemaTramo.createCriteria("tramo"); + + Disjunction or = Restrictions.disjunction(); + or.add(Restrictions.eq("origem.paradaId", paradaId)); + or.add(Restrictions.eq("destino.paradaId", paradaId)); + + cTramo.add(or); + + c.setProjection(Projections.property("esquemacorridaId")); + + return c.list(); + } +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaOperacionalHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaOperacionalHibernateDAO.java new file mode 100644 index 000000000..ab3332515 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaOperacionalHibernateDAO.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EsquemaOperacionalDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("esquemaOperacional") +public class EsquemaOperacionalHibernateDAO extends GenericHibernateDAO + implements EsquemaOperacionalDAO { + + @Autowired + public EsquemaOperacionalHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List dentroVigenciaEsquemaOperacional(Date dataGeracao) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.le("fecniciovigencia", dataGeracao)); + c.add(Restrictions.ge("fecfinvigencia", dataGeracao)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List dentroVigenciaEsquemaOperacional(Date dataDe, Date dataAte) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.le("fecniciovigencia", dataDe)); + c.add(Restrictions.ge("fecfinvigencia", dataAte)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaTramoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaTramoHibernateDAO.java new file mode 100644 index 000000000..2cda22797 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EsquemaTramoHibernateDAO.java @@ -0,0 +1,57 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EsquemaTramoDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("esquemaTramoDAO") +public class EsquemaTramoHibernateDAO extends GenericHibernateDAO + implements EsquemaTramoDAO { + + @Autowired + public EsquemaTramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List obtenerPorEsquemaCorrida(EsquemaCorrida ec) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("esquemaCorrida", ec)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtenerPorEsquemaCorridaOrderNumSec(EsquemaCorrida ec) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("esquemaCorrida", ec)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("numsecuencia")); + + return c.list(); + } + + public List obtenerAtivosDesativosPorEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("esquemaCorrida", esquemaCorrida)); + //c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("numsecuencia")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java new file mode 100644 index 000000000..446a0e303 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EstacionDAO; +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("estacionDAO") +public class EstacionHibernateDAO extends GenericHibernateDAO implements EstacionDAO { + + @Autowired + public EstacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descestacion")); + + return c.list(); + } + + public List buscar(String descEstacion, String descMac, Long nunCaja, PuntoVenta pv) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descestacion", descEstacion)); + c.add(Restrictions.eq("descmac", descMac)); + c.add(Restrictions.eq("numcaja", nunCaja)); + c.add(Restrictions.eq("puntoVenta", pv)); + + return c.list(); + } + + public List buscar(String descMac) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descmac", descMac)); + + return c.list(); + } + + @Override + public List buscar(Long numCaja, PuntoVenta puntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("numcaja", numCaja)); + c.add(Restrictions.eq("puntoVenta", puntoVenta)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EstadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstadoHibernateDAO.java new file mode 100644 index 000000000..a8110bfb1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstadoHibernateDAO.java @@ -0,0 +1,49 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.EstadoDAO; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author MCosso + */ +@Repository("estadoDAO") +public class EstadoHibernateDAO extends GenericHibernateDAO + implements EstadoDAO { + + @Autowired + public EstadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombestado")); + + return c.list(); + } + + public List buscar(String nombestado, Pais pais) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombestado", nombestado)); + c.add(Restrictions.eq("pais", pais)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EventoExtraHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EventoExtraHibernateDAO.java new file mode 100644 index 000000000..77d27e5c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EventoExtraHibernateDAO.java @@ -0,0 +1,40 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.EventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.EventoExtra; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +@Repository("eventoExtraDAO") +public class EventoExtraHibernateDAO extends + GenericHibernateDAO implements EventoExtraDAO { + + @Autowired + public EventoExtraHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtenerPorTipo(TipoEventoExtra tipoEventoExtra) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("tipoeventoextraId", tipoEventoExtra.getTipoeventoextraId())); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcepcionRedondoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcepcionRedondoHibernateDAO.java new file mode 100644 index 000000000..fd178be63 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcepcionRedondoHibernateDAO.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ExcepcionRedondoDAO; +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("excepcionRedondoDAO") +public class ExcepcionRedondoHibernateDAO extends GenericHibernateDAO implements ExcepcionRedondoDAO { + + @Autowired + public ExcepcionRedondoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("indtipo")); + + return c.list(); + } + + public List buscar(String indTipo, Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("indtipo", indTipo)); + + c.addOrder(Order.asc("indtipo")); + + return c.list(); + } + + @Override + public List buscar(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoDetHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoDetHibernateDAO.java new file mode 100644 index 000000000..3805d25a1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoDetHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.FormaPagoDetDAO; +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("formaPagoDetDAO") +public class FormaPagoDetHibernateDAO extends GenericHibernateDAO + implements FormaPagoDetDAO { + + @Autowired + public FormaPagoDetHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java new file mode 100644 index 000000000..6e69e0146 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java @@ -0,0 +1,58 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.FormaPagoDAO; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("formaPagoDAO") +public class FormaPagoHibernateDAO extends GenericHibernateDAO + implements FormaPagoDAO { + + @Autowired + public FormaPagoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descpago")); + + return c.list(); + } + + public List buscarPorDescricao(String descpago) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descpago", descpago)); + + return c.list(); + } + + public List buscarTodosExceto(Integer... idFormaPago) { + Criteria c = this.makeCriteria(); + for (Integer id : idFormaPago) { + c.add(Restrictions.ne("formapagoId", id.shortValue())); + } + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descpago")); + return c.list(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FuncionSistemaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FuncionSistemaHibernateDAO.java new file mode 100644 index 000000000..de6354738 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FuncionSistemaHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.FuncionSistemaDAO; +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("funcionSistemaDAO") +public class FuncionSistemaHibernateDAO extends GenericHibernateDAO + implements FuncionSistemaDAO { + + @Autowired + public FuncionSistemaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombfuncion")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GenericHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GenericHibernateDAO.java new file mode 100644 index 000000000..e5f32d082 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GenericHibernateDAO.java @@ -0,0 +1,107 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import com.rjconsultores.ventaboletos.dao.GenericDAO; +import java.io.Serializable; +import java.lang.reflect.ParameterizedType; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.HibernateException; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; + +/** + * + * @author gleimar + */ +public class GenericHibernateDAO extends HibernateDaoSupport implements GenericDAO { + + @SuppressWarnings("unchecked") + public GenericHibernateDAO() { + this.persistentClass = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + } + + // Classe que será persistida. + private Class persistentClass; + + public Class getPersistentClass() { + return this.persistentClass; + } + + @Override + public void borrar(T entity) { + try { + this.getHibernateTemplate().delete(entity); + } catch (final HibernateException ex) { + throw convertHibernateAccessException(ex); + } + } + + @SuppressWarnings("unchecked") + @Override + public T obtenerID(ID id) { + try { + return (T) this.getHibernateTemplate().get(getPersistentClass(), id); + } catch (final HibernateException ex) { + throw convertHibernateAccessException(ex); + } + } + + @Override + public List obtenerTodos() { + try { + return this.getHibernateTemplate().loadAll(getPersistentClass()); + } catch (final HibernateException ex) { + + throw convertHibernateAccessException(ex); + } + } + + @Override + public T suscribir(T entity) { + try { + this.getHibernateTemplate().save(entity); + return entity; + } catch (final HibernateException ex) { + + throw convertHibernateAccessException(ex); + } + } + + protected List findByCriteria(Criterion... criterion) { + try { + Criteria crit = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createCriteria(getPersistentClass()); + for (Criterion c : criterion) { + crit.add(c); + } + return crit.list(); + } catch (final HibernateException ex) { + throw convertHibernateAccessException(ex); + } + } + + protected Criteria makeCriteria() { + return this.getHibernateTemplate().getSessionFactory().getCurrentSession().createCriteria(getPersistentClass()); + } + + public T actualizacion(T entity) { + return getHibernateTemplate().merge(entity); + } + + public Long count(String campo, Object o) { + Criteria c = this.makeCriteria(); + + c.add(Restrictions.eq(campo, o)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.setProjection(Projections.rowCount()); + + return HibernateFix.count(c.list()); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java new file mode 100644 index 000000000..51ebee4ec --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.GrupoCortesiasDAO; +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("grupoCortesiaDAO") +public class GrupoCortesiasHibernateDAO extends GenericHibernateDAO + implements GrupoCortesiasDAO { + + @Autowired + public GrupoCortesiasHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descgrupo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descgrupo", descgrupo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/HibernateFix.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/HibernateFix.java new file mode 100644 index 000000000..db9064261 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/HibernateFix.java @@ -0,0 +1,32 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +public class HibernateFix { + /** + * Usado para garantizar que las dos versiones del hibernate 3.6 y 3.2 realicen de forma correcta el count + * @param list + * @return + */ + public static Long count(List list) { + + Object resultado = list.iterator().next(); + + return count(resultado); + } + /** + * Usado para garantizar que las dos versiones del hibernate 3.6 y 3.2 realicen de forma correcta el count + * @param list + * @return + */ + public static Long count(Object resultado) { + Long cant = 0l; + + if (resultado instanceof Integer) { + cant = Long.valueOf(((Integer) resultado).longValue()); + } else { + cant = (Long) resultado; + } + return cant; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeCategoriaVentaDAOImpl.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeCategoriaVentaDAOImpl.java new file mode 100644 index 000000000..9d2fc77fe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeCategoriaVentaDAOImpl.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.InformeCategoriaVentaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Date; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("informeCategoriaVentaDAO") +public class InformeCategoriaVentaDAOImpl implements InformeCategoriaVentaDAO { + + private static final Logger log = Logger.getLogger(InformeCategoriaVentaDAOImpl.class); + + private String getSql(PuntoVenta puntoVenta, Ruta ruta, Parada origen, + Parada destino, Empresa empresa, Integer numServicio, Date dataInicio, + Date dataFinal) { + StringBuilder where = new StringBuilder(); + where.append(" WHERE 1 = 1 "); + + if (puntoVenta != null) { + where.append(" AND pu.puntoventa_id = ").append(puntoVenta.getPuntoventaId()); + } + + if (ruta != null) { + where.append(" AND ru.ruta_id = ").append(ruta.getRutaId()); + } + + if (origen != null) { + where.append(" AND bo.origen_id = ").append(origen.getParadaId()); + } + + if (destino != null) { + where.append(" AND bo.destino_id = ").append(destino.getParadaId()); + } + + if (empresa != null) { + where.append(" AND bo.empresacorrida_id = ").append(empresa.getEmpresaId()); + } + + if (numServicio != null) { + where.append(" AND bo.corrida_id = ").append(numServicio); + } + + if (dataInicio != null) { + where.append(" AND bo.feccorrida >= ? "); + } + + if (dataFinal != null) { + where.append(" AND bo.feccorrida <= ? "); + } + + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT bo.corrida_id, bo.feccorrida, pao.descparada origen, pad.descparada destino, "); + sql.append(" ca.desccategoria, COUNT(*) qtde, SUM(bo.preciopagado) valor, ru.descruta, "); + sql.append(" pu.nombpuntoventa "); + sql.append(" FROM boleto bo "); + sql.append(" INNER JOIN categoria ca ON ca.categoria_id = bo.categoria_id "); + sql.append(" INNER JOIN parada pao ON pao.parada_id = bo.origen_id "); + sql.append(" INNER JOIN parada pad ON pad.parada_id = bo.destino_id "); + sql.append(" INNER JOIN corrida co ON co.corrida_id = bo.corrida_id "); + sql.append(" INNER JOIN ruta ru ON ru.ruta_id = co.ruta_id "); + sql.append(" INNER JOIN punto_venta pu ON pu.puntoventa_id = bo.puntoventa_id "); + sql.append(where); + sql.append(" GROUP BY bo.corrida_id, pao.descparada, pad.descparada, "); + sql.append(" ca.desccategoria, bo.feccorrida, ru.descruta, pu.nombpuntoventa "); + sql.append(" ORDER BY ca.desccategoria "); + + return sql.toString(); + } + + public ResultSet executarSQL(Connection conn, Map parameters) { + Ruta ruta = (Ruta) parameters.get("ruta"); + PuntoVenta puntoVenta = (PuntoVenta) parameters.get("puntoVenta"); + Empresa empresa = (Empresa) parameters.get("empresa"); + Parada origen = (Parada) parameters.get("origen"); + Parada destino = (Parada) parameters.get("destino"); + Integer numServicio = (Integer) parameters.get("numServicio"); + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + String sql = getSql(puntoVenta, ruta, origen, destino, empresa, + numServicio, dataInicio, dataFinal); + + PreparedStatement stmt = null; + ResultSet rset = null; + + try { + stmt = conn.prepareStatement(sql); + stmt.setDate(1, new java.sql.Date(dataInicio.getTime())); + stmt.setDate(2, new java.sql.Date(dataFinal.getTime())); + rset = stmt.executeQuery(); + } catch (Exception ex) { + log.error(ex); + } + + return rset; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/InformePasajeroServicioDAOImpl.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformePasajeroServicioDAOImpl.java new file mode 100644 index 000000000..b6a37a640 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformePasajeroServicioDAOImpl.java @@ -0,0 +1,89 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.InformePasajeroServicioDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Date; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("informePasajeroServicioDAO") +public class InformePasajeroServicioDAOImpl implements InformePasajeroServicioDAO { + + private static final Logger log = Logger.getLogger(InformePasajeroServicioDAOImpl.class); + + private String getSql(Empresa empresa, Marca marca, Integer numServicio, + Date dataInicio, Date dataFinal) { + + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT nombpasajero, feccorrida, corrida_id, boleto_id, preciopagado, "); + sql.append(" cs.descclase, pao.descparada origen, pad.descparada destino, "); + sql.append(" fechorventa, pv.nombpuntoventa, ma.descmarca, bo.usuario_id, "); + sql.append(" em.nombempresa "); + sql.append(" FROM boleto bo "); + sql.append(" INNER JOIN parada pao ON pao.parada_id = bo.origen_id "); + sql.append(" INNER JOIN parada pad ON pad.parada_id = bo.destino_id "); + sql.append(" INNER JOIN clase_servicio cs ON cs.claseservicio_id = bo.claseservicio_id "); + sql.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = bo.puntoventa_id "); + sql.append(" INNER JOIN marca ma on ma.marca_id = bo.marca_id "); + sql.append(" INNER JOIN empresa em ON em.empresa_id = bo.empresacorrida_id"); + sql.append(" WHERE 1=1 "); + + if (empresa != null) { + sql.append(" AND bo.empresacorrida_id = ").append(empresa.getEmpresaId()); + } + + if (marca != null) { + sql.append(" AND bo.marca_id = ").append(marca.getMarcaId()); + } + + if (numServicio != null) { + sql.append(" AND corrida_id = ").append(numServicio); + } + + if (dataInicio != null) { + sql.append(" AND bo.fechorventa >= ? "); + } + + if (dataFinal != null) { + sql.append(" AND bo.fechorventa <= ? "); + } + + return sql.toString(); + } + + public ResultSet executarSQL(Connection conn, Map parameters) { + Empresa empresa = (Empresa) parameters.get("empresa"); + Marca marca = (Marca) parameters.get("marca"); + Integer numServicio = (Integer) parameters.get("numServicio"); + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + + String sql = getSql(empresa, marca, numServicio, dataInicio, dataFinal); + PreparedStatement stmt = null; + ResultSet rset = null; + + try { + stmt = conn.prepareStatement(sql); + stmt.setDate(1, new java.sql.Date(dataInicio.getTime())); + stmt.setDate(2, new java.sql.Date(dataFinal.getTime())); + rset = stmt.executeQuery(); + } catch (Exception ex) { + log.error(ex); + } + + return rset; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeServicioDiarioDAOImpl.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeServicioDiarioDAOImpl.java new file mode 100644 index 000000000..e62e5d167 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeServicioDiarioDAOImpl.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.InformeServicioDiarioDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Date; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("informeServicioDiarioDAO") +public class InformeServicioDiarioDAOImpl implements InformeServicioDiarioDAO { + + private static final Logger log = Logger.getLogger(InformeServicioDiarioDAOImpl.class); + + private String getSql(Empresa empresa, Integer numServicio, Date dataInicio, + Date dataFinal) { + StringBuilder where = new StringBuilder(); + where.append(" WHERE 1 = 1 "); + + if (empresa != null) { + where.append(" AND co.empresacorrida_id = ").append(empresa.getEmpresaId()); + } + + if (numServicio != null) { + where.append(" AND co.corrida_id = ").append(numServicio); + } + + if (dataInicio != null) { + where.append(" AND co.feccorrida >= ? "); + } + + if (dataFinal != null) { + where.append(" AND co.feccorrida <= ? "); + } + + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT co.corrida_id servico, co.fechorsalida, SUM(tr.cantkmreal) km, "); + sql.append(" COUNT(co.corrida_id) qtdeservico, SUM(bo.preciopagado) receita, "); + sql.append(" ( SUM(bo.preciopagado) / SUM(tr.cantkmreal) ) rkm, em.nombempresa, "); + sql.append(" ru.descruta "); + sql.append(" FROM corrida co "); + sql.append(" INNER JOIN empresa em ON em.empresa_id = co.empresacorrida_id "); + sql.append(" INNER JOIN ruta ru ON ru.ruta_id = co.ruta_id "); + sql.append(" INNER JOIN ruta_secuencia rs ON rs.ruta_id = ru.ruta_id "); + sql.append(" INNER JOIN tramo tr ON tr.tramo_id = rs.tramo_id "); + sql.append(" INNER JOIN boleto bo ON bo.corrida_id = co.corrida_id "); + sql.append(where); + sql.append(" GROUP BY co.corrida_id, co.fechorsalida, em.nombempresa, ru.descruta "); + + return sql.toString(); + } + + public ResultSet executarSQL(Connection conn, Map parameters) { + Empresa empresa = (Empresa) parameters.get("empresa"); + Integer numServicio = (Integer) parameters.get("numServicio"); + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + String sql = getSql(empresa, numServicio, dataInicio, dataFinal); + + PreparedStatement stmt = null; + ResultSet rset = null; + + try { + stmt = conn.prepareStatement(sql); + stmt.setDate(1, new java.sql.Date(dataInicio.getTime())); + stmt.setDate(2, new java.sql.Date(dataFinal.getTime())); + rset = stmt.executeQuery(); + } catch (Exception ex) { + log.error(ex); + } + + return rset; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeVentasPuntoVentaDAOImpl.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeVentasPuntoVentaDAOImpl.java new file mode 100644 index 000000000..1c87fc79b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/InformeVentasPuntoVentaDAOImpl.java @@ -0,0 +1,90 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.InformeVentasPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Date; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("informeVentasPuntoVentaDAO") +public class InformeVentasPuntoVentaDAOImpl implements InformeVentasPuntoVentaDAO { + + private static final Logger log = Logger.getLogger(InformeVentasPuntoVentaDAOImpl.class); + + private String getSql(PuntoVenta puntoVenta, Date dataInicio, Date dataFinal) { + + StringBuilder where = new StringBuilder(); + + if (dataInicio != null) { + where.append(" AND bo.fechorventa >= ? "); + } + + if (dataFinal != null) { + where.append(" AND bo.fechorventa <= ? "); + } + + if (puntoVenta != null) { + where.append(" AND pu.puntoventa_id = ").append(puntoVenta.getPuntoventaId()); + } + + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT vendidos.puntoventa_id, vendidos.nombpuntoventa, "); + sql.append(" vendidos.qtde_total AS qtde_total_vendidos, "); + sql.append(" vendidos.valor_total AS valor_total_vendidos, "); + sql.append(" cancelado.qtde_total AS qtde_total_cancelado, "); + sql.append(" cancelado.valor_total as valor_total_cancelado "); + sql.append(" FROM (SELECT pu.puntoventa_id, pu.nombpuntoventa, "); + sql.append(" COUNT(*) qtde_total, "); + sql.append(" SUM(bo.preciopagado) valor_total "); + sql.append(" FROM boleto bo "); + sql.append(" INNER JOIN punto_venta pu ON pu.puntoventa_id = bo.puntoventa_id "); + sql.append(" WHERE bo.motivocancelacion_id IS NOT NULL ").append(where); + sql.append(" GROUP BY pu.puntoventa_id, pu.nombpuntoventa) cancelado "); + sql.append(" INNER JOIN (SELECT pu.puntoventa_id, pu.nombpuntoventa, "); + sql.append(" COUNT(*) qtde_total, "); + sql.append(" SUM(bo.preciopagado) valor_total "); + sql.append(" FROM boleto bo "); + sql.append(" INNER JOIN punto_venta pu ON pu.puntoventa_id = bo.puntoventa_id "); + sql.append(" WHERE bo.motivocancelacion_id IS NULL ").append(where); + sql.append(" GROUP BY pu.puntoventa_id, pu.nombpuntoventa) vendidos "); + sql.append(" ON cancelado.puntoventa_id = vendidos.puntoventa_id "); + sql.append(" ORDER BY nombpuntoventa "); + + return sql.toString(); + } + + public ResultSet executarSQL(Connection conn, Map parameters) { + PuntoVenta puntoVenta = (PuntoVenta) parameters.get("puntoVenta"); + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + + String sql = getSql(puntoVenta, dataInicio, dataFinal); + PreparedStatement stmt = null; + ResultSet rset = null; + + try { + stmt = conn.prepareStatement(sql); + stmt.setDate(1, new java.sql.Date(dataInicio.getTime())); + stmt.setDate(2, new java.sql.Date(dataFinal.getTime())); + stmt.setDate(3, new java.sql.Date(dataInicio.getTime())); + stmt.setDate(4, new java.sql.Date(dataFinal.getTime())); + rset = stmt.executeQuery(); + } catch (Exception ex) { + log.error(ex); + } + + return rset; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaClaseServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaClaseServicioHibernateDAO.java new file mode 100644 index 000000000..1c361573a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaClaseServicioHibernateDAO.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MarcaClaseServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicioPK; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("marcaClaseServicioDAO") +public class MarcaClaseServicioHibernateDAO + extends GenericHibernateDAO + implements MarcaClaseServicioDAO { + + @Autowired + public MarcaClaseServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(ClaseServicio clase) { + Query q = getSession().createQuery("select mc.marcaClaseservicioPK.marca from MarcaClaseServicio mc where mc.activo = 1 and mc.marcaClaseservicioPK.claseservicio.claseservicioId = " + clase.getClaseservicioId()); + + return q.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaHibernateDAO.java new file mode 100644 index 000000000..04e315c35 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MarcaHibernateDAO.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MarcaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("marcaDAO") +public class MarcaHibernateDAO extends GenericHibernateDAO + implements MarcaDAO { + + @Autowired + public MarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descmarca")); + + return c.list(); + } + + public List buscarPorNome(String nomeMarca) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descmarca", nomeMarca)); + + return c.list(); + } + + public List buscarTodosExceto(Integer... idMarca) { + Criteria c = this.makeCriteria(); + for (Integer id : idMarca) { + c.add(Restrictions.ne("marcaId", id.shortValue())); + } + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descmarca")); + return c.list(); + + } + + @Override + public List buscarDescricaoIdMarca() { + String hql = " select new com.rjconsultores.ventaboletos.entidad.Marca(m.marcaId, m.descmarca) from Marca m where m.marcaId <> -1 "; + Query sq = getSession().createQuery(hql); + List lsMarca = sq.list(); + return lsMarca; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MercadoCompetidoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MercadoCompetidoHibernateDAO.java new file mode 100644 index 000000000..968e289e8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MercadoCompetidoHibernateDAO.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MercadoCompetidoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("mercadoCompetidoDAO") +public class MercadoCompetidoHibernateDAO + extends GenericHibernateDAO + implements MercadoCompetidoDAO { + + @Autowired + public MercadoCompetidoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public boolean existe(ClaseServicio claseServicio, Parada origem, + Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + + c.setProjection(Projections.rowCount()); + + return (HibernateFix.count(c.list()) > 0) ; + } + + public List buscar(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MerchantBancarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MerchantBancarioHibernateDAO.java new file mode 100644 index 000000000..0612c810e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MerchantBancarioHibernateDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MerchantBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("merchantBancarioDAO") +public class MerchantBancarioHibernateDAO extends GenericHibernateDAO + implements MerchantBancarioDAO { + + @Autowired + public MerchantBancarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MonedaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MonedaHibernateDAO.java new file mode 100644 index 000000000..2371096cc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MonedaHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MonedaDAO; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("monedaDAO") +public class MonedaHibernateDAO extends GenericHibernateDAO + implements MonedaDAO { + + @Autowired + public MonedaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descmoneda")); + + return c.list(); + } + + public List buscar(String descmoneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descmoneda", descmoneda)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoCancelacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoCancelacionHibernateDAO.java new file mode 100644 index 000000000..2b1e7e2fe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoCancelacionHibernateDAO.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("motivoCancelacionDAO") +public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO + implements MotivoCancelacionDAO { + + @Autowired + public MotivoCancelacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descmotivo")); + + return c.list(); + } + + public List buscar(String descmotivo, String tipomotivo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descmotivo", descmotivo)); + c.add(Restrictions.eq("tipomotivo", tipomotivo)); + + return c.list(); + } + + public List obtenerTodosTipoMotivoB() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tipomotivo", "B")); + c.addOrder(Order.asc("descmotivo")); + + return c.list(); + } + + public List obtenerTodosEspecificos(Integer[] motivos) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.in("motivocancelacionId", motivos)); + c.addOrder(Order.asc("descmotivo")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoReimpresionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoReimpresionHibernateDAO.java new file mode 100644 index 000000000..b08c35878 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoReimpresionHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MotivoReimpresionDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("motivoReimpresionDAO") +public class MotivoReimpresionHibernateDAO extends GenericHibernateDAO + implements MotivoReimpresionDAO { + + @Autowired + public MotivoReimpresionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descmotivo")); + + return c.list(); + } + + public List buscar(String descmotivo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descmotivo", descmotivo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoViajeHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoViajeHibernateDAO.java new file mode 100644 index 000000000..21fa984ca --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivoViajeHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MotivoViajeDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; + +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("motivoViajeDAO") +public class MotivoViajeHibernateDAO extends GenericHibernateDAO + implements MotivoViajeDAO { + + @Autowired + public MotivoViajeHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivocancelacionEquivalenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivocancelacionEquivalenciaHibernateDAO.java new file mode 100644 index 000000000..2f0ff8b46 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/MotivocancelacionEquivalenciaHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.MotivocancelacionEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("motivocancelacionEquivalenciaDAO") +public class MotivocancelacionEquivalenciaHibernateDAO extends GenericHibernateDAO + implements MotivocancelacionEquivalenciaDAO { + + @Autowired + public MotivocancelacionEquivalenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(ComisionistaExterno comisionistaExterno, MotivoCancelacion motivoCancelacion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("comisionistaExterno", comisionistaExterno)); + c.add(Restrictions.eq("motivoCancelacion", motivoCancelacion)); + + return c.list(); + } + + public List buscarEquivalencia(MotivocancelacionEquivalencia motivoCancelacionEquivalencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("equivalenciaId", motivoCancelacionEquivalencia.getEquivalenciaId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/NodoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/NodoHibernateDAO.java new file mode 100644 index 000000000..4b356e325 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/NodoHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.NodoDAO; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("nodoDAO") +public class NodoHibernateDAO extends GenericHibernateDAO + implements NodoDAO { + + @Autowired + public NodoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descnodo")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PaisHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PaisHibernateDAO.java new file mode 100644 index 000000000..5ef92d6b0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PaisHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PaisDAO; +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paisDAO") +public class PaisHibernateDAO extends GenericHibernateDAO + implements PaisDAO { + + @Autowired + public PaisHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombpais")); + + return c.list(); + } + + public List buscar(String nombpais) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombpais", nombpais)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaEquivalenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaEquivalenciaHibernateDAO.java new file mode 100644 index 000000000..5c076d04a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaEquivalenciaHibernateDAO.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParadaEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("paradaEquivalenciaDAO") +public class ParadaEquivalenciaHibernateDAO + extends GenericHibernateDAO + implements ParadaEquivalenciaDAO { + + @Autowired + public ParadaEquivalenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Parada parada, + ComisionistaExterno comisionistaExterno, String equivalencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("parada", parada)); + c.add(Restrictions.eq("comisionistaExterno", comisionistaExterno)); + c.add(Restrictions.eq("equivalenciaId", equivalencia)); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarEquivalencia(String equivalencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("equivalenciaId", equivalencia)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaHibernateDAO.java new file mode 100644 index 000000000..74bb07600 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParadaHibernateDAO.java @@ -0,0 +1,99 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParadaDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.MatchMode; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.ProjectionList; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.PropertyProjection; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("paradaDAO") +public class ParadaHibernateDAO extends GenericHibernateDAO implements ParadaDAO { + + @Autowired + public ParadaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.addOrder(Order.asc("descparada")); + + return c.list(); + } + + public List buscar(String descparada, String cveparada, Ciudad ciudad, TipoParada tipoParada, Nodo nodo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descparada", descparada)); + c.add(Restrictions.eq("cveparada", cveparada)); + c.add(Restrictions.eq("ciudad", ciudad)); + c.add(Restrictions.eq("tipoParada", tipoParada)); + c.add(Restrictions.eq("nodo", nodo)); + + return c.list(); + } + + public List buscar(String descparada) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descparada", descparada)); + + return c.list(); + } + + public List buscarCVE(String cveparada) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("cveparada", cveparada)); + + return c.list(); + } + + public List buscaLike(String descparada) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.like("descparada", descparada, MatchMode.START)); + + c.addOrder(Order.asc("descparada")); + + return c.list(); + } + + public Long count(TipoParada tipoParada) { + Criteria c = this.makeCriteria(); + + c.add(Restrictions.eq("tipoParada", tipoParada)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.setProjection(Projections.rowCount()); + + return HibernateFix.count(c.list()); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaMasivoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaMasivoHibernateDAO.java new file mode 100644 index 000000000..39ca5c21e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaMasivoHibernateDAO.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamAcumulaMasivoDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paramAcumulaMasivoDAO") +public class ParamAcumulaMasivoHibernateDAO extends GenericHibernateDAO + implements ParamAcumulaMasivoDAO { + + @Autowired + public ParamAcumulaMasivoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List buscar(Empresa emp, Integer min, Integer max, Date fecIni, Date fecFim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (emp != null) { + c.add(Restrictions.eq("empresa", emp)); + } + if (min != null) { + c.add(Restrictions.ge("minpuntootorga", min)); + } + if (max != null) { + c.add(Restrictions.le("maxpuntootorga", max)); + } + if (fecIni != null) { + c.add(Restrictions.ge("feciniciovigencia", fecIni)); + } + if (fecFim != null) { + c.add(Restrictions.le("fecfinvigencia", fecFim)); + } + + return c.list(); + } + + @Override + public List buscar(ParamAcumulaMasivo paramAcumulaMasivo) { + Criteria c = this.getSession().createCriteria(ParamAcumulaMasivo.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfinvigencia", paramAcumulaMasivo.getFeciniciovigencia())); + c.add(Restrictions.le("feciniciovigencia", paramAcumulaMasivo.getFecfinvigencia())); + c.add(Restrictions.eq("empresa", paramAcumulaMasivo.getEmpresa())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaPuntoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaPuntoHibernateDAO.java new file mode 100644 index 000000000..270949863 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamAcumulaPuntoHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamAcumulaPuntoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paramAcumulaPuntoDAO") +public class ParamAcumulaPuntoHibernateDAO extends GenericHibernateDAO + implements ParamAcumulaPuntoDAO { + + @Autowired + public ParamAcumulaPuntoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Parada origem, Parada destino, Date ini, Date fim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (origem != null) { + c.add(Restrictions.eq("origem", origem)); + } + + if (destino != null) { + c.add(Restrictions.eq("destino", destino)); + } + if (ini != null) { + c.add(Restrictions.ge("feciniciovigencia", ini)); + } + if (fim != null) { + c.add(Restrictions.le("fecfinvigencia", fim)); + } + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamArticuloHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamArticuloHibernateDAO.java new file mode 100644 index 000000000..25e5d2870 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamArticuloHibernateDAO.java @@ -0,0 +1,33 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.ParamArticuloDAO; +import com.rjconsultores.ventaboletos.entidad.ParamArticulo; + +@Repository("paramArticuloDAO") +public class ParamArticuloHibernateDAO extends + GenericHibernateDAO implements ParamArticuloDAO { + + @Autowired + public ParamArticuloHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + //c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCanjePuntoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCanjePuntoHibernateDAO.java new file mode 100644 index 000000000..3347d5dd7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCanjePuntoHibernateDAO.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamCanjePuntoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paramCanjePuntoDAO") +public class ParamCanjePuntoHibernateDAO extends GenericHibernateDAO + implements ParamCanjePuntoDAO { + + @Autowired + public ParamCanjePuntoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Parada origem, Parada destino, Date ini, Date fim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (origem != null) { + c.add(Restrictions.eq("origem", origem)); + } + if (destino != null) { + c.add(Restrictions.eq("destino", destino)); + } + if (ini != null) { + c.add(Restrictions.ge("feciniciovigencia", ini)); + } + if (fim != null) { + c.add(Restrictions.le("fecfinvigencia", fim)); + } + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCompraPuntoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCompraPuntoHibernateDAO.java new file mode 100644 index 000000000..fe4818a95 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCompraPuntoHibernateDAO.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamCompraPuntoDAO; +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paramCompraPuntoDAO") +public class ParamCompraPuntoHibernateDAO extends GenericHibernateDAO + implements ParamCompraPuntoDAO { + + @Autowired + public ParamCompraPuntoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(Date ini, Date fim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (ini != null) { + c.add(Restrictions.ge("feciniciovigencia", ini)); + } + if (fim != null) { + c.add(Restrictions.le("fecfinvigencia", fim)); + } + + return c.list(); + + } + + public List buscar(Date ini, Date fim, Integer cantPuntos, BigDecimal costoPunto) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (ini != null) { + c.add(Restrictions.eq("feciniciovigencia", ini)); + } + if (fim != null) { + c.add(Restrictions.eq("fecfinvigencia", fim)); + } + + if (cantPuntos != null) { + c.add(Restrictions.eq("cantpunto", cantPuntos)); + } + + if (costoPunto != null) { + c.add(Restrictions.eq("valcostopunto", costoPunto)); + } + + return c.list(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCostoTarjetaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCostoTarjetaHibernateDAO.java new file mode 100644 index 000000000..f96339d97 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamCostoTarjetaHibernateDAO.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamCostoTarjetaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("paramCostoTarjetaDAO") +public class ParamCostoTarjetaHibernateDAO extends GenericHibernateDAO + implements ParamCostoTarjetaDAO { + + @Autowired + public ParamCostoTarjetaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(ParamCostoTarjeta paramCostoTarjeta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("empresa", paramCostoTarjeta.getEmpresa())); + c.add(Restrictions.eq("valcostoinicial", paramCostoTarjeta.getValcostoinicial())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamRecoleccionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamRecoleccionHibernateDAO.java new file mode 100644 index 000000000..98e4fd463 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ParamRecoleccionHibernateDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ParamRecoleccionDAO; +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("paramRecoleccionDAO") +public class ParamRecoleccionHibernateDAO extends GenericHibernateDAO + implements ParamRecoleccionDAO { + + @Autowired + public ParamRecoleccionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilFuncionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilFuncionHibernateDAO.java new file mode 100644 index 000000000..abd4e1b1b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilFuncionHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PerfilFuncionDAO; +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("perfilFuncionDAO") +public class PerfilFuncionHibernateDAO extends GenericHibernateDAO + implements PerfilFuncionDAO { + + @Autowired + public PerfilFuncionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilHibernateDAO.java new file mode 100644 index 000000000..7fdc9ff82 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PerfilHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("perfilDAO") +public class PerfilHibernateDAO extends GenericHibernateDAO + implements PerfilDAO { + + @Autowired + public PerfilHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descperfil")); + + return c.list(); + } + + public List buscar(String dscPerfil) { + + return this.findByCriteria(Restrictions.eq("descperfil", dscPerfil.trim()),Restrictions.eq("activo", Boolean.TRUE)); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PeriodoVacacionalHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PeriodoVacacionalHibernateDAO.java new file mode 100644 index 000000000..295a29d34 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PeriodoVacacionalHibernateDAO.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PeriodoVacacionalDAO; +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("periodoVacacionalDAO") +public class PeriodoVacacionalHibernateDAO extends GenericHibernateDAO + implements PeriodoVacacionalDAO { + + @Autowired + public PeriodoVacacionalHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscar(Date dataInicio, Date dataFim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("fecinicio", dataInicio)); + c.add(Restrictions.eq("fecfinal", dataFim)); + + return c.list(); + } + + @Override + public List buscarFechaTraslapa(PeriodoVacacional periodoVacacional) { + + Criteria c = this.getSession().createCriteria(PeriodoVacacional.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfinal", periodoVacacional.getFecinicio())); + c.add(Restrictions.le("fecinicio", periodoVacacional.getFecfinal())); + + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PlazaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PlazaHibernateDAO.java new file mode 100644 index 000000000..6be8cf105 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PlazaHibernateDAO.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PlazaDAO; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("plazaDAO") +public class PlazaHibernateDAO extends GenericHibernateDAO + implements PlazaDAO { + + @Autowired + public PlazaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombplaza")); + + return c.list(); + } + + public List buscar(String nombplaza) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombplaza", nombplaza)); + + return c.list(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAnticipacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAnticipacionHibernateDAO.java new file mode 100644 index 000000000..90a98d5e0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAnticipacionHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingAnticipacionDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("pricingAnticipacionDAO") +public class PricingAnticipacionHibernateDAO extends GenericHibernateDAO + implements PricingAnticipacionDAO { + + @Autowired + public PricingAnticipacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtenerPorPricing(Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java new file mode 100644 index 000000000..b509f4d81 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingAsientoDAO") +public class PricingAsientoHibernateDAO extends GenericHibernateDAO + implements PricingAsientoDAO { + + @Autowired + public PricingAsientoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtenerPricingCategoria(Pricing pricing, Integer asiento) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("numeasiento", asiento.toString())); + + return c.list(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCategoriaHibernateDAO.java new file mode 100644 index 000000000..9cf899af2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCategoriaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingCategoriaDAO") +public class PricingCategoriaHibernateDAO extends GenericHibernateDAO + implements PricingCategoriaDAO { + + @Autowired + public PricingCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("categoria", categoria)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingClaseHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingClaseHibernateDAO.java new file mode 100644 index 000000000..b353d5041 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingClaseHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingClaseDAO") +public class PricingClaseHibernateDAO extends GenericHibernateDAO + implements PricingClaseDAO { + + @Autowired + public PricingClaseHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCorridaHibernateDAO.java new file mode 100644 index 000000000..dea24a327 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCorridaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingCorridaDAO") +public class PricingCorridaHibernateDAO extends GenericHibernateDAO + implements PricingCorridaDAO { + + @Autowired + public PricingCorridaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("corridaCtrl", corrida)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingDiaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingDiaHibernateDAO.java new file mode 100644 index 000000000..507cc48b5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingDiaHibernateDAO.java @@ -0,0 +1,95 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingDiaDAO; +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingDiaDAO") +public class PricingDiaHibernateDAO extends GenericHibernateDAO + implements PricingDiaDAO { + + private static Logger log = Logger.getLogger(PricingDiaHibernateDAO.class); + + @Autowired + public PricingDiaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarTraslapa(PricingDia pricingDia) { + Date horarioinicio = pricingDia.getHorarioinicio(); + Date horariofin = pricingDia.getHorariofin(); + + SimpleDateFormat sf = new SimpleDateFormat("HHmm"); + + StringBuilder hql = new StringBuilder(); + hql.append("select pv from PricingDia pv "); + hql.append(" where pv.activo = 1 "); + hql.append(" and pricing.pricingId = ").append(pricingDia.getPricing().getPricingId()); +// hql.append(" and ( 1=1 or "); +// if (pricingDia.getIndlunes()) { +// hql.append(" pv.indlunes = ").append(pricingDia.getIndlunes()); +// } +// if (pricingDia.getIndmartes()) { +// hql.append(" or pv.indmartes = ").append(pricingDia.getIndmartes()); +// } +// if (pricingDia.getIndmiercoles()) { +// hql.append(" or pv.indmiercoles = ").append(pricingDia.getIndmiercoles()); +// } +// if (pricingDia.getIndjueves()) { +// hql.append(" or pv.indjueves = ").append(pricingDia.getIndjueves()); +// } +// if (pricingDia.getIndviernes()) { +// hql.append(" or pv.indviernes = ").append(pricingDia.getIndviernes()); +// } +// if (pricingDia.getIndsabado()) { +// hql.append(" or pv.indsabado = ").append(pricingDia.getIndsabado()); +// } +// if (pricingDia.getInddomingo()) { +// hql.append(" or pv.inddomingo = ").append(pricingDia.getInddomingo()); +// } +// hql.append(" ) "); +// hql.append(" and ((( to_char('").append(sf.format(horarioinicio)).append("') BETWEEN to_char(pv.horarioinicio, 'HH24MI') AND to_char(pv.horariofin, 'HH24MI') ) "); +// hql.append(" OR (to_char('").append(sf.format(horariofin)).append("') BETWEEN to_char(pv.horarioinicio, 'HH24MI') AND to_char(pv.horariofin, 'HH24MI'))) "); +// hql.append(" OR ((to_char(pv.horarioinicio, 'HH24MI') BETWEEN to_char('").append(sf.format(horarioinicio)).append("') AND to_char('").append(sf.format(horariofin)).append("') ) "); +// hql.append(" OR (to_char(pv.horariofin, 'HH24MI') BETWEEN to_char('").append(sf.format(horarioinicio)).append("') AND to_char('").append(sf.format(horariofin)).append("') ))) "); + + hql.append(" and pv.horariofin >= :horariofin "); + hql.append(" and pv.horarioinicio >= :horarioinicio "); + + log.info("Hora Ini: " + sf.format(horarioinicio)); + log.info("Hora Fin: " + sf.format(horariofin)); + log.info("SQL: " + hql.toString()); + + Query sq = getSession().createQuery(hql.toString()); + sq.setParameter("horariofin", horariofin); + sq.setParameter("horarioinicio", horarioinicio); + + return sq.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingEspecificoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingEspecificoHibernateDAO.java new file mode 100644 index 000000000..d67178826 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingEspecificoHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingEspecificoDAO; +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingEspecificoDAO") +public class PricingEspecificoHibernateDAO extends GenericHibernateDAO + implements PricingEspecificoDAO { + + @Autowired + public PricingEspecificoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorNome(PricingEspecifico pricingEspecifico) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombPricing", pricingEspecifico.getNombPricing())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java new file mode 100644 index 000000000..34458af74 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingDAO") +public class PricingHibernateDAO extends GenericHibernateDAO + implements PricingDAO { + + @Autowired + public PricingHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombPricing", nombPricing)); + c.add(Restrictions.eq("empresa", empresa)); + c.add(Restrictions.eq("cantboleto", cantboleto)); + c.add(Restrictions.eq("cantdiasanticipacion", cantdiasanticipacion)); + if (descuentoporcentaje != null) { + c.add(Restrictions.eq("descuentoporcentaje", descuentoporcentaje)); + } + if (descuentoporcredondo != null) { + c.add(Restrictions.eq("descuentoporcredondo", descuentoporcredondo)); + } + + return c.list(); + } + + public List buscarPorNombre(String nombPricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombPricing", nombPricing)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingImporteHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingImporteHibernateDAO.java new file mode 100644 index 000000000..f41b7ec50 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingImporteHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingImporteDAO; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingImporteDAO") +public class PricingImporteHibernateDAO extends GenericHibernateDAO + implements PricingImporteDAO { + + @Autowired + public PricingImporteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarMoneda(PricingImporte pricingImporte, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricingImporte.getPricing())); + c.add(Restrictions.eq("moneda", moneda)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMarcaHibernateDAO.java new file mode 100644 index 000000000..139a8cdcf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMarcaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingMarcaDAO") +public class PricingMarcaHibernateDAO extends GenericHibernateDAO + implements PricingMarcaDAO { + + @Autowired + public PricingMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingMarca(Pricing pricing, Marca marca) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("marca", marca)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMercadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMercadoHibernateDAO.java new file mode 100644 index 000000000..57c33c0b4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingMercadoHibernateDAO.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingMercadoDAO") +public class PricingMercadoHibernateDAO extends GenericHibernateDAO + implements PricingMercadoDAO { + + @Autowired + public PricingMercadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("origen", origen)); + c.add(Restrictions.eq("destino", destino)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingOcupacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingOcupacionHibernateDAO.java new file mode 100644 index 000000000..3033d7b01 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingOcupacionHibernateDAO.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingOcupacionDAO") +public class PricingOcupacionHibernateDAO extends GenericHibernateDAO + implements PricingOcupacionDAO { + + @Autowired + public PricingOcupacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean podeSalvar(Pricing pricing, BigDecimal min, BigDecimal max) { + Boolean retorno = Boolean.TRUE; + + StringBuilder hql = new StringBuilder("SELECT pv FROM PricingOcupacion pv "); + hql.append(" WHERE pv.activo = 1 "); + hql.append(" AND pv.pricing.pricingId = ").append(pricing.getPricingId()); + hql.append(" AND ( "); + hql.append(" ( ").append(min).append(" BETWEEN ocupacioninicial AND ocupacionfinal ) "); + hql.append(" OR ( ").append(max).append(" BETWEEN ocupacioninicial AND ocupacionfinal) "); + hql.append(" OR ((ocupacioninicial BETWEEN ").append(min).append(" AND ").append(max).append(" ) OR (ocupacionfinal BETWEEN ").append(min).append(" AND ").append(max).append(" )))"); + + Query sq = getSession().createQuery(hql.toString()); + + List ls = sq.list(); + if (!ls.isEmpty()) { + retorno = Boolean.FALSE; + } + + return retorno; + } + + public List podeSalvar(Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingPuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingPuntoVentaHibernateDAO.java new file mode 100644 index 000000000..9b084c4bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingPuntoVentaHibernateDAO.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingPuntoVentaDAO") +public class PricingPuntoVentaHibernateDAO extends GenericHibernateDAO + implements PricingPuntoVentaDAO { + + @Autowired + public PricingPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("puntoVenta", puntoVenta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingRutaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingRutaHibernateDAO.java new file mode 100644 index 000000000..2a4e856cf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingRutaHibernateDAO.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingRutaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingRutaDAO") +public class PricingRutaHibernateDAO extends GenericHibernateDAO + implements PricingRutaDAO { + + @Autowired + public PricingRutaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("ruta", ruta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoPtoVtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoPtoVtaHibernateDAO.java new file mode 100644 index 000000000..e785e3d89 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoPtoVtaHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingTipoPtoVtaDAO") +public class PricingTipoPtoVtaHibernateDAO extends GenericHibernateDAO + implements PricingTipoPtoVtaDAO { + + @Autowired + public PricingTipoPtoVtaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("tipoPtovta", tipoPuntoVenta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoServicioHibernateDAO.java new file mode 100644 index 000000000..7ef68db55 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingTipoServicioHibernateDAO.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingTipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("pricingTipoServicioDAO") +public class PricingTipoServicioHibernateDAO extends GenericHibernateDAO + implements PricingTipoServicioDAO { + + @Autowired + public PricingTipoServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("tipoServicio", tipoServicio)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingVigenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingVigenciaHibernateDAO.java new file mode 100644 index 000000000..f57b9ee89 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingVigenciaHibernateDAO.java @@ -0,0 +1,88 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PricingVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("pricingVigenciaDAO") +public class PricingVigenciaHibernateDAO extends GenericHibernateDAO + implements PricingVigenciaDAO { + + @Autowired + public PricingVigenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscarPorVigencias(PricingVigencia pv) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("pricing", pv.getPricing())); + + Date fecinicioventa = pv.getFecinicioventa(); + Date fecfinventa = pv.getFecfinventa(); + + c.add(Restrictions.or(Restrictions.between("fecinicioventa", fecinicioventa, fecfinventa), + (Restrictions.between("fecfinventa", fecinicioventa, fecfinventa)))); + + return c.list(); + } + + @Override + public Boolean podeSalvar(Pricing pricing, PricingVigencia pricingVigencia, + Date inicio, Date fim) { + Calendar fecInicio = Calendar.getInstance(); + fecInicio.setTime(inicio); + fecInicio.set(Calendar.MILLISECOND, 0); + fecInicio.set(Calendar.SECOND, 0); + + Calendar fecFin = Calendar.getInstance(); + fecFin.setTime(fim); + fecFin.set(Calendar.MILLISECOND, 0); + fecFin.set(Calendar.SECOND, 0); + + + + Criteria c = this.getSession().createCriteria(PricingVigencia.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfinventa", fecInicio.getTime())); + c.add(Restrictions.le("fecinicioventa", fecFin.getTime())); + c.add(Restrictions.eq("pricing", pricing)); + if (pricingVigencia.getPricingvigenciaId() != null){ + c.add(Restrictions.ne("pricingvigenciaId",pricingVigencia.getPricingvigenciaId())); + } + + return c.list().isEmpty(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdClaseServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdClaseServicioHibernateDAO.java new file mode 100644 index 000000000..6f7c023e4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdClaseServicioHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdClaseServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodClaseServicioDAO") +public class ProdClaseServicioHibernateDAO extends GenericHibernateDAO + implements ProdClaseServicioDAO { + + @Autowired + public ProdClaseServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdFormaPagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdFormaPagoHibernateDAO.java new file mode 100644 index 000000000..df9354378 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdFormaPagoHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdFormaPagoDAO; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodFormaPagoDAO") +public class ProdFormaPagoHibernateDAO extends GenericHibernateDAO + implements ProdFormaPagoDAO { + + @Autowired + public ProdFormaPagoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMarcaHibernateDAO.java new file mode 100644 index 000000000..df0d6101e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMarcaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodMarcaDAO") +public class ProdMarcaHibernateDAO extends GenericHibernateDAO + implements ProdMarcaDAO { + + @Autowired + public ProdMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMercadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMercadoHibernateDAO.java new file mode 100644 index 000000000..4a243c125 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdMercadoHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodMercadoDAO") +public class ProdMercadoHibernateDAO extends GenericHibernateDAO + implements ProdMercadoDAO { + + @Autowired + public ProdMercadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPrecioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPrecioHibernateDAO.java new file mode 100644 index 000000000..0164e1cf9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPrecioHibernateDAO.java @@ -0,0 +1,64 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdPrecioDAO; +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("prodPrecioDAO") +public class ProdPrecioHibernateDAO extends GenericHibernateDAO + implements ProdPrecioDAO { + + @Autowired + public ProdPrecioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(Marca marca, ProductoServicio productoservicio) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("productoservicio", productoservicio)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + return c.list(); + } + + public List buscar(Marca marca) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPuntoVentaHibernateDAO.java new file mode 100644 index 000000000..b705c2a6b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdPuntoVentaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodPuntoVentaDAO") +public class ProdPuntoVentaHibernateDAO extends GenericHibernateDAO + implements ProdPuntoVentaDAO { + + @Autowired + public ProdPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdRutaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdRutaHibernateDAO.java new file mode 100644 index 000000000..5f63a56c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdRutaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdRutaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodRutaDAO") +public class ProdRutaHibernateDAO extends GenericHibernateDAO + implements ProdRutaDAO { + + @Autowired + public ProdRutaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdTipoptovtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdTipoptovtaHibernateDAO.java new file mode 100644 index 000000000..054dcc695 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdTipoptovtaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdTipoptovtaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodTipoptovtaDAO") +public class ProdTipoptovtaHibernateDAO extends GenericHibernateDAO + implements ProdTipoptovtaDAO { + + @Autowired + public ProdTipoptovtaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdVigenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdVigenciaHibernateDAO.java new file mode 100644 index 000000000..11bb04c15 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProdVigenciaHibernateDAO.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProdVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("prodVigenciaDAO") +public class ProdVigenciaHibernateDAO extends GenericHibernateDAO + implements ProdVigenciaDAO { + + @Autowired + public ProdVigenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscarTraslapa(ProdVigencia prodVigencia) { + Criteria c = this.getSession().createCriteria(ProdVigencia.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecvigenciafin", prodVigencia.getFecvigenciainicio())); + c.add(Restrictions.le("fecvigenciainicio", prodVigencia.getFecvigenciafin())); + c.add(Restrictions.eq("productoServicio", prodVigencia.getProductoServicio())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ProductoServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProductoServicioHibernateDAO.java new file mode 100644 index 000000000..11e440cad --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ProductoServicioHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ProductoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("productoServicioDAO") +public class ProductoServicioHibernateDAO extends GenericHibernateDAO + implements ProductoServicioDAO { + + @Autowired + public ProductoServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtener(ProductoServicio ps) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descproductoservicio", ps.getDescproductoservicio())); + c.add(Restrictions.eq("empresa", ps.getEmpresa())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PtoVtaUsuarioBancarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PtoVtaUsuarioBancarioHibernateDAO.java new file mode 100644 index 000000000..858509fbb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PtoVtaUsuarioBancarioHibernateDAO.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PtoVtaUsuarioBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("ptoVtaUsuarioBancarioDAO") +public class PtoVtaUsuarioBancarioHibernateDAO extends GenericHibernateDAO + implements PtoVtaUsuarioBancarioDAO { + + @Autowired + public PtoVtaUsuarioBancarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public void borrarFisico(PtoVtaUsuarioBancario pto2) { + String hql = " delete from PtoVtaUsuarioBancario " + + " where ptovtaUsuarioBancarioID = " + pto2.getPtovtaUsuarioBancarioID(); + Query sq = getSession().createQuery(hql); + sq.executeUpdate(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PtovtaEmpresaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PtovtaEmpresaHibernateDAO.java new file mode 100644 index 000000000..825b89b14 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PtovtaEmpresaHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PtovtaEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("ptovtaEmpresaDAO") +public class PtovtaEmpresaHibernateDAO extends GenericHibernateDAO + implements PtovtaEmpresaDAO { + + @Autowired + public PtovtaEmpresaHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(PtovtaEmpresa ptovtaEmpresa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("empresa", ptovtaEmpresa.getEmpresa())); + c.add(Restrictions.eq("puntoVenta", ptovtaEmpresa.getPuntoVenta())); + + return c.list(); + } + + public void borrarFisico(PtovtaEmpresa pto) { + String hql = " delete from PtovtaEmpresa " + + " where ptovtaempresaId = " + pto.getPtovtaempresaId(); + Query sq = getSession().createQuery(hql); + sq.executeUpdate(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PuntoVentaHibernateDAO.java new file mode 100644 index 000000000..9b21a0eea --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PuntoVentaHibernateDAO.java @@ -0,0 +1,59 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; +import org.hibernate.criterion.Order; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.MatchMode; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("puntoVentaDAO") +public class PuntoVentaHibernateDAO extends GenericHibernateDAO + implements PuntoVentaDAO { + + @Autowired + public PuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.addOrder(Order.asc("nombpuntoventa")); + + return c.list(); + } + + public List buscaLike(String strEstacion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.like("nombpuntoventa", strEstacion, MatchMode.START)); + + return c.list(); + } + + public List busca(PuntoVenta puntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombpuntoventa", puntoVenta.getNombpuntoventa())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoCtrlHibernateDAO.java new file mode 100644 index 000000000..1b474de64 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoCtrlHibernateDAO.java @@ -0,0 +1,106 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RedondeoCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("redondeoCtrlDAO") +public class RedondeoCtrlHibernateDAO extends GenericHibernateDAO + implements RedondeoCtrlDAO { + + private static Logger log = Logger.getLogger(RedondeoCtrlHibernateDAO.class); + + @Autowired + public RedondeoCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(RedondeoCtrl redondeoCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + List lsShort = new ArrayList(); + for (RedondeoMarca rm : redondeoCtrl.getRedondeoMarcaList()) { + lsShort.add(rm.getMarca().getMarcaId()); + } + c.createCriteria("redondeoMarcaList").add(Restrictions.in("marca.marcaId", lsShort)); + + return c.list(); + + } + + public List buscarTraslapa(Short[] iDMarcas, BigDecimal valorinicial, BigDecimal valorfinal, Boolean indaplicadescuento, Boolean indaplicapricing) { + + String ids = ""; + for (int i = 0; i < iDMarcas.length; i++) { + ids = ids.concat(iDMarcas[i].toString().concat(",")); + } + ids = ids.substring(0, ids.length() - 1); + + + StringBuilder hql = new StringBuilder("select rc from RedondeoCtrl rc "); + hql.append(" join rc.redondeoList r "); + hql.append(" join rc.redondeoMarcaList rm "); + hql.append(" where rc.activo = 1 and r.activo = 1 and rm.activo = 1 "); + if (indaplicadescuento && !indaplicapricing) { + hql.append(" and rc.indaplicadescuento = :aplicaDescuento "); + } else if (!indaplicadescuento && indaplicapricing) { + hql.append(" and rc.indaplicapricing = :aplicaPricing "); + } else if (indaplicadescuento && indaplicapricing) { + hql.append(" and rc.indaplicadescuento = :aplicaDescuento or rc.indaplicapricing = :aplicaPricing "); + } else if (!indaplicadescuento && !indaplicapricing) { + hql.append(" and rc.indaplicadescuento = :aplicaDescuento and rc.indaplicapricing = :aplicaPricing "); + } + hql.append(" and rm.marca.marcaId in (" + ids + ") and "); + hql.append(" (((:vlrIni BETWEEN r.valorinicial AND r.valorfinal) "); + hql.append(" OR (:vlrFin BETWEEN r.valorinicial AND r.valorfinal)) "); + hql.append(" OR ((r.valorinicial BETWEEN :vlrIni AND :vlrFin) "); + hql.append(" OR (r.valorfinal BETWEEN :vlrIni AND :vlrFin))) "); + + log.debug("Select: " + hql.toString()); + Query sq = getSession().createQuery(hql.toString()); + sq.setDouble("vlrIni", valorinicial.doubleValue()); + sq.setDouble("vlrFin", valorfinal.doubleValue()); + + if (indaplicadescuento && !indaplicapricing) { + sq.setBoolean("aplicaDescuento", indaplicadescuento); + } else if (!indaplicadescuento && indaplicapricing) { + sq.setBoolean("aplicaPricing", indaplicapricing); + } else { + sq.setBoolean("aplicaDescuento", indaplicadescuento); + sq.setBoolean("aplicaPricing", indaplicapricing); + } + + + return sq.list(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoHibernateDAO.java new file mode 100644 index 000000000..5da3d67f2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoHibernateDAO.java @@ -0,0 +1,60 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RedondeoDAO; +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("redondeoDAO") +public class RedondeoHibernateDAO extends GenericHibernateDAO + implements RedondeoDAO { + + @Autowired + public RedondeoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal, + BigDecimal valorRedondeo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("valorinicial", valorInicial)); + c.add(Restrictions.eq("valorfinal", valorFinal)); + c.add(Restrictions.eq("valorredondeo", valorRedondeo)); + + return c.list(); + } + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.ge("valorinicial", valorInicial)); + c.add(Restrictions.le("valorfinal", valorFinal)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoMarcaHibernateDAO.java new file mode 100644 index 000000000..c701ab081 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RedondeoMarcaHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RedondeoMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("redondeoMarcaDAO") +public class RedondeoMarcaHibernateDAO extends GenericHibernateDAO + implements RedondeoMarcaDAO { + + @Autowired + public RedondeoMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(Marca marca) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("marca", marca)); + + return c.list(); + } + + public List obtenerTodasMarcas(Short[] iDMarcas) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.in("marca.marcaId", iDMarcas)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCategoriaHibernateDAO.java new file mode 100644 index 000000000..74ad8a01f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCategoriaHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("reservacionCategoriaDAO") +public class ReservacionCategoriaHibernateDAO + extends GenericHibernateDAO + implements ReservacionCategoriaDAO { + + @Autowired + public ReservacionCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionClaseHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionClaseHibernateDAO.java new file mode 100644 index 000000000..9ab42bb61 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionClaseHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("reservacionClaseDAO") +public class ReservacionClaseHibernateDAO + extends GenericHibernateDAO + implements ReservacionClaseDAO { + + @Autowired + public ReservacionClaseHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCtrlHibernateDAO.java new file mode 100644 index 000000000..9eeb32dc0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionCtrlHibernateDAO.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Query; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("reservacionCtrlDAO") +public class ReservacionCtrlHibernateDAO + extends GenericHibernateDAO + implements ReservacionCtrlDAO { + + @Autowired + public ReservacionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscar(ReservacionCtrl reservacionCtrl) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descConfig", reservacionCtrl.getDescConfig())); + + return c.list(); + } + + @Override + public List buscarFechaTraslapa(ReservacionCtrl reservacionCtrlt) { + + Calendar fecinicio = Calendar.getInstance(); + fecinicio.setTime(reservacionCtrlt.getFecinicio()); + + Calendar fecfinal = Calendar.getInstance(); + fecfinal.setTime(reservacionCtrlt.getFecfinal()); + + + Criteria c = this.getSession().createCriteria(ReservacionCtrl.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfinal", fecinicio.getTime())); + c.add(Restrictions.le("fecinicio", fecfinal.getTime())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMarcaHibernateDAO.java new file mode 100644 index 000000000..426c0a889 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMarcaHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("reservacionMarcaDAO") +public class ReservacionMarcaHibernateDAO extends GenericHibernateDAO + implements ReservacionMarcaDAO { + + @Autowired + public ReservacionMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMercadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMercadoHibernateDAO.java new file mode 100644 index 000000000..0b552198b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionMercadoHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("reservacionMercadoDAO") +public class ReservacionMercadoHibernateDAO + extends GenericHibernateDAO + implements ReservacionMercadoDAO { + + @Autowired + public ReservacionMercadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionPuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionPuntoVentaHibernateDAO.java new file mode 100644 index 000000000..dc86be1bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReservacionPuntoVentaHibernateDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ReservacionPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("reservacionPuntoVentaDAO") +public class ReservacionPuntoVentaHibernateDAO extends GenericHibernateDAO + implements ReservacionPuntoVentaDAO { + + @Autowired + public ReservacionPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RestriccionPagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RestriccionPagoHibernateDAO.java new file mode 100644 index 000000000..2ab1394a7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RestriccionPagoHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RestriccionPagoDAO; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("restriccionDAO") +public class RestriccionPagoHibernateDAO extends GenericHibernateDAO + implements RestriccionPagoDAO { + + @Autowired + public RestriccionPagoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descrestriccion")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RhPagoConductorHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RhPagoConductorHibernateDAO.java new file mode 100644 index 000000000..22d7f148b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RhPagoConductorHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RhPagoConductorDAO; +import com.rjconsultores.ventaboletos.entidad.RhPagoConductor; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Desenvolvimento + */ +@Repository("rhPagoConductorDAO") +public class RhPagoConductorHibernateDAO extends GenericHibernateDAO + implements RhPagoConductorDAO { + + @Autowired + public RhPagoConductorHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descrestriccion")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RolOperativoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RolOperativoHibernateDAO.java new file mode 100644 index 000000000..92364bf28 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RolOperativoHibernateDAO.java @@ -0,0 +1,59 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RolOperativoDAO; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("rolOperativoDAO") +public class RolOperativoHibernateDAO extends GenericHibernateDAO + implements RolOperativoDAO { + + @Autowired + public RolOperativoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(DiagramaAutobus diagrama, String rol) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (diagrama != null) { + c.add(Restrictions.eq("diagramaAutobus", diagrama)); + } + if (rol != null) { + c.add(Restrictions.eq("descroloperativo", rol)); + } + return c.list(); + } + + public List buscar(String descroloperativo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descroloperativo", descroloperativo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaCombinacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaCombinacionHibernateDAO.java new file mode 100644 index 000000000..97c0affab --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaCombinacionHibernateDAO.java @@ -0,0 +1,245 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SQLQuery; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.RutaCombinacionDAO; +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Rafius + */ +@Repository("rutaCombinacionDAO") +public class RutaCombinacionHibernateDAO extends GenericHibernateDAO + implements RutaCombinacionDAO { + + private static Logger log = LoggerFactory.getLogger(RutaCombinacionHibernateDAO.class); + + @Autowired + private TramoDAO tramoDAO; + + @Autowired + public RutaCombinacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public boolean busquedaRutaTramo(Ruta ruta, Tramo tramo, Boolean ativo) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + + if (ativo) { + c.add(Restrictions.eq("activo", Boolean.TRUE)); + } else { + c.add(Restrictions.eq("activo", Boolean.FALSE)); + } + + c.setProjection(Projections.rowCount()); + + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("tramo", tramo)); + + return HibernateFix.count(c.list()) > 0; + } + + public RutaCombinacion busquedaTramoRutaTramo(Ruta ruta, Tramo trBuscaOrigemDestino) { + + String hql = " select rc from RutaCombinacion rc, Tramo t " + + " where rc.tramo.tramoId = t.tramoId and rc.activo = 0 " + + " and rc.ruta.rutaId = " + ruta.getRutaId() + + " and t.origem.paradaId = " + trBuscaOrigemDestino.getOrigem().getParadaId() + + " and t.destino.paradaId = " + trBuscaOrigemDestino.getDestino().getParadaId(); + Query sq = getSession().createQuery(hql); + + RutaCombinacion rc = new RutaCombinacion(); + if (sq.list().size() > 0) { + rc = (RutaCombinacion) sq.list().get(sq.list().size() - 1); + } + + return rc; + } + + public Tramo busqueda(Ruta ruta, Parada origen, Parada destino) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria c2 = c.createCriteria("tramo"); + c2.add(Restrictions.eq("origem", origen)); + c2.add(Restrictions.eq("destino", destino)); + c2.add(Restrictions.eq("activo", Boolean.TRUE)); + + List list = c.list(); + + if (list.size() != 1) { + return null; + } + return list.get(0).getTramo(); + } + + public RutaCombinacion busquedaTramoRutaOrigemDestino(Ruta ruta, Parada origem, Parada destino) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("ruta", ruta)); + + Criteria c2 = c.createCriteria("tramo"); + c2.add(Restrictions.eq("origem", origem)); + c2.add(Restrictions.eq("destino", destino)); + c2.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (c.list().size() > 0) { + return (RutaCombinacion) c.list().get(0); + } + + return null; + + } + + public List obtenerPorRuta(Ruta ruta) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("ruta", ruta)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public boolean buscarRutaCombinacionExisteTramo(Tramo tramo) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (c.list().isEmpty()) { + return false; + } else { + return true; + } + + + } + @Override + public List tramosFaltantes(Integer rutaId){ + Session session = getSession(); + List lsTramoFaltantes = new ArrayList(); + + StringBuilder sb = new StringBuilder(""); + sb.append(" select t.origen_id, "); + sb.append(" rs.numsecuencia "); + sb.append(" from ruta_secuencia rs "); + sb.append(" inner join tramo t on t.tramo_id = rs.tramo_id "); + sb.append(" where rs.activo = 1 and "); + sb.append(" t.activo = 1 and "); + sb.append(" rs.ruta_id = :rutaId "); + sb.append(" union "); + sb.append(" select t.destino_id, "); + sb.append(" rs.numsecuencia "); + sb.append(" from ruta_secuencia rs "); + sb.append(" inner join tramo t on t.tramo_id = rs.tramo_id "); + sb.append(" where rs.activo = 1 and "); + sb.append(" t.activo = 1 and "); + sb.append(" rs.ruta_id = :rutaId and "); + sb.append(" rs.numsecuencia = "); + sb.append(" (select max(rs.numsecuencia) from "); + sb.append(" ruta_secuencia rs inner join tramo t on "); + sb.append(" t.tramo_id = rs.tramo_id where rs.activo = "); + sb.append(" 1 and t.activo = 1 and rs.ruta_id = :rutaId ) "); + sb.append(" order by 2 "); + + + SQLQuery sqlQuery = session.createSQLQuery(sb.toString()); + sqlQuery.setInteger("rutaId", rutaId); + + List lsParadas = sqlQuery.list(); + Integer origenId = null; + Integer destinoId = null; + for(int i = 0 ; i < lsParadas.size();i++){ + origenId = ((BigDecimal)lsParadas.get(i)[0]).intValue(); + for(int j = i+1 ; j < lsParadas.size();j++){ + destinoId = ((BigDecimal)lsParadas.get(j)[0]).intValue(); + + log.debug(origenId + " - " + destinoId); + + sb = new StringBuilder(); + sb.append(" select count(*) "); + sb.append(" from ruta_combinacion rc "); + sb.append(" inner join tramo t on t.tramo_id = rc.tramo_id "); + sb.append(" where "); + sb.append(" rc.ruta_id = :rutaId "); + sb.append(" and rc.activo = 1 "); + sb.append(" and t.activo = 1 "); + sb.append(" and t.origen_id = :origenId "); + sb.append(" and t.destino_id = :destinoId "); + + + SQLQuery sqlQueryExists = session.createSQLQuery(sb.toString()); + sqlQueryExists.setInteger("rutaId", rutaId); + sqlQueryExists.setInteger("origenId", origenId); + sqlQueryExists.setInteger("destinoId", destinoId); + + Long count = HibernateFix.count(sqlQueryExists.list()); + + if (count == 0){ + log.info("No existe combinacion " + origenId + " - " + destinoId); + + + Parada paradaOrigem = new Parada(); + paradaOrigem.setParadaId(origenId); + + Parada paradaDestino = new Parada(); + paradaDestino.setParadaId(destinoId); + + List list = tramoDAO.obtenerListPorOrigemDestino(paradaOrigem, paradaDestino); + + if (list.size() == 0){ + log.info("No existe tramo " + origenId + " - " + destinoId); + }else{ + lsTramoFaltantes.add(list.get(0)); + } + + } + } + + } + + return lsTramoFaltantes; + } + + public int borrarCombinaciones(Ruta ruta){ + Query query = this.getSession().createQuery("UPDATE RutaCombinacion set activo = false, fecmodif = current_timestamp(), usuarioId= :usuario where ruta = :ruta"); + query.setParameter("ruta", ruta); + query.setParameter("usuario", UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + return query.executeUpdate(); + } + + public void activar(Ruta ruta, Tramo trBuscaOrigemDestino){ + String sql = " select rc.rutacombinacionId from RutaCombinacion rc, Tramo t " + + " where rc.tramo.tramoId = t.tramoId and rc.activo = 0 " + + " and rc.ruta.rutaId = " + ruta.getRutaId() + + " and t.origem.paradaId = " + trBuscaOrigemDestino.getOrigem().getParadaId() + + " and t.destino.paradaId = " + trBuscaOrigemDestino.getDestino().getParadaId(); + + getSession().createQuery("update RutaCombinacion set activo = true where rutacombinacionId in ("+ sql+" )").executeUpdate(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaEmpresaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaEmpresaHibernateDAO.java new file mode 100644 index 000000000..5a01b2860 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaEmpresaHibernateDAO.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("rutaEmpresaDAO") +public class RutaEmpresaHibernateDAO extends GenericHibernateDAO + implements RutaEmpresaDAO { + + @Autowired + public RutaEmpresaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaHibernateDAO.java new file mode 100644 index 000000000..3d261aff2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaHibernateDAO.java @@ -0,0 +1,146 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.RutaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; + +/** + * + * @author Rafius + */ +@Repository("rutaDAO") +public class RutaHibernateDAO extends GenericHibernateDAO + implements RutaDAO { + + @Autowired + public RutaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descruta")); + + return c.list(); + } + + public List buscarPorTramo(Tramo tramo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cTipoPuntoVenta = c.createCriteria("rutaCombinacionList"); + cTipoPuntoVenta.add(Restrictions.eq("tramo", tramo)); + + return c.list(); + } + + public List buscarPorRutaPorEmpresa(Ruta ruta, Empresa empresa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("rutaId", ruta.getRutaId())); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Criteria cEmpresa = null; + if (empresa != null) { + cEmpresa = c.createCriteria("lsRutaEmpresa"); + cEmpresa.add(Restrictions.eq("empresa", empresa)); + cEmpresa.add(Restrictions.eq("activo", Boolean.TRUE)); + } + c.addOrder(Order.asc("descruta")); + + return c.list(); + } + + public List buscarPorClaseServicio(ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("claseServicio", claseServicio)); + + c.addOrder(Order.asc("descruta")); + + return c.list(); + } + + public List buscar(String nomeRuta, ClaseServicio claseServicio, + Boolean nomeObrigatorio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descruta", nomeRuta)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("indNombreObligatorio", nomeObrigatorio)); + + return c.list(); + } + + public List obtenerPorEmpresa(Empresa empresa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (empresa.getEmpresaId() != -1) { + c.createCriteria("lsRutaEmpresa").add(Restrictions.eq("empresa", empresa)); + } + c.addOrder(Order.asc("descruta")); + + return c.list(); + } + + @Override + public Parada buscarOrigen(Ruta ruta) { + Criteria c = this.getSession().createCriteria(RutaSecuencia.class); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.eq("ruta", ruta)); + c.addOrder(Order.asc("numsecuencia")); + c.createAlias("tramo", "tramo") + .setProjection(Projections.property("tramo.origem")); + c.setMaxResults(1); + + return (Parada) c.uniqueResult(); + + } + + @Override + public Parada buscarDestino(Ruta ruta) { + Criteria c = this.getSession().createCriteria(RutaSecuencia.class); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.eq("ruta", ruta)); + c.addOrder(Order.desc("numsecuencia")); + c.createAlias("tramo", "tramo") + .setProjection(Projections.property("tramo.destino")); + c.setMaxResults(1); + + return (Parada) c.uniqueResult(); + } + + public List buscarTodosExceto(Integer... idRuta) { + Criteria c = this.makeCriteria(); + for (Integer id : idRuta) { + c.add(Restrictions.ne("rutaId", id)); + } + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descruta")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaSecuenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaSecuenciaHibernateDAO.java new file mode 100644 index 000000000..ed00a50aa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RutaSecuenciaHibernateDAO.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RutaSecuenciaDAO; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; +import org.hibernate.criterion.Order; + +/** + * + * @author Rafius + */ +@Repository("rutaSecuenciaDAO") +public class RutaSecuenciaHibernateDAO extends GenericHibernateDAO + implements RutaSecuenciaDAO { + + @Autowired + public RutaSecuenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscarSecuenciaOrdenado(Ruta ruta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("ruta", ruta)); + + c.addOrder(Order.asc("numsecuencia")); + + + return c.list(); + } + public int borrarSecuencias(Ruta ruta) { + Query query = this.getSession().createQuery("UPDATE RutaSecuencia SET activo = false, fecmodif = current_timestamp(), usuarioId= :usuario where ruta = :ruta"); + query.setParameter("usuario", UsuarioLogado.getUsuarioLogado().getUsuarioId()); + query.setParameter("ruta", ruta); + + return query.executeUpdate(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/SecretariaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/SecretariaHibernateDAO.java new file mode 100644 index 000000000..561d80dd2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/SecretariaHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.SecretariaDAO; +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("secretariaDAO") +public class SecretariaHibernateDAO extends GenericHibernateDAO + implements SecretariaDAO { + + @Autowired + public SecretariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descsecretaria, String cvesecretaria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descsecretaria", descsecretaria)); + c.add(Restrictions.eq("cvesecretaria", cvesecretaria)); + + return c.list(); + } + + public List buscar(String descsecretaria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descsecretaria", descsecretaria)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/SistemaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/SistemaHibernateDAO.java new file mode 100644 index 000000000..c454f506e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/SistemaHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.SistemaDAO; +import com.rjconsultores.ventaboletos.entidad.Sistema; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("sistemaDAO") +public class SistemaHibernateDAO extends GenericHibernateDAO + implements SistemaDAO { + + @Autowired + public SistemaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombsistema")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaCategoriaHibernateDAO.java new file mode 100644 index 000000000..4e737d0e8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaCategoriaHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarifaCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("tarifaCategoriaDAO") +public class TarifaCategoriaHibernateDAO + extends GenericHibernateDAO + implements TarifaCategoriaDAO { + + @Autowired + public TarifaCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorCategoria(Categoria categoria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("categoria", categoria)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java new file mode 100644 index 000000000..8992e01be --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java @@ -0,0 +1,366 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.RutaDAO; +import com.rjconsultores.ventaboletos.dao.TarifaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.util.ArrayList; +import java.util.List; +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("tarifaDAO") +public class TarifaHibernateDAO extends GenericHibernateDAO + implements TarifaDAO { + + @Autowired + private RutaDAO rutaDAO; + private static Logger log = Logger.getLogger(TarifaHibernateDAO.class); + + @Autowired + public TarifaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + + if (marca != null) { + c.add(Restrictions.eq("marca", marca)); + } + + if (tramo != null) { + c.add(Restrictions.eq("tramo", tramo)); + } + + if (moneda != null) { + c.add(Restrictions.eq("moneda", moneda)); + } + + if (claseServicio != null) { + c.add(Restrictions.eq("claseServicio", claseServicio)); + } + + if (vigenciaTarifa != null) { + c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa)); + } + + return c.list(); + } + + public boolean existe(Marca marca, Tramo tramo, Moneda moneda, ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("moneda", moneda)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa)); + c.setProjection(Projections.rowCount()); + + return (HibernateFix.count(c.list()) > 0); + } + + public List pesquisar(Marca marca, Parada origem, Parada destino, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, + Categoria categoria, TipoPuntoVenta tipoPuntoVenta) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); + + Criteria cCategoria = null; + if (categoria != null) { + cCategoria = c.createCriteria("lsTarifaCategoria"); + cCategoria.add(Restrictions.eq("categoria", categoria)); + cCategoria.add(Restrictions.eq("activo", Boolean.TRUE)); + } + + Criteria cTipoPuntoVenta = null; + if (tipoPuntoVenta != null) { + cTipoPuntoVenta = c.createCriteria("lsTarifaTipoptovta"); + cTipoPuntoVenta.add(Restrictions.eq("tipoPuntoVenta", tipoPuntoVenta)); + cTipoPuntoVenta.add(Restrictions.eq("activo", Boolean.TRUE)); + } + + if (marca != null) { + c.add(Restrictions.eq("marca", marca)); + } + + Criteria cTramo = c.createCriteria("tramo"); + if (origem != null) { + cTramo.add(Restrictions.eq("origem", origem)); + } + + if (destino != null) { + cTramo.add(Restrictions.eq("destino", destino)); + } + + if (moneda != null) { + c.add(Restrictions.eq("moneda", moneda)); + } + + if (claseServicio != null) { + c.add(Restrictions.eq("claseServicio", claseServicio)); + } + + if (vigenciaTarifa != null) { + c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa)); + } + + return c.list(); + } + + public Tarifa buscar(Tramo tramo, Marca marca, ClaseServicio claseServicio, + VigenciaTarifa vigenciaTarifa, Moneda moneda) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("marca", marca)); + + Criteria cTramo = c.createCriteria("tramo"); + cTramo.add(Restrictions.eq("activo", true)); + + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa)); + c.add(Restrictions.eq("moneda", moneda)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return (Tarifa) c.uniqueResult(); + } + + public List buscarPorVigencia(VigenciaTarifa vigencia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + if (vigencia != null) { + c.add(Restrictions.eq("vigenciaTarifa", vigencia)); + } + + return c.list(); + } + + public List pesquisar(List lsMoneda, List lsMarca, + List lsClaseServicio, List lsCategoria, + List lsEmpresa, List lsRuta, + List lsTipoPuntoVenta, List lsVigenciaTarifa) { + // Criteria c = getSession().createCriteria(getPersistentClass()); + // c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); + // + // c.add(Restrictions.eq("activo", Boolean.TRUE)); + // + // if (!lsVigenciaTarifa.isEmpty()) { + // List lsAux = null; + // if (lsVigenciaTarifa.size() > 1000) { + // lsAux = new ArrayList(); + // for (VigenciaTarifa v : lsVigenciaTarifa) { + // lsAux.add(v); + // if (lsAux.size() == 1000) { + // c.add(Restrictions.in("vigenciaTarifa", lsAux)); + // lsAux = new ArrayList(); + // } + // } + // if (lsAux != null && lsAux.size() > 0) { + // c.add(Restrictions.in("vigenciaTarifa", lsAux)); + // } + // } else { + // c.add(Restrictions.in("vigenciaTarifa", lsVigenciaTarifa)); + // } + // } + // + // if (!lsMoneda.isEmpty()) { + // c.add(Restrictions.in("moneda", lsMoneda)); + // } + // + // if (!lsMarca.isEmpty()) { + // c.add(Restrictions.in("marca", lsMarca)); + // } + // + // if (!lsClaseServicio.isEmpty()) { + // c.add(Restrictions.in("claseServicio", lsClaseServicio)); + // } + // + // Criteria cCategoria = null; + // if (!lsCategoria.isEmpty()) { + // cCategoria = c.createCriteria("lsTarifaCategoria"); + // cCategoria.add(Restrictions.in("categoria", lsCategoria)); + // } + // + // Criteria cTipoPuntoVenta = null; + // if (!lsTipoPuntoVenta.isEmpty()) { + // cTipoPuntoVenta = c.createCriteria("lsTarifaTipoptovta"); + // cTipoPuntoVenta.add(Restrictions.in("tipoPuntoVenta", lsTipoPuntoVenta)); + // } + // + // if (!lsEmpresa.isEmpty()) { + // Criteria criteriaRuta = getSession().createCriteria(Ruta.class); + // Criteria cEmpresa = criteriaRuta.createCriteria("lsRutaEmpresa"); + // log.info("Excel: Qtd lsEmpresa" + lsEmpresa.size()); + // cEmpresa.add(Restrictions.in("empresa", lsEmpresa)); + // + // List lsRutasComEmpresa = criteriaRuta.list(); + // List lsTramos = new ArrayList(); + // for (Ruta ruta : lsRutasComEmpresa) { + // ruta = rutaDAO.obtenerID(ruta.getRutaId()); + // for (RutaCombinacion rc : ruta.getRutaCombinacionList()) { + // if (!lsTramos.contains(rc.getTramo())) { + // lsTramos.add(rc.getTramo()); + // } + // } + // } + // + // if (!lsTramos.isEmpty()) { + // List lsAux = null; + // if (lsTramos.size() > 1000) { + // lsAux = new ArrayList(); + // for (Tramo t : lsTramos) { + // lsAux.add(t); + // if (lsAux.size() == 500) { + // log.info("Excel: Qtd lsAux 1 - " + lsAux.size()); + // c.add(Restrictions.in("tramo", lsAux)); + // lsAux = new ArrayList(); + // } + // } + // if (lsAux != null && lsAux.size() > 0) { + // log.info("Excel: Qtd lsAux 2 - " + lsAux.size()); + // c.add(Restrictions.in("tramo", lsAux)); + // } + // } else { + // log.info("Excel: Qtd lsAux 3 - " + lsAux.size()); + // c.add(Restrictions.in("tramo", lsTramos)); + // } + // } + // } + // + // + // + // + // if (!lsRuta.isEmpty()) { + // List lsTramos = new ArrayList(); + // for (Ruta ruta : lsRuta) { + // ruta = rutaDAO.obtenerID(ruta.getRutaId()); + // for (RutaCombinacion rc : ruta.getRutaCombinacionList()) { + // if (!lsTramos.contains(rc.getTramo())) { + // lsTramos.add(rc.getTramo()); + // } + // } + // } + // + // if (!lsTramos.isEmpty()) { + // List lsAux = null; + // if (lsTramos.size() > 1000) { + // lsAux = new ArrayList(); + // for (Tramo t : lsTramos) { + // lsAux.add(t); + // if (lsAux.size() == 1000) { + // c.add(Restrictions.in("tramo", lsAux)); + // lsAux = new ArrayList(); + // } + // } + // if (lsAux != null && lsAux.size() > 0) { + // c.add(Restrictions.in("tramo", lsAux)); + // } + // } else { + // c.add(Restrictions.in("tramo", lsTramos)); + // } + // } + // } + // + // return c.list(); + + StringBuilder hql = new StringBuilder(" SELECT T FROM "); + hql.append(" Tarifa as T "); + hql.append(" inner join T.marca as M "); + hql.append(" inner join T.moneda as MON "); + hql.append(" inner join T.vigenciaTarifa as VT "); + hql.append(" inner join T.claseServicio as CS "); + hql.append(" ,RutaCombinacion as RC,RutaEmpresa as RE,Ruta as R "); + hql.append(" WHERE T.activo = 1 AND RC.activo = 1 AND RE.activo = 1 AND R.activo = 1 "); + hql.append(" AND RC.tramo = T.tramo "); + hql.append(" AND RE.ruta = RC.ruta "); + hql.append(" AND RE.ruta.rutaId = R.rutaId "); + hql.append(" AND R.claseServicio = CS "); + + if (!lsVigenciaTarifa.isEmpty()) { + hql.append(" AND VT in (:lsVigencia) "); + } + if (!lsEmpresa.isEmpty()) { + hql.append(" AND RE.empresa in (:lsEmpresa) "); + } + if (!lsRuta.isEmpty()) { + hql.append(" AND RC.ruta in (:lsRuta)"); + } + if (!lsMarca.isEmpty()) { + hql.append(" AND M in (:lsMarca) "); + } + if (!lsMoneda.isEmpty()) { + hql.append(" AND MON in (:lsMoneda) "); + } + if (!lsClaseServicio.isEmpty()) { + hql.append(" AND CS in (:lsClaseServicio) "); + } + + Query sq = getSession().createQuery(hql.toString()); + sq.setParameterList("lsVigencia", lsVigenciaTarifa); + + if (!lsEmpresa.isEmpty()) { + sq.setParameterList("lsEmpresa", lsEmpresa); + } + if (!lsRuta.isEmpty()) { + sq.setParameterList("lsRuta", lsRuta); + } + if (!lsMarca.isEmpty()) { + sq.setParameterList("lsMarca", lsMarca); + } + if (!lsMoneda.isEmpty()) { + sq.setParameterList("lsMoneda", lsMoneda); + } + if (!lsClaseServicio.isEmpty()) { + sq.setParameterList("lsClaseServicio", lsClaseServicio); + } + return sq.list(); + + } + + public List buscarExisteVigencia(VigenciaTarifa vigenciaTarifa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHistHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHistHibernateDAO.java new file mode 100644 index 000000000..2e3602395 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHistHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarifaHistDAO; +import com.rjconsultores.ventaboletos.entidad.TarifaHist; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("tarifaHistDAO") +public class TarifaHistHibernateDAO extends GenericHibernateDAO + implements TarifaHistDAO { + + @Autowired + public TarifaHistHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaMinimaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaMinimaHibernateDAO.java new file mode 100644 index 000000000..420f06baf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaMinimaHibernateDAO.java @@ -0,0 +1,185 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarifaMinimaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Disjunction; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("tarifaMinimaDAO") +public class TarifaMinimaHibernateDAO extends GenericHibernateDAO + implements TarifaMinimaDAO { + + @Autowired + public TarifaMinimaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (marca != null) { + c.add(Restrictions.eq("marca", marca)); + } + + if (origem != null) { + c.add(Restrictions.eq("origem", origem)); + } + + if (destino != null) { + c.add(Restrictions.eq("destino", destino)); + } + + if (claseServicio != null) { + c.add(Restrictions.eq("claseServicio", claseServicio)); + } + + if (moneda != null) { + c.add(Restrictions.eq("moneda", moneda)); + } + + return c.list(); + } + + public List pesquisarPlaza(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Plaza plaza) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (marca != null) { + c.add(Restrictions.eq("marca", marca)); + } + + if (origem != null) { + c.add(Restrictions.eq("origem", origem)); + } + + if (destino != null) { + c.add(Restrictions.eq("destino", destino)); + } + + if (claseServicio != null) { + c.add(Restrictions.eq("claseServicio", claseServicio)); + } + + if (plaza != null) { + c.add(Restrictions.eq("plaza", plaza)); + } + + return c.list(); + } + + public List buscarPorPlaza(Plaza plaza) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("plaza", plaza)); + + return c.list(); + } + + public List pesquisar(BigDecimal valor, Moneda moneda, + Plaza plaza, Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("importetarifa", valor)); + c.add(Restrictions.eq("moneda", moneda)); + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("plaza", plaza)); + + return c.list(); + } + + public List pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda) { + + Criteria criterioBusca = getSession().createCriteria(getPersistentClass()); + + Disjunction disjunctionOrigem = Restrictions.disjunction(); + Criterion cOrigem = Restrictions.eq("origem", origem); + Criterion cOrigemTodos = Restrictions.eq("origem.paradaId", Parada.ID_PARADA_TODOS); + disjunctionOrigem.add(cOrigem); + disjunctionOrigem.add(cOrigemTodos); + criterioBusca.add(disjunctionOrigem); + + Disjunction disjunctionDestino = Restrictions.disjunction(); + Criterion cDestino = Restrictions.eq("destino", destino); + Criterion cDestinoTodos = Restrictions.eq("destino.paradaId", Parada.ID_PARADA_TODOS); + disjunctionDestino.add(cDestino); + disjunctionDestino.add(cDestinoTodos); + criterioBusca.add(disjunctionDestino); + + criterioBusca.add(Restrictions.eq("activo", Boolean.TRUE)); + criterioBusca.add(Restrictions.eq("moneda", moneda)); + + criterioBusca.add(Restrictions.or(Restrictions.eq("marca", marca),Restrictions.eq("marca.marcaId", (short) -1))); + criterioBusca.add(Restrictions.or(Restrictions.eq("claseServicio", claseServicio),Restrictions.eq("claseServicio.claseservicioId", (short) -1))); + + return criterioBusca.list(); + } + + public List buscarPorMarcaMoneda(Marca marca, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("marca", marca)); + c.add(Restrictions.eq("moneda", moneda)); + + return c.list(); + } + + public List buscarPorClaseServicioMoneda( + ClaseServicio claseServicio, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("claseServicio", claseServicio)); + c.add(Restrictions.eq("moneda", moneda)); + + return c.list(); + } + + public List buscarPorPlazaMoneda(Plaza plaza, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("plaza", plaza)); + c.add(Restrictions.eq("moneda", moneda)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaTipoptovtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaTipoptovtaHibernateDAO.java new file mode 100644 index 000000000..f31e20391 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaTipoptovtaHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarifaTipoptovtaDAO; +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("tarifaTipoptovtaDAO") +public class TarifaTipoptovtaHibernateDAO + extends GenericHibernateDAO + implements TarifaTipoptovtaDAO { + + @Autowired + public TarifaTipoptovtaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaFidelidadHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaFidelidadHibernateDAO.java new file mode 100644 index 000000000..c0fd20b5d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaFidelidadHibernateDAO.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarjetaFidelidadDAO; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidadCuenta; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.ProjectionList; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("tarjetaFidelidadDAO") +public class TarjetaFidelidadHibernateDAO extends GenericHibernateDAO + implements TarjetaFidelidadDAO { + + @Autowired + public TarjetaFidelidadHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + return c.list(); + } + + public List obtenerCantDesc() { + + /*Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + ProjectionList projList = Projections.projectionList(); + projList.add(Projections.groupProperty("descGeneracion")); + projList.add(Projections.rowCount()); + c.setProjection(projList); + List list = c.list(); + + List list1 =list; + list.get(0); + list.get(1); //el la descripcion + //list.get( 0 )[1] //el la cantidad + + return list; + + */ + List sumatarjetas = new ArrayList(); + + String hql = "select count(*),descGeneracion" + + " from TarjetaFidelidad where activo = 1 group by descGeneracion"; + + Query qry = getSession().createQuery(hql); + + for (Iterator it = qry.iterate(); it.hasNext();) { + Object[] row = (Object[]) it.next(); + TarjetaFidelidadCuenta item = new TarjetaFidelidadCuenta(); + + item.setDescGeneracion((String) row[1]); + item.setCantidad(HibernateFix.count(row[0]).intValue()); + sumatarjetas.add(item); + } + return sumatarjetas; + + + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaRecaudacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaRecaudacionHibernateDAO.java new file mode 100644 index 000000000..70da4125c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaRecaudacionHibernateDAO.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TarjetaRecaudacionDAO; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacionPK; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tarjetaRecaudacionDAO") +public class TarjetaRecaudacionHibernateDAO + extends GenericHibernateDAO + implements TarjetaRecaudacionDAO { + + @Autowired + public TarjetaRecaudacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaViajeHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaViajeHibernateDAO.java new file mode 100644 index 000000000..3455c35f6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarjetaViajeHibernateDAO.java @@ -0,0 +1,139 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.Date; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.dao.TarjetaViajeDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import java.util.Calendar; +import java.util.GregorianCalendar; +import org.hibernate.criterion.Order; + +@Repository("tarjetaViajeDAO") +public class TarjetaViajeHibernateDAO extends GenericHibernateDAO implements TarjetaViajeDAO { + + @Autowired + public TarjetaViajeHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List buscarTarjetaPorFiltros(Integer autoIni, Integer autoFin, Date dataIni, Date dataFin, Comboitem empresa) { + String hql = " select tv from TarjetaViaje tv " + + " where tv.tarjetaviajeId > 0 and activo = 1 "; + StringBuilder sb = new StringBuilder(); + if (autoIni != null && autoFin != null) { + sb.append(" and cast(tv.autobus.numautobus as int) <= ").append(autoFin); + sb.append(" and cast(tv.autobus.numautobus as int) >= ").append(autoIni); + } + if (dataFin != null && dataIni != null) { + sb.append(" and tv.fecHorSalida >= :dataIni"); + sb.append(" and tv.fecHorSalida <= :dataFin"); + } + if (empresa != null) { + Empresa e = (Empresa) empresa.getValue(); + if (e.getEmpresaId() != -1) { + sb.append(" and tv.empresa.empresaId = ").append(e.getEmpresaId()); + } + } + + sb.append(" order by cast(tv.autobus.numautobus as int), tv.fecHorSalida, tv.origen, tv.conductor.conductorId asc "); + + hql += sb.toString(); + + Query sq = getSession().createQuery(hql); + if (dataFin != null && dataIni != null) { + sq.setTimestamp("dataIni", dataIni); + sq.setTimestamp("dataFin", dataFin); + } + List lsTarjetas = sq.list(); + + return lsTarjetas; + } + + @Override + public List buscarTarjetaPorFiltros(TarjetaViaje tarjeta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.or(Restrictions.eq("autobus", tarjeta.getAutobus()), Restrictions.eq("conductor", tarjeta.getConductor()))); + c.add(Restrictions.eq("origen", tarjeta.getOrigen())); + return c.list(); + } + + @Override + public boolean buscarTarjetaExisteVolta(TarjetaViaje tarjeta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.or(Restrictions.eq("autobus", tarjeta.getAutobus()), Restrictions.eq("conductor", tarjeta.getConductor()))); + c.add(Restrictions.ge("fecHorSalida", tarjeta.getFecHorSalida())); + c.add(Restrictions.not(Restrictions.eq("tarjetaviajeId", tarjeta.getTarjetaviajeId()))); + c.addOrder(Order.asc("fecHorSalida")); + + c.setMaxResults(1); + + if (!c.list().isEmpty()) { + + TarjetaViaje tVResult = (TarjetaViaje) c.uniqueResult(); + if (tVResult.getOrigen().equals(tarjeta.getDestino()) + && tVResult.getDestino().equals(tarjeta.getOrigen())) { + return true; + } + } + + Criteria c1 = getSession().createCriteria(getPersistentClass()); + c1.add(Restrictions.eq("activo", true)); + c1.add(Restrictions.or(Restrictions.eq("autobus", tarjeta.getAutobus()), Restrictions.eq("conductor", tarjeta.getConductor()))); + c1.add(Restrictions.le("fecHorSalida", tarjeta.getFecHorSalida())); + c1.add(Restrictions.not(Restrictions.eq("tarjetaviajeId", tarjeta.getTarjetaviajeId()))); + c1.addOrder(Order.desc("fecHorSalida")); + c1.setMaxResults(1); + if (!c1.list().isEmpty()) { + TarjetaViaje tVResult = (TarjetaViaje) c1.uniqueResult(); + if (tVResult.getOrigen().equals(tarjeta.getDestino()) + && tVResult.getDestino().equals(tarjeta.getOrigen())) { + return true; + } + } + + + return false; + } + + @Override + public List buscarTarjetasParaEnvioNomina(Date fecIni, Date fecFin) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", true)); + c.add(Restrictions.isNull("fecenvionomina")); + + GregorianCalendar gAux = new GregorianCalendar(); + gAux.setTime(fecIni); + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(fecIni); + gcalendar.set(Calendar.HOUR_OF_DAY, 0); + gcalendar.set(Calendar.MINUTE, 0); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 0); + fecIni = gcalendar.getTime(); + + GregorianCalendar gcalendarFim = new GregorianCalendar(); + gcalendarFim.setTime(fecFin); + gcalendarFim.set(Calendar.HOUR_OF_DAY, 23); + gcalendarFim.set(Calendar.MINUTE, 59); + gcalendarFim.set(Calendar.SECOND, 59); + gcalendarFim.set(Calendar.MILLISECOND, 59); + fecFin = gcalendarFim.getTime(); + + c.add(Restrictions.between("fecHorSalida", fecIni, fecFin)); + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCiudadHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCiudadHibernateDAO.java new file mode 100644 index 000000000..f639f60fa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCiudadHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoCambioCiudadDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoCambioCiudadDAO") +public class TipoCambioCiudadHibernateDAO extends GenericHibernateDAO + implements TipoCambioCiudadDAO { + + @Autowired + public TipoCambioCiudadHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCtrlHibernateDAO.java new file mode 100644 index 000000000..5ab521926 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCambioCtrlHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoCambioCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoCambioCtrlDAO") +public class TipoCambioCtrlHibernateDAO extends GenericHibernateDAO + implements TipoCambioCtrlDAO { + + @Autowired + public TipoCambioCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoConvenioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoConvenioHibernateDAO.java new file mode 100644 index 000000000..a5cc27361 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoConvenioHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("tipoConvenioDAO") +public class TipoConvenioHibernateDAO extends GenericHibernateDAO + implements TipoConvenioDAO { + + @Autowired + public TipoConvenioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCorteHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCorteHibernateDAO.java new file mode 100644 index 000000000..947525aff --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCorteHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoCorteDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoCorteDAO") +public class TipoCorteHibernateDAO extends GenericHibernateDAO + implements TipoCorteDAO { + + @Autowired + public TipoCorteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String desctipo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("desctipo", desctipo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaDescuentoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaDescuentoHibernateDAO.java new file mode 100644 index 000000000..c71a25a2e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaDescuentoHibernateDAO.java @@ -0,0 +1,83 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoCortesiaDescuentoDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import java.math.BigDecimal; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("tipoCortesiaDescuentoDAO") +public class TipoCortesiaDescuentoHibernateDAO + extends GenericHibernateDAO + implements TipoCortesiaDescuentoDAO { + + @Autowired + public TipoCortesiaDescuentoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List pesquisar(TipoCortesia tipoCortesia) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (tipoCortesia != null) { + c.add(Restrictions.eq("tipoCortesia", tipoCortesia)); + } + return c.list(); + } + + public List Onchangue(TipoCortesia tp) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + if (tp != null) { + c.add(Restrictions.eq("tipoCortesia", tp)); + } + return c.list(); + } + + public List buscar(BigDecimal porcentaje, + TipoCortesia tipoCortesia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("porcdescuento", porcentaje)); + c.add(Restrictions.eq("tipoCortesia", tipoCortesia)); + + return c.list(); + } + + public List obtenerTipoCortesia(int i) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tipoCortesia.tipocortesiaId", new Integer(i).shortValue())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaHibernateDAO.java new file mode 100644 index 000000000..9b42023b1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoCortesiaHibernateDAO.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoCortesiaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("tipoCortesiaDAO") +public class TipoCortesiaHibernateDAO extends GenericHibernateDAO + implements TipoCortesiaDAO { + + @Autowired + public TipoCortesiaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descTipo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desctipo", descTipo)); + + return c.list(); + } + + public List obtenerGrupoCortesia(int i) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("grupoCortesia.grupocortesiaId", new Integer(i).shortValue())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoDomicilioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoDomicilioHibernateDAO.java new file mode 100644 index 000000000..c73b57929 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoDomicilioHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoDomicilioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoDomicilioDAO") +public class TipoDomicilioHibernateDAO extends GenericHibernateDAO + implements TipoDomicilioDAO { + + @Autowired + public TipoDomicilioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String desctipo, String cvetipodomicilio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("desctipo", desctipo)); + c.add(Restrictions.eq("cvetipodomicilio", cvetipodomicilio)); + + return c.list(); + } + + public List buscarClave(String cvetipodomicilio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("cvetipodomicilio", cvetipodomicilio)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEmpleadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEmpleadoHibernateDAO.java new file mode 100644 index 000000000..4141388f3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEmpleadoHibernateDAO.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoEmpleadoDAO; +import com.rjconsultores.ventaboletos.entidad.TipoEmpleado; +import java.io.Serializable; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Shiro + */ +@Repository("tipoEmpleadoDAO") +public class TipoEmpleadoHibernateDAO extends GenericHibernateDAO +implements TipoEmpleadoDAO{ + + + @Autowired + public TipoEmpleadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java new file mode 100644 index 000000000..dd3d95e90 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java @@ -0,0 +1,42 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.TipoEventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +@Repository("tipoEventoExtraDAO") +public class TipoEventoExtraHibernateDAO extends + GenericHibernateDAO implements + TipoEventoExtraDAO { + + @Autowired + public TipoEventoExtraHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public List buscar(String nombIngreso) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descTipoEvento", nombIngreso)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoMovimientoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoMovimientoHibernateDAO.java new file mode 100644 index 000000000..29851bd86 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoMovimientoHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoMovimientoDAO; +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoMovimientoDAO") +public class TipoMovimientoHibernateDAO extends GenericHibernateDAO + implements TipoMovimientoDAO { + + @Autowired + public TipoMovimientoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descmovimiento) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descmovimiento", descmovimiento)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoOcupacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoOcupacionHibernateDAO.java new file mode 100644 index 000000000..c7e47be47 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoOcupacionHibernateDAO.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoOcupacionDAO") +public class TipoOcupacionHibernateDAO extends GenericHibernateDAO + implements TipoOcupacionDAO { + + @Autowired + public TipoOcupacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String desctipo, String cvetipoocupacion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("desctipo", desctipo)); + c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion)); + + return c.list(); + } + + public List buscarClave(String cvetipoocupacion) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoParadaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoParadaHibernateDAO.java new file mode 100644 index 000000000..4204f6f44 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoParadaHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoParadaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoParadaDAO") +public class TipoParadaHibernateDAO extends GenericHibernateDAO + implements TipoParadaDAO { + + @Autowired + public TipoParadaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctipo")); + + return c.list(); + } + + public List buscar(String desctipo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desctipo", desctipo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoPuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoPuntoVentaHibernateDAO.java new file mode 100644 index 000000000..5eac25d57 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoPuntoVentaHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tipoPuntoVentaDAO") +public class TipoPuntoVentaHibernateDAO extends GenericHibernateDAO + implements TipoPuntoVentaDAO { + + @Autowired + public TipoPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctipo")); + + return c.list(); + } + + public List buscar(String desctipo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desctipo", desctipo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoServicioHibernateDAO.java new file mode 100644 index 000000000..5dc343d23 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoServicioHibernateDAO.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("tipoServicioDAO") +public class TipoServicioHibernateDAO extends GenericHibernateDAO + implements TipoServicioDAO { + + @Autowired + public TipoServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("descservicio")); + + return c.list(); + } + + public List buscar(String descservicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("descservicio", descservicio)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoVentaHibernateDAO.java new file mode 100644 index 000000000..898410ece --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoVentaHibernateDAO.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TipoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("tipoVentaDAO") +public class TipoVentaHibernateDAO extends GenericHibernateDAO + implements TipoVentaDAO { + + @Autowired + public TipoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctipoventa")); + + return c.list(); + } + + public List buscar(String desctipoventa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("desctipoventa", desctipoventa)); + + return c.list(); + } + + public TipoVenta obtenerID(Short tipoventaId) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("tipoventaId", tipoventaId)); + + return (TipoVenta) c.uniqueResult(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java new file mode 100644 index 000000000..9ecaa64d5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.FetchMode; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tramoDAO") +public class TramoHibernateDAO extends GenericHibernateDAO + implements TramoDAO { + + @Autowired + public TramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctramo")); + + return c.list(); + } + + public Tramo obtenerPorOrigemDestino(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + Tramo t = new Tramo(); + if (c.list().size() > 0) { + t = (Tramo) c.list().get(0); + } + + return t; + } + + public Tramo obtenerTramotPorOrigemDestinoVia(Parada origem, Parada destino, Via via) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("via", via)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return (Tramo) c.uniqueResult(); + } + + public List obtenerListPorOrigemDestino(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctramo")); + + return c.list(); + } + + public List obtenerPorOrigemDestinoFetchLazy(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctramo")); + + c.setFetchMode("origem", FetchMode.LAZY); + c.setFetchMode("destino", FetchMode.LAZY); + c.setFetchMode("lsTramoTiempo", FetchMode.LAZY); + c.setFetchMode("rutaSecuenciaList", FetchMode.LAZY); + c.setFetchMode("rutaCombinacionList", FetchMode.LAZY); + c.setFetchMode("tramoServicioList", FetchMode.LAZY); + c.setFetchMode("tramoKms", FetchMode.LAZY); + + return c.list(); + } + + // Obtener Vias Possiveis + public List obtenerViasOrigemDestino(Parada origem, Parada destino) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("desctramo")); + + c.setProjection(Projections.property("via")); + + return c.list(); + } + + public Tramo busca(Parada origem, Parada destino, Via via) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("via", via)); + + return (Tramo) c.uniqueResult(); + } + + public List buscarCveParada(String origen, String destino, String via) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.createCriteria("origem").add(Restrictions.eq("paradaId", Integer.parseInt(origen))); + c.createCriteria("destino").add(Restrictions.eq("paradaId", Integer.parseInt(destino))); + c.createCriteria("via").add(Restrictions.eq("viaId", Integer.parseInt(via))); + + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Tramo obtenerTramoUnicoRuta(Parada origem, Parada destino, Via via, + ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("via", via)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.setFetchMode("origem", FetchMode.LAZY); + c.setFetchMode("destino", FetchMode.LAZY); + c.setFetchMode("lsTramoTiempo", FetchMode.LAZY); + c.setFetchMode("rutaSecuenciaList", FetchMode.LAZY); + c.setFetchMode("rutaCombinacionList", FetchMode.LAZY); + c.setFetchMode("tramoServicioList", FetchMode.LAZY); + c.setFetchMode("tramoKms", FetchMode.LAZY); + + Criteria c2 = c.createCriteria("tramoServicioList"); + c2.add(Restrictions.eq("claseServicio", claseServicio)); + c2.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.setMaxResults(1); + List result = c.list(); + + if (result.isEmpty()) { + return null; + } + + return result.get(0); + } + + public Long count(Via via) { + Criteria c = this.makeCriteria(); + + c.add(Restrictions.eq("via", via)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.setProjection(Projections.rowCount()); + + return HibernateFix.count(c.list()); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoKmServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoKmServicioHibernateDAO.java new file mode 100644 index 000000000..8d2ad8483 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoKmServicioHibernateDAO.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TramoKmServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import com.rjconsultores.ventaboletos.entidad.Via; + +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("tramoKmServicioDAO") +public class TramoKmServicioHibernateDAO extends GenericHibernateDAO + implements TramoKmServicioDAO { + + @Autowired + public TramoKmServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscar(TramoKmServicio tramoKmServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramoKmServicio.getTramo())); + c.add(Restrictions.eq("claseServicio", tramoKmServicio.getClaseServicio())); + c.add(Restrictions.eq("empresa", tramoKmServicio.getEmpresa())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoServicioHibernateDAO.java new file mode 100644 index 000000000..f4469f0fb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoServicioHibernateDAO.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TramoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; + +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("tramoServicioDAO") +public class TramoServicioHibernateDAO extends GenericHibernateDAO + implements TramoServicioDAO { + + @Autowired + public TramoServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscarPorTramo(Tramo tramo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramo)); + + return c.list(); + } + + public List buscarPorTramo(Tramo tramo, ClaseServicio clase) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("claseServicio", clase)); + + return c.list(); + } + + @Override + public TramoServicio buscar(Parada origen, Parada destino, Via via, ClaseServicio clase) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + Criteria cTramo = c.createCriteria("tramo"); + cTramo.add(Restrictions.eq("origem", origen)); + cTramo.add(Restrictions.eq("destino", destino)); + cTramo.add(Restrictions.eq("via", via)); + cTramo.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("claseServicio", clase)); + + return (TramoServicio) c.uniqueResult(); + + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoTiempoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoTiempoHibernateDAO.java new file mode 100644 index 000000000..45d7dad92 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoTiempoHibernateDAO.java @@ -0,0 +1,95 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TramoTiempoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("tramoTiempoDAO") +public class TramoTiempoHibernateDAO extends GenericHibernateDAO implements TramoTiempoDAO { + + @Autowired + public TramoTiempoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorTramo(Tramo tramo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramo)); + + return c.list(); + } + + public List buscarPorTramo(Tramo tramo, ClaseServicio clase) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("claseServicio", clase)); + + return c.list(); + } + + @Override + public List buscar(Tramo tramo, ClaseServicio clase, Date horaIni, Date horaFin) { + + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tramo", tramo)); + c.add(Restrictions.eq("claseServicio", clase)); + + Calendar tmpIni = Calendar.getInstance(); + tmpIni.setTime(horaIni); + + Calendar tmpFin = Calendar.getInstance(); + tmpFin.setTime(horaFin); + + Calendar fecInicio = DateUtil.getFecInicio(); + fecInicio.set(Calendar.HOUR_OF_DAY, tmpIni.get(Calendar.HOUR_OF_DAY)); + fecInicio.set(Calendar.MINUTE, tmpIni.get(Calendar.MINUTE)); + + Calendar fecFin = DateUtil.getFecInicio(); + fecFin.set(Calendar.HOUR_OF_DAY, tmpFin.get(Calendar.HOUR_OF_DAY)); + fecFin.set(Calendar.MINUTE, tmpFin.get(Calendar.MINUTE)); + + if (fecFin.compareTo(fecInicio) < 0){// se a data fin é menor que a data inicio (considerando a hora), é porque é no dia seguinte. Ex.: Intervalo 23:00 à 00:00 + fecFin.add(Calendar.DATE, 1); + } + + c.add(Restrictions.ge("horafin",fecInicio.getTime())); + c.add(Restrictions.le("horainicio",fecFin.getTime())); + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TurnoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TurnoHibernateDAO.java new file mode 100644 index 000000000..bdfb2260c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TurnoHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.TurnoDAO; +import com.rjconsultores.ventaboletos.entidad.Turno; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("turnoDAO") +public class TurnoHibernateDAO extends GenericHibernateDAO + implements TurnoDAO { + + @Autowired + public TurnoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscar(String descturno) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descturno", descturno)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioBancarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioBancarioHibernateDAO.java new file mode 100644 index 000000000..c78fee960 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioBancarioHibernateDAO.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.UsuarioBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("usuarioBancarioDAO") +public class UsuarioBancarioHibernateDAO extends GenericHibernateDAO + implements UsuarioBancarioDAO { + + @Autowired + public UsuarioBancarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioHibernateDAO.java new file mode 100644 index 000000000..63c9f8300 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioHibernateDAO.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.UsuarioDAO; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("usuarioDAO") +public class UsuarioHibernateDAO extends GenericHibernateDAO + implements UsuarioDAO { + + @Autowired + public UsuarioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPeloNome(String nome) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("nombusuario", nome)); + c.addOrder(Order.asc("nombusuario")); + + return c.list(); + } + + public Usuario buscarPeloNomeSenha(String stUsuario, String senha) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("claveUsuario", stUsuario)); + c.add(Restrictions.eq("senha", senha)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return (Usuario) c.uniqueResult(); + } + + public List buscarPorEmpleado(Empleado empleado) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("empleado", empleado)); + + return c.list(); + } + + public List buscarPelaCveUsuario(String cveUsuario) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("claveUsuario", cveUsuario)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioPerfilHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioPerfilHibernateDAO.java new file mode 100644 index 000000000..15b32f0c7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioPerfilHibernateDAO.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.UsuarioPerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Rafius + */ +@Repository("usuarioPerfilDAO") +public class UsuarioPerfilHibernateDAO extends GenericHibernateDAO + implements UsuarioPerfilDAO { + + @Autowired + public UsuarioPerfilHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List obtenerPorUsuario(Usuario usuario) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("usuario", usuario)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioUbicacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioUbicacionHibernateDAO.java new file mode 100644 index 000000000..17f0299b5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/UsuarioUbicacionHibernateDAO.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.UsuarioUbicacionDAO; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("usuarioUbicacionDAO") +public class UsuarioUbicacionHibernateDAO extends GenericHibernateDAO + implements UsuarioUbicacionDAO { + + @Autowired + public UsuarioUbicacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List buscarPorUsuario(Usuario usuario) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("usuario", usuario)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ViaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ViaHibernateDAO.java new file mode 100644 index 000000000..1c19dd3bc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ViaHibernateDAO.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.ViaDAO; +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author Administrador + */ +@Repository("viaDAO") +public class ViaHibernateDAO extends GenericHibernateDAO + implements ViaDAO { + + @Autowired + public ViaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.addOrder(Order.asc("nombvia")); + + return c.list(); + } + + public List buscar(String nombvia) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombvia", nombvia)); + c.addOrder(Order.asc("nombvia")); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/VigenciaTarifaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/VigenciaTarifaHibernateDAO.java new file mode 100644 index 000000000..388b51f14 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/VigenciaTarifaHibernateDAO.java @@ -0,0 +1,87 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import com.rjconsultores.ventaboletos.dao.VigenciaTarifaDAO; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Disjunction; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +/** + * + * @author rodrigo + */ +@Repository("vigenciaTarifaDAO") +public class VigenciaTarifaHibernateDAO extends + GenericHibernateDAO implements + VigenciaTarifaDAO { + + @Autowired + public VigenciaTarifaHibernateDAO( + @Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.addOrder(Order.asc("feciniciovigencia")); + + return c.list(); + } + + @Override + public List pesquisar(Date inicio, Date fim) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if (inicio != null) { + c.add(Restrictions.eq("feciniciovigencia", inicio)); + } + + if (fim != null) { + c.add(Restrictions.eq("fecfinvigencia", fim)); + } + + return c.list(); + } + + @Override + public List buscarVigenciasIntervalo(VigenciaTarifa vt) { + + Calendar feciniciovigencia = Calendar.getInstance(); + feciniciovigencia.setTime(vt.getFeciniciovigencia()); + feciniciovigencia.set(Calendar.MILLISECOND, 0); + + Calendar fecfinvigencia = Calendar.getInstance(); + fecfinvigencia.setTime(vt.getFecfinvigencia()); + fecfinvigencia.set(Calendar.MILLISECOND, 0); + + + + Criteria c = this.getSession().createCriteria(VigenciaTarifa.class); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.ge("fecfinvigencia", feciniciovigencia.getTime())); + c.add(Restrictions.le("feciniciovigencia", fecfinvigencia.getTime())); + + return c.list(); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/AjusteEventoExtra.java b/src/com/rjconsultores/ventaboletos/entidad/AjusteEventoExtra.java new file mode 100644 index 000000000..2b6c00b66 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/AjusteEventoExtra.java @@ -0,0 +1,208 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "AJUSTE_EVENTO_EXTRA") +@SequenceGenerator(name = "AJUSTE_EVENTO_EXTRA_SEQ", sequenceName = "AJUSTE_EVENTO_EXTRA_SEQ", allocationSize = 1) +public class AjusteEventoExtra implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "AJUSTE_EVENTO_EXTRA_SEQ") + @Column(name = "AJUSTEEVENTOEXTRA_ID") + private Long ajusteeventoextraId; + @Column(name = "TIPOEVENTOEXTRA_ID") + private Integer tipoeventoextraId; + @Column(name = "FECHORINGRESO") + @Temporal(TemporalType.TIMESTAMP) + private Date fechoringreso; + @Column(name = "CORTETURNO_ID") + private Integer corteturnoId; + @Column(name = "IMPINGRESO") + private BigDecimal impingreso; + @Column(name = "NUMDOCUMENTO") + private String numdocumento; + @Column(name = "IMPORTEIVA") + private BigDecimal importeiva; + @Column(name = "PUNTOVENTA_ID") + private Integer puntoventaId; + @Column(name = "DEPOSITOBANCARIO_ID") + private Integer depositobancarioId; + @Column(name = "EMPRESA_ID") + private Integer empresaId; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "STATUSAJUSTE") + private Short statusajuste; + + public AjusteEventoExtra() { + } + + public AjusteEventoExtra(Long ajusteeventoextraId) { + this.ajusteeventoextraId = ajusteeventoextraId; + } + + public Long getAjusteeventoextraId() { + return ajusteeventoextraId; + } + + public void setAjusteeventoextraId(Long ajusteeventoextraId) { + this.ajusteeventoextraId = ajusteeventoextraId; + } + + public Integer getTipoeventoextraId() { + return tipoeventoextraId; + } + + public void setTipoeventoextraId(Integer tipoeventoextraId) { + this.tipoeventoextraId = tipoeventoextraId; + } + + public Date getFechoringreso() { + return fechoringreso; + } + + public void setFechoringreso(Date fechoringreso) { + this.fechoringreso = fechoringreso; + } + + public Integer getCorteturnoId() { + return corteturnoId; + } + + public void setCorteturnoId(Integer corteturnoId) { + this.corteturnoId = corteturnoId; + } + + public BigDecimal getImpingreso() { + return impingreso; + } + + public void setImpingreso(BigDecimal impingreso) { + this.impingreso = impingreso; + } + + public String getNumdocumento() { + return numdocumento; + } + + public void setNumdocumento(String numdocumento) { + this.numdocumento = numdocumento; + } + + public BigDecimal getImporteiva() { + return importeiva; + } + + public void setImporteiva(BigDecimal importeiva) { + this.importeiva = importeiva; + } + + public Integer getPuntoventaId() { + return puntoventaId; + } + + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public Integer getDepositobancarioId() { + return depositobancarioId; + } + + public void setDepositobancarioId(Integer depositobancarioId) { + this.depositobancarioId = depositobancarioId; + } + + public Integer getEmpresaId() { + return empresaId; + } + + public void setEmpresaId(Integer empresaId) { + this.empresaId = empresaId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Short getStatusajuste() { + return statusajuste; + } + + public void setStatusajuste(Short statusajuste) { + this.statusajuste = statusajuste; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (ajusteeventoextraId != null ? ajusteeventoextraId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof AjusteEventoExtra)) { + return false; + } + AjusteEventoExtra other = (AjusteEventoExtra) object; + if ((this.ajusteeventoextraId == null && other.ajusteeventoextraId != null) || (this.ajusteeventoextraId != null && !this.ajusteeventoextraId.equals(other.ajusteeventoextraId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra[ajusteeventoextraId=" + ajusteeventoextraId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/AlertaCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/AlertaCtrl.java new file mode 100644 index 000000000..e118fe39c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/AlertaCtrl.java @@ -0,0 +1,278 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "ALERTA_CTRL_SEQ", sequenceName = "ALERTA_CTRL_SEQ", allocationSize = 1) +@Table(name = "ALERTA_CTRL") +public class AlertaCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ALERTA_CTRL_SEQ") + @Basic(optional = false) + @Column(name = "ALERTACTRL_ID") + private Integer alertactrlId; + @Column(name = "PORCALTA") + private BigDecimal porcalta; + @Column(name = "PORCBAJA") + private BigDecimal porcbaja; + @Column(name = "TIEMPOALTA") + private Integer tiempoalta; + @Column(name = "TIEMPOBAJA") + private Integer tiempobaja; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "INDLUNES") + private Boolean indlunes; + @Column(name = "INDMARTES") + private Boolean indmartes; + @Column(name = "INDMIERCOLES") + private Boolean indmiercoles; + @Column(name = "INDJUEVES") + private Boolean indjueves; + @Column(name = "INDVIERNES") + private Boolean indviernes; + @Column(name = "INDSABADO") + private Boolean indsabado; + @Column(name = "INDDOMINGO") + private Boolean inddomingo; + @OneToOne + @JoinColumn(name = "RUTA_ID") + private Ruta ruta; + @OneToOne + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + private Parada destino; + @OneToOne + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + private Parada origem; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + @OneToOne + @JoinColumns({ + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDA", referencedColumnName = "FECCORRIDA") + }) + private Corrida corrida; + + public AlertaCtrl() { + } + + public AlertaCtrl(Integer alertactrlId) { + this.alertactrlId = alertactrlId; + } + + public Integer getAlertactrlId() { + return alertactrlId; + } + + public void setAlertactrlId(Integer alertactrlId) { + this.alertactrlId = alertactrlId; + } + + public BigDecimal getPorcalta() { + return porcalta; + } + + public void setPorcalta(BigDecimal porcalta) { + this.porcalta = porcalta; + } + + public BigDecimal getPorcbaja() { + return porcbaja; + } + + public void setPorcbaja(BigDecimal porcbaja) { + this.porcbaja = porcbaja; + } + + public Boolean getInddomingo() { + return inddomingo; + } + + public void setInddomingo(Boolean inddomingo) { + this.inddomingo = inddomingo; + } + + public Boolean getIndjueves() { + return indjueves; + } + + public void setIndjueves(Boolean indjueves) { + this.indjueves = indjueves; + } + + public Boolean getIndlunes() { + return indlunes; + } + + public void setIndlunes(Boolean indlunes) { + this.indlunes = indlunes; + } + + public Boolean getIndmartes() { + return indmartes; + } + + public void setIndmartes(Boolean indmartes) { + this.indmartes = indmartes; + } + + public Boolean getIndmiercoles() { + return indmiercoles; + } + + public void setIndmiercoles(Boolean indmiercoles) { + this.indmiercoles = indmiercoles; + } + + public Boolean getIndsabado() { + return indsabado; + } + + public void setIndsabado(Boolean indsabado) { + this.indsabado = indsabado; + } + + public Boolean getIndviernes() { + return indviernes; + } + + public void setIndviernes(Boolean indviernes) { + this.indviernes = indviernes; + } + + public Integer getTiempoalta() { + return tiempoalta; + } + + public void setTiempoalta(Integer tiempoalta) { + this.tiempoalta = tiempoalta; + } + + public Integer getTiempobaja() { + return tiempobaja; + } + + public void setTiempobaja(Integer tiempobaja) { + this.tiempobaja = tiempobaja; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Corrida getCorrida() { + return corrida; + } + + public void setCorrida(Corrida corrida) { + this.corrida = corrida; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (alertactrlId != null ? alertactrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof AlertaCtrl)) { + return false; + } + AlertaCtrl other = (AlertaCtrl) object; + if ((this.alertactrlId == null && other.alertactrlId != null) || (this.alertactrlId != null && !this.alertactrlId.equals(other.alertactrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.AlertaCtrl[alertactrlId=" + alertactrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Articulo.java b/src/com/rjconsultores/ventaboletos/entidad/Articulo.java new file mode 100644 index 000000000..be3a6839d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Articulo.java @@ -0,0 +1,126 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "ARTICULO_SEQ", sequenceName = "ARTICULO_SEQ", allocationSize = 1) +@Table(name = "ARTICULO") +public class Articulo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ARTICULO_SEQ") + @Column(name = "ARTICULO_ID") + private Integer articuloId; + @Column(name = "DESCARTICULO") + private String descarticulo; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Articulo() { + } + + public Articulo(Integer articuloId) { + this.articuloId = articuloId; + } + + public Integer getArticuloId() { + return articuloId; + } + + public void setArticuloId(Integer articuloId) { + this.articuloId = articuloId; + } + + public String getDescarticulo() { + return descarticulo; + } + + public void setDescarticulo(String descarticulo) { + this.descarticulo = descarticulo; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (articuloId != null ? articuloId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Articulo)) { + return false; + } + Articulo other = (Articulo) object; + if ((this.articuloId == null && other.articuloId != null) || (this.articuloId != null && !this.articuloId.equals(other.articuloId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Articulo[articuloId=" + articuloId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java b/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java new file mode 100644 index 000000000..7239c8276 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java @@ -0,0 +1,183 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "ASIENTO_EXCLUSIVO_SEQ", sequenceName = "ASIENTO_EXCLUSIVO_SEQ", allocationSize = 1) +@Table(name = "ASIENTO_EXCLUSIVO") +public class AsientoExclusivo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "ASIENTOEXCLUSIVO_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ASIENTO_EXCLUSIVO_SEQ") + private Long asientoexclusivoId; + @Basic(optional = false) + @Column(name = "NUMASIENTO") + private String numasiento; + @Column(name = "VENDIBLE") + private Boolean vendible; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "MOTIVOBLOQUEO") + private String motivobloqueo; + @OneToOne + @JoinColumn(name = "NODO_ID") + private Nodo nodo; + @OneToOne + @JoinColumns({ + @JoinColumn(name = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDA")}) + private Corrida corrida; + @OneToOne + @JoinColumn(name = "DESTINO_ID") + private Parada destino; + @OneToOne + @JoinColumn(name = "PARADA_ID") + private Parada parada; + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public AsientoExclusivo() { + } + + public Long getAsientoexclusivoId() { + return asientoexclusivoId; + } + + public void setAsientoexclusivoId(Long asientoexclusivoId) { + this.asientoexclusivoId = asientoexclusivoId; + } + + public String getNumasiento() { + return numasiento; + } + + public void setNumasiento(String numasiento) { + this.numasiento = numasiento; + } + + public Boolean getVendible() { + return vendible; + } + + public void setVendible(Boolean vendible) { + this.vendible = vendible; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getMotivobloqueo() { + return motivobloqueo; + } + + public void setMotivobloqueo(String motivobloqueo) { + this.motivobloqueo = motivobloqueo; + } + + public Corrida getCorrida() { + return corrida; + } + + public void setCorrida(Corrida corrida) { + this.corrida = corrida; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (asientoexclusivoId != null ? asientoexclusivoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof AsientoExclusivo)) { + return false; + } + AsientoExclusivo other = (AsientoExclusivo) object; + if ((this.asientoexclusivoId == null && other.asientoexclusivoId != null) || (this.asientoexclusivoId != null && !this.asientoexclusivoId.equals(other.asientoexclusivoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.AsientoExclusivo[asientoexclusivoId=" + asientoexclusivoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Autobus.java b/src/com/rjconsultores/ventaboletos/entidad/Autobus.java new file mode 100644 index 000000000..fdc83c879 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Autobus.java @@ -0,0 +1,152 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "AUTOBUS_SEQ", sequenceName = "AUTOBUS_SEQ", allocationSize = 1) +@Table(name = "AUTOBUS") +public class Autobus implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "AUTOBUS_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "AUTOBUS_SEQ") + private Integer autobusId; + @Column(name = "NUMAUTOBUS") + private String numautobus; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "DIAGRAMAAUTOBUS_ID", referencedColumnName = "DIAGRAMAAUTOBUS_ID") + @ManyToOne + private DiagramaAutobus diagramaAutobus; + @JoinColumn(name = "DIAGRAMAAUTOBUS2_ID", referencedColumnName = "DIAGRAMAAUTOBUS_ID") + @ManyToOne + private DiagramaAutobus diagramaAutobusPiso; + @OneToMany(mappedBy = "autobus") + private List corridaList; + + public Autobus() { + } + + public Autobus(Integer autobusId) { + this.autobusId = autobusId; + } + + public Integer getAutobusId() { + return autobusId; + } + + public void setAutobusId(Integer autobusId) { + this.autobusId = autobusId; + } + + public String getNumautobus() { + return numautobus; + } + + public void setNumautobus(String numautobus) { + this.numautobus = numautobus; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public DiagramaAutobus getDiagramaAutobus() { + return diagramaAutobus; + } + + public void setDiagramaAutobus(DiagramaAutobus diagramaAutobus) { + this.diagramaAutobus = diagramaAutobus; + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public DiagramaAutobus getDiagramaAutobusPiso() { + return diagramaAutobusPiso; + } + + public void setDiagramaAutobusPiso(DiagramaAutobus diagramaAutobusPiso) { + this.diagramaAutobusPiso = diagramaAutobusPiso; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (autobusId != null ? autobusId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Autobus)) { + return false; + } + Autobus other = (Autobus) object; + if ((this.autobusId == null && other.autobusId != null) || (this.autobusId != null && !this.autobusId.equals(other.autobusId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNumautobus(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Autorizacion.java b/src/com/rjconsultores/ventaboletos/entidad/Autorizacion.java new file mode 100644 index 000000000..26f7d7313 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Autorizacion.java @@ -0,0 +1,126 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "AUTORIZACION_SEQ", sequenceName = "AUTORIZACION_SEQ", allocationSize = 1) +@Table(name = "AUTORIZACION") +public class Autorizacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "AUTORIZACION_SEQ") + @Column(name = "AUTORIZACION_ID") + private Integer autorizacionId; + @Column(name = "NOMBAUTORIZACION") + private String nombautorizacion; + @Column(name = "DESCAUTORIZACION") + private String descautorizacion; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Autorizacion() { + } + + public Autorizacion(Integer autorizacionId) { + this.autorizacionId = autorizacionId; + } + + public Integer getAutorizacionId() { + return autorizacionId; + } + + public void setAutorizacionId(Integer autorizacionId) { + this.autorizacionId = autorizacionId; + } + + public String getNombautorizacion() { + return nombautorizacion; + } + + public void setNombautorizacion(String nombautorizacion) { + this.nombautorizacion = nombautorizacion; + } + + public String getDescautorizacion() { + return descautorizacion; + } + + public void setDescautorizacion(String descautorizacion) { + this.descautorizacion = descautorizacion; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (autorizacionId != null ? autorizacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Autorizacion)) { + return false; + } + Autorizacion other = (Autorizacion) object; + if ((this.autorizacionId == null && other.autorizacionId != null) || (this.autorizacionId != null && !this.autorizacionId.equals(other.autorizacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNombautorizacion(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/AutorizacionPerfil.java b/src/com/rjconsultores/ventaboletos/entidad/AutorizacionPerfil.java new file mode 100644 index 000000000..fc5b966f6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/AutorizacionPerfil.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "AUTORIZACION_PERFIL_SEQ", sequenceName = "AUTORIZACION_PERFIL_SEQ", allocationSize = 1) +@Table(name = "AUTORIZACION_PERFIL") +public class AutorizacionPerfil implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "AUTORIZACION_PERFIL_SEQ") + @Column(name = "AUTORIZACIONPERFIL_ID") + private Integer autorizacionperfilId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "AUTORIZACION_ID") + private Autorizacion autorizacion; + @OneToOne + @JoinColumn(name = "PERFIL_ID") + private Perfil perfil; + + public AutorizacionPerfil() { + } + + public AutorizacionPerfil(Integer autorizacionperfilId) { + this.autorizacionperfilId = autorizacionperfilId; + } + + public Integer getAutorizacionperfilId() { + return autorizacionperfilId; + } + + public void setAutorizacionperfilId(Integer autorizacionperfilId) { + this.autorizacionperfilId = autorizacionperfilId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Autorizacion getAutorizacion() { + return autorizacion; + } + + public void setAutorizacion(Autorizacion autorizacion) { + this.autorizacion = autorizacion; + } + + public Perfil getPerfil() { + return perfil; + } + + public void setPerfil(Perfil perfil) { + this.perfil = perfil; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (autorizacionperfilId != null ? autorizacionperfilId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof AutorizacionPerfil)) { + return false; + } + AutorizacionPerfil other = (AutorizacionPerfil) object; + if ((this.autorizacionperfilId == null && other.autorizacionperfilId != null) || (this.autorizacionperfilId != null && !this.autorizacionperfilId.equals(other.autorizacionperfilId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil[autorizacionperfilId=" + autorizacionperfilId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Banco.java b/src/com/rjconsultores/ventaboletos/entidad/Banco.java new file mode 100644 index 000000000..1b6c7774f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Banco.java @@ -0,0 +1,174 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "BANCO") +@SequenceGenerator(name = "BANCO_SEQ", sequenceName = "BANCO_SEQ", allocationSize = 1) +public class Banco implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "BANCO_SEQ") + @Column(name = "BANCO_ID") + private Integer bancoId; + @Column(name = "REFCONTRATO") + private String refcontrato; + @Column(name = "NOMBBANCO") + private String nombbanco; + @Column(name = "NUMCUENTA") + private BigDecimal numcuenta; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + + public Banco() { + } + + public Banco(Integer bancoId) { + this.bancoId = bancoId; + } + + public Integer getBancoId() { + return bancoId; + } + + public void setBancoId(Integer bancoId) { + this.bancoId = bancoId; + } + + public String getRefcontrato() { + return refcontrato; + } + + public void setRefcontrato(String refcontrato) { + this.refcontrato = refcontrato; + } + + public String getNombbanco() { + return nombbanco; + } + + public void setNombbanco(String nombbanco) { + this.nombbanco = nombbanco; + } + + public BigDecimal getNumcuenta() { + return numcuenta; + } + + public void setNumcuenta(BigDecimal numcuenta) { + this.numcuenta = numcuenta; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (bancoId != null ? bancoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Banco)) { + return false; + } + Banco other = (Banco) object; + if ((this.bancoId == null && other.bancoId != null) || (this.bancoId != null && !this.bancoId.equals(other.bancoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Banco[bancoId=" + bancoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CancelacionCargo.java b/src/com/rjconsultores/ventaboletos/entidad/CancelacionCargo.java new file mode 100644 index 000000000..388da6aa8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CancelacionCargo.java @@ -0,0 +1,160 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "CANCELACION_CARGO_SEQ", sequenceName = "CANCELACION_CARGO_SEQ", allocationSize = 1) +@Table(name = "CANCELACION_CARGO") +public class CancelacionCargo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CANCELACION_CARGO_SEQ") + @Column(name = "CANCELACIONCARGO_ID") + private Integer cancelacioncargoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "PORCCARGO") + private BigDecimal porccargo; + @Column(name = "IMPORTECARGO") + private BigDecimal importecargo; + @Column(name = "TIEMPOMINIMO") + private BigDecimal tiempominimo; + @Column(name = "TIEMPOMAXIMO") + private BigDecimal tiempomaximo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CANCELACIONCTRL_ID", referencedColumnName = "CANCELACIONCTRL_ID") + @ManyToOne + private CancelacionCtrl cancelacionCtrl; + + public CancelacionCargo() { + } + + public CancelacionCargo(Integer cancelacioncargoId) { + this.cancelacioncargoId = cancelacioncargoId; + } + + public Integer getCancelacioncargoId() { + return cancelacioncargoId; + } + + public void setCancelacioncargoId(Integer cancelacioncargoId) { + this.cancelacioncargoId = cancelacioncargoId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public BigDecimal getPorccargo() { + return porccargo; + } + + public void setPorccargo(BigDecimal porccargo) { + this.porccargo = porccargo; + } + + public BigDecimal getImportecargo() { + return importecargo; + } + + public void setImportecargo(BigDecimal importecargo) { + this.importecargo = importecargo; + } + + public BigDecimal getTiempomaximo() { + return tiempomaximo; + } + + public void setTiempomaximo(BigDecimal tiempomaximo) { + this.tiempomaximo = tiempomaximo; + } + + public BigDecimal getTiempominimo() { + return tiempominimo; + } + + public void setTiempominimo(BigDecimal tiempominimo) { + this.tiempominimo = tiempominimo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public CancelacionCtrl getCancelacionCtrl() { + return cancelacionCtrl; + } + + public void setCancelacionCtrl(CancelacionCtrl cancelacionCtrl) { + this.cancelacionCtrl = cancelacionCtrl; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cancelacioncargoId != null ? cancelacioncargoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CancelacionCargo)) { + return false; + } + CancelacionCargo other = (CancelacionCargo) object; + if ((this.cancelacioncargoId == null && other.cancelacioncargoId != null) || (this.cancelacioncargoId != null && !this.cancelacioncargoId.equals(other.cancelacioncargoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.dao.CancelacionCargo[cancelacioncargoId=" + cancelacioncargoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CancelacionCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/CancelacionCtrl.java new file mode 100644 index 000000000..9b736b667 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CancelacionCtrl.java @@ -0,0 +1,197 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "CANCELACION_CTRL_SEQ", sequenceName = "CANCELACION_CTRL_SEQ", allocationSize = 1) +@Table(name = "CANCELACION_CTRL") +public class CancelacionCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CANCELACION_CTRL_SEQ") + @Column(name = "CANCELACIONCTRL_ID") + private Integer cancelacionctrlId; + @Column(name = "TIEMPOPREVSALIDA") + @Temporal(TemporalType.TIME) + private Date tiempoprevsalida; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada paradaOrigem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada paradaDestino; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @ManyToOne + @JoinColumn(name = "MOTIVOCANCELACION_ID", referencedColumnName = "MOTIVOCANCELACION_ID") + private MotivoCancelacion motivoCancelacion; + @OneToMany(mappedBy = "cancelacionCtrl", cascade = CascadeType.ALL) + private List cancelacionCargoList; + + public CancelacionCtrl() { + } + + public CancelacionCtrl(Integer cancelacionctrlId) { + this.cancelacionctrlId = cancelacionctrlId; + } + + public Integer getCancelacionctrlId() { + return cancelacionctrlId; + } + + public void setCancelacionctrlId(Integer cancelacionctrlId) { + this.cancelacionctrlId = cancelacionctrlId; + } + + public Date getTiempoprevsalida() { + return tiempoprevsalida; + } + + public void setTiempoprevsalida(Date tiempoprevsalida) { + this.tiempoprevsalida = tiempoprevsalida; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public Parada getParadaDestino() { + return paradaDestino; + } + + public void setParadaDestino(Parada paradaDestino) { + this.paradaDestino = paradaDestino; + } + + public Parada getParadaOrigem() { + return paradaOrigem; + } + + public void setParadaOrigem(Parada paradaOrigem) { + this.paradaOrigem = paradaOrigem; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public MotivoCancelacion getMotivoCancelacion() { + return motivoCancelacion; + } + + public void setMotivoCancelacion(MotivoCancelacion motivoCancelacion) { + this.motivoCancelacion = motivoCancelacion; + } + + public List getCancelacionCargoList() { + List tmp = new ArrayList(); + if (cancelacionCargoList != null) { + for (CancelacionCargo cc : this.cancelacionCargoList) { + if (cc.getActivo()) { + tmp.add(cc); + } + } + } + + return tmp; + } + + public void setCancelacionCargoList(List cancelacionCargoList) { + this.cancelacionCargoList = cancelacionCargoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cancelacionctrlId != null ? cancelacionctrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CancelacionCtrl)) { + return false; + } + CancelacionCtrl other = (CancelacionCtrl) object; + if ((this.cancelacionctrlId == null && other.cancelacionctrlId != null) || (this.cancelacionctrlId != null && !this.cancelacionctrlId.equals(other.cancelacionctrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CancelacionCtrl[cancelacionctrlId=" + cancelacionctrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Categoria.java b/src/com/rjconsultores/ventaboletos/entidad/Categoria.java new file mode 100644 index 000000000..79b207c9e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Categoria.java @@ -0,0 +1,159 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_SEQ", sequenceName = "CATEGORIA_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA") +public class Categoria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_SEQ") + @Column(name = "CATEGORIA_ID") + private Integer categoriaId; + @Column(name = "DESCCATEGORIA") + private String desccategoria; + @Column(name = "ACTIVO") + private Boolean activo; + //CAmpos retirados +// @Column(name = "INDVENDEINTERNET") +// private Boolean vendeInternet; +// @Column(name = "INDVENDEAGENCIAWEB") +// private Boolean vendeAgenciaWeb; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL) + private List categoriaDescuentoList; + @OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL) + private List reservacionCategoriaList; + + public Categoria() { + } + + public Categoria(Integer categoriaId) { + this.categoriaId = categoriaId; + } + + public Integer getCategoriaId() { + return categoriaId; + } + + public void setCategoriaId(Integer categoriaId) { + this.categoriaId = categoriaId; + } + + public String getDesccategoria() { + return desccategoria; + } + + public void setDesccategoria(String desccategoria) { + this.desccategoria = desccategoria; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCategoriaDescuentoList() { + //return categoriaDescuentoList; + List rcList = new ArrayList(); + for (CategoriaDescuento rc : this.categoriaDescuentoList) { + if (rc.getActivo() == Boolean.TRUE) { + rcList.add(rc); + } + } + return rcList; + } + + public void setCategoriaDescuentoList(List categoriaDescuentoList) { + this.categoriaDescuentoList = categoriaDescuentoList; + } + + public List getReservacionCategoriaList() { + //return reservacionCategoriaList; + List rcList = new ArrayList(); + for (ReservacionCategoria rc : this.reservacionCategoriaList) { + if (rc.getActivo() == Boolean.TRUE) { + rcList.add(rc); + } + } + return rcList; + } + + public void setReservacionCategoriaList(List reservacionCategoriaList) { + this.reservacionCategoriaList = reservacionCategoriaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (categoriaId != null ? categoriaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Categoria)) { + return false; + } + Categoria other = (Categoria) object; + if ((this.categoriaId == null && other.categoriaId != null) || (this.categoriaId != null && !this.categoriaId.equals(other.categoriaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDesccategoria(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaClase.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaClase.java new file mode 100644 index 000000000..903cfa681 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaClase.java @@ -0,0 +1,135 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_CLASE_SEQ", sequenceName = "CATEGORIA_CLASE_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_CLASE") +public class CategoriaClase implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_CLASE_SEQ") + @Column(name = "CATEGORIACLASE_ID") + private Integer categoriaclaseId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") + @ManyToOne + private CategoriaCtrl categoriaCtrl; + + public CategoriaClase() { + } + + public CategoriaClase(Integer categoriaclaseId) { + this.categoriaclaseId = categoriaclaseId; + } + + public Integer getCategoriaclaseId() { + return categoriaclaseId; + } + + public void setCategoriaclaseId(Integer categoriaclaseId) { + this.categoriaclaseId = categoriaclaseId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaClase other = (CategoriaClase) obj; + if (this.claseServicio != other.claseServicio && (this.claseServicio == null || !this.claseServicio.equals(other.claseServicio))) { + return false; + } + if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + (this.claseServicio != null ? this.claseServicio.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaClase[categoriaclaseId=" + categoriaclaseId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCorrida.java new file mode 100644 index 000000000..cfcf36d34 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCorrida.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_CORRIDA_SEQ", sequenceName = "CATEGORIA_CORRIDA_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_CORRIDA") +public class CategoriaCorrida implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_CORRIDA_SEQ") + @Column(name = "CATEGORIA_CORRIDA") + private Integer categoriaCorrida; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID") + @ManyToOne + private CorridaCtrl corridaCtrl; + @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") + @ManyToOne + private CategoriaCtrl categoriaCtrl; + + public CategoriaCorrida() { + } + + public CategoriaCorrida(Integer categoriaCorrida) { + this.categoriaCorrida = categoriaCorrida; + } + + public Integer getCategoriaCorrida() { + return categoriaCorrida; + } + + public void setCategoriaCorrida(Integer categoriaCorrida) { + this.categoriaCorrida = categoriaCorrida; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public CorridaCtrl getCorridaCtrl() { + return corridaCtrl; + } + + public void setCorridaCtrl(CorridaCtrl corridaCtrl) { + this.corridaCtrl = corridaCtrl; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaCorrida other = (CategoriaCorrida) obj; + if (this.corridaCtrl != other.corridaCtrl && (this.corridaCtrl == null || !this.corridaCtrl.equals(other.corridaCtrl))) { + return false; + } + if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 97 * hash + (this.corridaCtrl != null ? this.corridaCtrl.hashCode() : 0); + hash = 97 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaCorrida[categoriaCorrida=" + categoriaCorrida + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java new file mode 100644 index 000000000..8e5076c92 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java @@ -0,0 +1,257 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_CTRL_SEQ", sequenceName = "CATEGORIA_CTRL_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_CTRL") +public class CategoriaCtrl implements Serializable { + + public final static Integer[] idsCategoriasNoVisible = {1}; + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_CTRL_SEQ") + @Column(name = "CATEGORIACTRL_ID") + private Integer categoriactrlId; + @JoinColumn(name = "EMPRESA_ID") + @OneToOne + private Empresa empresa; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL) + private List categoriaDescuentoList; + @OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL) + private List categoriaClaseList; + @OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL) + private List categoriaMarcaList; + @OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL) + private List categoriaCorridaList; + @OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL) + private List categoriaMercadoList; + + public CategoriaCtrl() { + } + + public CategoriaCtrl(Integer categoriactrlId) { + this.categoriactrlId = categoriactrlId; + } + + public CategoriaCtrl(Integer categoriactrlId, Date fecmodif) { + this.categoriactrlId = categoriactrlId; + this.fecmodif = fecmodif; + } + + public Integer getCategoriactrlId() { + return categoriactrlId; + } + + public void setCategoriactrlId(Integer categoriactrlId) { + this.categoriactrlId = categoriactrlId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + /** + * Regresa las categorias que son visibles al usuario. + * Ejemplo de categoria que no es visible: ADULTO - Id = 1 + * @return + */ + public List getCategoriaDescuentoVisiblesList() { + List listCategoriasVisibles = new ArrayList(); + List lsCategorias = getCategoriaDescuentoList(); + + for (CategoriaDescuento cd : lsCategorias) { + boolean esVisible = true; + for (Integer id : idsCategoriasNoVisible) { + if(cd.getCategoria()!=null){ + if (id.equals(cd.getCategoria().getCategoriaId())) { + esVisible = false; + } + } + } + + if (esVisible) { + listCategoriasVisibles.add(cd); + } + } + + return listCategoriasVisibles; + } + + public List getCategoriaDescuentoList() { + //return categoriaDescuentoList; + + List tmp = new ArrayList(); + if (categoriaDescuentoList != null) { + for (CategoriaDescuento cm : this.categoriaDescuentoList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaDescuentoList(List categoriaDescuentoList) { + this.categoriaDescuentoList = categoriaDescuentoList; + } + + public List getCategoriaClaseList() { + //return categoriaClaseList; + List tmp = new ArrayList(); + if (categoriaClaseList != null) { + for (CategoriaClase cm : this.categoriaClaseList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaClaseList(List categoriaClaseList) { + this.categoriaClaseList = categoriaClaseList; + } + + public List getCategoriaMarcaList() { + //return categoriaMarcaList; + List tmp = new ArrayList(); + if (categoriaMercadoList != null) { + for (CategoriaMarca cm : this.categoriaMarcaList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaMarcaList(List categoriaMarcaList) { + this.categoriaMarcaList = categoriaMarcaList; + } + + public List getCategoriaCorridaList() { + //return categoriaCorridaList; + List tmp = new ArrayList(); + if (categoriaCorridaList != null) { + for (CategoriaCorrida cm : this.categoriaCorridaList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaCorridaList(List categoriaCorridaList) { + this.categoriaCorridaList = categoriaCorridaList; + } + + public List getCategoriaMercadoList() { + List tmp = new ArrayList(); + if (categoriaMercadoList != null) { + for (CategoriaMercado cm : this.categoriaMercadoList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaMercadoList(List categoriaMercadoList) { + this.categoriaMercadoList = categoriaMercadoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (categoriactrlId != null ? categoriactrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CategoriaCtrl)) { + return false; + } + CategoriaCtrl other = (CategoriaCtrl) object; + if ((this.categoriactrlId == null && other.categoriactrlId != null) || (this.categoriactrlId != null && !this.categoriactrlId.equals(other.categoriactrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaCtrl[categoriactrlId=" + categoriactrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java new file mode 100644 index 000000000..3c3eeec0a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java @@ -0,0 +1,196 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_DESCUENTO_SEQ", sequenceName = "CATEGORIA_DESCUENTO_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_DESCUENTO") +public class CategoriaDescuento implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_DESCUENTO_SEQ") + @Column(name = "CATEGORIADESCUENTO_ID") + private Integer categoriadescuentoId; + @Column(name = "CANTAUTORIZADA") + private Integer cantautorizada; + @Column(name = "DESCUENTOPORC") + private BigDecimal descuentoporc; + @Column(name = "DESCUENTOIMPORTE") + private BigDecimal descuentoimporte; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") + @ManyToOne(cascade = CascadeType.ALL) + private CategoriaCtrl categoriaCtrl; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + @OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL) + private List categoriaPeriodoList; + + public CategoriaDescuento() { + } + + public CategoriaDescuento(Integer categoriadescuentoId) { + this.categoriadescuentoId = categoriadescuentoId; + } + + public CategoriaDescuento(Integer categoriadescuentoId, Date fecmodif) { + this.categoriadescuentoId = categoriadescuentoId; + this.fecmodif = fecmodif; + } + + public Integer getCategoriadescuentoId() { + return categoriadescuentoId; + } + + public void setCategoriadescuentoId(Integer categoriadescuentoId) { + this.categoriadescuentoId = categoriadescuentoId; + } + + public Integer getCantautorizada() { + return cantautorizada; + } + + public void setCantautorizada(Integer cantautorizada) { + this.cantautorizada = cantautorizada; + } + + public BigDecimal getDescuentoporc() { + return descuentoporc; + } + + public void setDescuentoporc(BigDecimal descuentoporc) { + this.descuentoporc = descuentoporc; + } + + public BigDecimal getDescuentoimporte() { + return descuentoimporte; + } + + public void setDescuentoimporte(BigDecimal descuentoimporte) { + this.descuentoimporte = descuentoimporte; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + public List getCategoriaPeriodoList() { + List tmp = new ArrayList(); + if (categoriaPeriodoList != null) { + for (CategoriaPeriodo cp : this.categoriaPeriodoList) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setCategoriaPeriodoList(List categoriaPeriodoList) { + this.categoriaPeriodoList = categoriaPeriodoList; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaDescuento other = (CategoriaDescuento) obj; + if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) { + return false; + } + if (this.categoria != other.categoria && (this.categoria == null || !this.categoria.equals(other.categoria))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 53 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0); + hash = 53 * hash + (this.categoria != null ? this.categoria.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaDescuento[categoriadescuentoId=" + categoriadescuentoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaMarca.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaMarca.java new file mode 100644 index 000000000..c56c1c4e4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaMarca.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_MARCA_SEQ", sequenceName = "CATEGORIA_MARCA_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_MARCA") +public class CategoriaMarca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_MARCA_SEQ") + @Column(name = "CATEGORIAMARCA_ID") + private Integer categoriamarcaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") + @ManyToOne + private CategoriaCtrl categoriaCtrl; + + public CategoriaMarca() { + } + + public CategoriaMarca(Integer categoriamarcaId) { + this.categoriamarcaId = categoriamarcaId; + } + + public Integer getCategoriamarcaId() { + return categoriamarcaId; + } + + public void setCategoriamarcaId(Integer categoriamarcaId) { + this.categoriamarcaId = categoriamarcaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaMarca other = (CategoriaMarca) obj; + if (this.marca != other.marca && (this.marca == null || !this.marca.equals(other.marca))) { + return false; + } + if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + (this.marca != null ? this.marca.hashCode() : 0); + hash = 97 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaMarca[categoriamarcaId=" + categoriamarcaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaMercado.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaMercado.java new file mode 100644 index 000000000..93d186f21 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaMercado.java @@ -0,0 +1,147 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_MERCADO_SEQ", sequenceName = "CATEGORIA_MERCADO_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_MERCADO") +public class CategoriaMercado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_MERCADO_SEQ") + @Column(name = "CATEGORIAMERCADO_ID") + private Integer categoriamercadoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") + @ManyToOne + private CategoriaCtrl categoriaCtrl; + + public CategoriaMercado() { + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + public Integer getCategoriamercadoId() { + return categoriamercadoId; + } + + public void setCategoriamercadoId(Integer categoriamercadoId) { + this.categoriamercadoId = categoriamercadoId; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaMercado other = (CategoriaMercado) obj; + if (this.destino != other.destino && (this.destino == null || !this.destino.equals(other.destino))) { + return false; + } + if (this.origem != other.origem && (this.origem == null || !this.origem.equals(other.origem))) { + return false; + } + if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 11 * hash + (this.destino != null ? this.destino.hashCode() : 0); + hash = 11 * hash + (this.origem != null ? this.origem.hashCode() : 0); + hash = 11 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaMercado[categoriamercadoId=" + categoriamercadoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaPeriodo.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaPeriodo.java new file mode 100644 index 000000000..0fe015d8c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaPeriodo.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_PERIODO_SEQ", sequenceName = "CATEGORIA_PERIODO_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_PERIODO") +public class CategoriaPeriodo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_PERIODO_SEQ") + @Column(name = "CATEGORIAPERIODO_ID") + private Integer categoriaperiodoId; + @Column(name = "FECINICIO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicio; + @Column(name = "FECFIN") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfin; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CATEGORIADESCUENTO_ID", referencedColumnName = "CATEGORIADESCUENTO_ID") + @ManyToOne + private CategoriaDescuento categoriaDescuento; + + public CategoriaPeriodo() { + } + + public CategoriaPeriodo(Integer categoriaperiodoId) { + this.categoriaperiodoId = categoriaperiodoId; + } + + public CategoriaPeriodo(Integer categoriaperiodoId, Date fecmodif) { + this.categoriaperiodoId = categoriaperiodoId; + this.fecmodif = fecmodif; + } + + public Integer getCategoriaperiodoId() { + return categoriaperiodoId; + } + + public void setCategoriaperiodoId(Integer categoriaperiodoId) { + this.categoriaperiodoId = categoriaperiodoId; + } + + public Date getFecinicio() { + return fecinicio; + } + + public void setFecinicio(Date fecinicio) { + this.fecinicio = fecinicio; + } + + public Date getFecfin() { + return fecfin; + } + + public void setFecfin(Date fecfin) { + this.fecfin = fecfin; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public CategoriaDescuento getCategoriaDescuento() { + return categoriaDescuento; + } + + public void setCategoriaDescuento(CategoriaDescuento categoriaDescuento) { + this.categoriaDescuento = categoriaDescuento; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaPeriodo other = (CategoriaPeriodo) obj; + if (this.fecinicio != other.fecinicio && (this.fecinicio == null || !this.fecinicio.equals(other.fecinicio))) { + return false; + } + if (this.fecfin != other.fecfin && (this.fecfin == null || !this.fecfin.equals(other.fecfin))) { + return false; + } + if (this.categoriaDescuento != other.categoriaDescuento && (this.categoriaDescuento == null || !this.categoriaDescuento.equals(other.categoriaDescuento))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 19 * hash + (this.fecinicio != null ? this.fecinicio.hashCode() : 0); + hash = 19 * hash + (this.fecfin != null ? this.fecfin.hashCode() : 0); + hash = 19 * hash + (this.categoriaDescuento != null ? this.categoriaDescuento.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo[categoriaperiodoId=" + categoriaperiodoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaTipoPtoVta.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaTipoPtoVta.java new file mode 100644 index 000000000..62887adad --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaTipoPtoVta.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "CATEGORIA_TIPOPTOVTA_SEQ", sequenceName = "CATEGORIA_TIPOPTOVTA_SEQ", allocationSize = 1) +@Table(name = "CATEGORIA_TIPOPTOVTA") +public class CategoriaTipoPtoVta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_TIPOPTOVTA_SEQ") + @Column(name = "CATEGORIATIPOPTOVTA_ID") + private Integer categoriatipoptovtaId; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private int usuarioId; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPuntoVenta; + + public CategoriaTipoPtoVta() { + } + + public CategoriaTipoPtoVta(Integer categoriatipoptovtaId) { + this.categoriatipoptovtaId = categoriatipoptovtaId; + } + + public CategoriaTipoPtoVta(Integer categoriatipoptovtaId, Boolean activo, Date fecmodif, int usuarioId) { + this.categoriatipoptovtaId = categoriatipoptovtaId; + this.activo = activo; + this.fecmodif = fecmodif; + this.usuarioId = usuarioId; + } + + public Integer getCategoriatipoptovtaId() { + return categoriatipoptovtaId; + } + + public void setCategoriatipoptovtaId(Integer categoriatipoptovtaId) { + this.categoriatipoptovtaId = categoriatipoptovtaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public int getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(int usuarioId) { + this.usuarioId = usuarioId; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + public TipoPuntoVenta getTipoPuntoVenta() { + return tipoPuntoVenta; + } + + public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + this.tipoPuntoVenta = tipoPuntoVenta; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CategoriaTipoPtoVta other = (CategoriaTipoPtoVta) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.categoria != other.categoria && (this.categoria == null || !this.categoria.equals(other.categoria))) { + return false; + } + if (this.tipoPuntoVenta != other.tipoPuntoVenta && (this.tipoPuntoVenta == null || !this.tipoPuntoVenta.equals(other.tipoPuntoVenta))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 61 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 61 * hash + (this.categoria != null ? this.categoria.hashCode() : 0); + hash = 61 * hash + (this.tipoPuntoVenta != null ? this.tipoPuntoVenta.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CategoriaTipoptovta[categoriatipoptovtaId=" + categoriatipoptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Ciudad.java b/src/com/rjconsultores/ventaboletos/entidad/Ciudad.java new file mode 100644 index 000000000..91f3a846a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Ciudad.java @@ -0,0 +1,181 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "CIUDAD_SEQ", sequenceName = "CIUDAD_SEQ", allocationSize = 1) +@Table(name = "CIUDAD") +public class Ciudad implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CIUDAD_SEQ") + @Column(name = "CIUDAD_ID") + private Integer ciudadId; + @Column(name = "NOMBCIUDAD") + private String nombciudad; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "ESTADO_ID", referencedColumnName = "ESTADO_ID") + @ManyToOne + private Estado estado; + @OneToOne + @JoinColumn(name = "PLAZA_ID") + private Plaza plaza; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "INDZONAHORARIA") + private Integer zonaHoraria; + @OneToMany(mappedBy = "coloniaId") + private List lsColonia; + + public Ciudad() { + } + + public Ciudad(Integer ciudadId) { + this.ciudadId = ciudadId; + } + + public Integer getCiudadId() { + return ciudadId; + } + + public void setCiudadId(Integer ciudadId) { + this.ciudadId = ciudadId; + } + + public String getNombciudad() { + return nombciudad; + } + + public void setNombciudad(String nombciudad) { + this.nombciudad = nombciudad; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Estado getEstado() { + return estado; + } + + public void setEstado(Estado estado) { + this.estado = estado; + } + + public Plaza getPlaza() { + return plaza; + } + + public void setPlaza(Plaza plaza) { + this.plaza = plaza; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Integer getZonaHoraria() { + return zonaHoraria; + } + + public void setZonaHoraria(Integer zonaHoraria) { + this.zonaHoraria = zonaHoraria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (ciudadId != null ? ciudadId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Ciudad)) { + return false; + } + Ciudad other = (Ciudad) object; + if ((this.ciudadId == null && other.ciudadId != null) || (this.ciudadId != null && !this.ciudadId.equals(other.ciudadId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getNombciudad() + ", " + this.getEstado().getNombestado(); + } + + /** + * @return the lsColonia + */ + public List getLsColonia() { + return lsColonia; + } + + /** + * @param lsColonia the lsColonia to set + */ + public void setLsColonia(List lsColonia) { + this.lsColonia = lsColonia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java b/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java new file mode 100644 index 000000000..ecc3f287f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java @@ -0,0 +1,211 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CLASE_SERVICIO_SEQ", sequenceName = "CLASE_SERVICIO_SEQ", allocationSize = 1) +@Table(name = "CLASE_SERVICIO") +public class ClaseServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CLASE_SERVICIO_SEQ") + @Column(name = "CLASESERVICIO_ID") + private Short claseservicioId; + @Column(name = "DESCCLASE") + private String descclase; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "claseServicio") + private List categoriaClaseList; + @OneToMany(mappedBy = "claseServicio") + private List reservacionClaseList; + @OneToMany(mappedBy = "claseServicio") + private List tramoTiempoList; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "EQUIVALENCIAELEKTRA_ID") + private String equivalenciaElektraId; + @OneToMany(mappedBy = "claseServicio") + private List tarifaHistList; + @OneToMany(mappedBy = "claseServicio") + private List corridaList; + + public ClaseServicio() { + } + + public ClaseServicio(Short claseservicioId) { + this.claseservicioId = claseservicioId; + } + + public ClaseServicio(Short claseservicioId, Date fecmodif) { + this.claseservicioId = claseservicioId; + this.fecmodif = fecmodif; + } + + public Short getClaseservicioId() { + return claseservicioId; + } + + public void setClaseservicioId(Short claseservicioId) { + this.claseservicioId = claseservicioId; + } + + public String getDescclase() { + return descclase; + } + + public void setDescclase(String descclase) { + this.descclase = descclase; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCategoriaClaseList() { + List tmp = new ArrayList(); + if (categoriaClaseList != null) { + for (CategoriaClase cc : this.categoriaClaseList) { + if (cc.getActivo()) { + tmp.add(cc); + } + } + } + + return tmp; + } + + public void setCategoriaClaseList(List categoriaClaseList) { + this.categoriaClaseList = categoriaClaseList; + } + + public List getReservacionClaseList() { + List tmp = new ArrayList(); + for (ReservacionClase rc : this.reservacionClaseList) { + if (rc.getActivo()) { + tmp.add(rc); + } + } + + return tmp; + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public void setReservacionClaseList(List reservacionClaseList) { + this.reservacionClaseList = reservacionClaseList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (claseservicioId != null ? claseservicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ClaseServicio)) { + return false; + } + ClaseServicio other = (ClaseServicio) object; + if ((this.claseservicioId == null && other.claseservicioId != null) || (this.claseservicioId != null && !this.claseservicioId.equals(other.claseservicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescclase(); + } + + public List getTramoTiempoList() { + return tramoTiempoList; + } + + public void setTramoTiempoList(List tramoTiempoList) { + this.tramoTiempoList = tramoTiempoList; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public List getTarifaHistList() { + return tarifaHistList; + } + + public void setTarifaHistList(List tarifaHistList) { + this.tarifaHistList = tarifaHistList; + } + + public String getEquivalenciaElektraId() { + return equivalenciaElektraId; + } + + public void setEquivalenciaElektraId(String equivalenciaElektraId) { + this.equivalenciaElektraId = equivalenciaElektraId; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ClaseservicioEquivalencia.java b/src/com/rjconsultores/ventaboletos/entidad/ClaseservicioEquivalencia.java new file mode 100644 index 000000000..67c195690 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ClaseservicioEquivalencia.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CLASESERVICIO_EQUIVALENCIA_SEQ", sequenceName = "CLASESERVICIO_EQUIVALENCIA_SEQ", allocationSize = 1) +@Table(name = "CLASESERVICIO_EQUIVALENCIA") +public class ClaseservicioEquivalencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CLASESERVICIO_EQUIVALENCIA_SEQ") + @Column(name = "CLASESERVICIOEQUIVALENCIA_ID") + private Integer claseservicioequivalenciaId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + private ClaseServicio claseservicio; + @OneToOne + @JoinColumn(name = "COMISIONISTAEXTERNO_ID") + private ComisionistaExterno comisionistaExterno; + + public ClaseservicioEquivalencia() { + } + + public ClaseservicioEquivalencia(Integer claseservicioequivalenciaId) { + this.claseservicioequivalenciaId = claseservicioequivalenciaId; + } + + public Integer getClaseservicioequivalenciaId() { + return claseservicioequivalenciaId; + } + + public void setClaseservicioequivalenciaId(Integer claseservicioequivalenciaId) { + this.claseservicioequivalenciaId = claseservicioequivalenciaId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ComisionistaExterno getComisionistaExterno() { + return comisionistaExterno; + } + + public void setComisionistaExterno(ComisionistaExterno comisionistaExterno) { + this.comisionistaExterno = comisionistaExterno; + } + + public ClaseServicio getClaseservicio() { + return claseservicio; + } + + public void setClaseservicio(ClaseServicio claseservicio) { + this.claseservicio = claseservicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (claseservicioequivalenciaId != null ? claseservicioequivalenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ClaseservicioEquivalencia)) { + return false; + } + ClaseservicioEquivalencia other = (ClaseservicioEquivalencia) object; + if ((this.claseservicioequivalenciaId == null && other.claseservicioequivalenciaId != null) || (this.claseservicioequivalenciaId != null && !this.claseservicioequivalenciaId.equals(other.claseservicioequivalenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia[ claseservicioequivalenciaId=" + claseservicioequivalenciaId + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Colonia.java b/src/com/rjconsultores/ventaboletos/entidad/Colonia.java new file mode 100644 index 000000000..db03f8b60 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Colonia.java @@ -0,0 +1,149 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "COLONIA_SEQ", sequenceName = "COLONIA_SEQ", allocationSize = 1) +@Table(name = "COLONIA") +public class Colonia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "COLONIA_SEQ") + @Column(name = "COLONIA_ID") + private Integer coloniaId; + @Column(name = "DESCCOLONIA") + private String desccolonia; + @Column(name = "CODPOSTAL") + private String codpostal; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @ManyToOne + @JoinColumn(name = "CIUDAD_ID") + private Ciudad ciudad; + + public Colonia() { + } + + public Colonia(Integer coloniaId) { + this.coloniaId = coloniaId; + } + + public Integer getColoniaId() { + return coloniaId; + } + + public void setColoniaId(Integer coloniaId) { + this.coloniaId = coloniaId; + } + + public String getDesccolonia() { + return desccolonia; + } + + public void setDesccolonia(String desccolonia) { + this.desccolonia = desccolonia; + } + + public String getCodpostal() { + return codpostal; + } + + public void setCodpostal(String codpostal) { + this.codpostal = codpostal; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ciudad getCiudad() { + return ciudad; + } + + public void setCiudad(Ciudad ciudad) { + this.ciudad = ciudad; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (coloniaId != null ? coloniaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Colonia)) { + return false; + } + Colonia other = (Colonia) object; + if ((this.coloniaId == null && other.coloniaId != null) || (this.coloniaId != null && !this.coloniaId.equals(other.coloniaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.desccolonia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ComisionistaExterno.java b/src/com/rjconsultores/ventaboletos/entidad/ComisionistaExterno.java new file mode 100644 index 000000000..501ab7e7b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ComisionistaExterno.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "COMISIONISTA_EXTERNO_SEQ", sequenceName = "COMISIONISTA_EXTERNO_SEQ", allocationSize = 1) +@Table(name = "COMISIONISTA_EXTERNO") +public class ComisionistaExterno implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "COMISIONISTA_EXTERNO_SEQ") + @Basic(optional = false) + @Column(name = "COMISIONISTAEXTERNO_ID") + private Short comisionistaexternoId; + @Column(name = "DESCCOMISIONISTA") + private String desccomisionista; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public ComisionistaExterno() { + } + + public ComisionistaExterno(Short comisionistaexternoId) { + this.comisionistaexternoId = comisionistaexternoId; + } + + public Short getComisionistaexternoId() { + return comisionistaexternoId; + } + + public void setComisionistaexternoId(Short comisionistaexternoId) { + this.comisionistaexternoId = comisionistaexternoId; + } + + public String getDesccomisionista() { + return desccomisionista; + } + + public void setDesccomisionista(String desccomisionista) { + this.desccomisionista = desccomisionista; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (comisionistaexternoId != null ? comisionistaexternoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ComisionistaExterno)) { + return false; + } + ComisionistaExterno other = (ComisionistaExterno) object; + if ((this.comisionistaexternoId == null && other.comisionistaexternoId != null) || (this.comisionistaexternoId != null && !this.comisionistaexternoId.equals(other.comisionistaexternoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDesccomisionista(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CompaniaBancaria.java b/src/com/rjconsultores/ventaboletos/entidad/CompaniaBancaria.java new file mode 100644 index 000000000..0907f958a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CompaniaBancaria.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "COMPANIA_BANCARIA_SEQ", sequenceName = "COMPANIA_BANCARIA_SEQ", allocationSize = 1) +@Table(name = "COMPANIA_BANCARIA") +public class CompaniaBancaria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "COMPANIABANCARIA_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "COMPANIA_BANCARIA_SEQ") + private Integer companiabancariaId; + @Column(name = "CVECOMPANIA") + private String cvecompania; + @Column(name = "CVESUCURSAL") + private String cvesucursal; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "companiaBancaria") + private List merchantBancarioList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "companiaBancaria") + private List usuarioBancarioList; + + + + public CompaniaBancaria() { + } + + public CompaniaBancaria(Integer companiabancariaId) { + this.companiabancariaId = companiabancariaId; + } + + public CompaniaBancaria(Integer companiabancariaId, Boolean activo) { + this.companiabancariaId = companiabancariaId; + this.activo = activo; + } + + public Integer getCompaniabancariaId() { + return companiabancariaId; + } + + public void setCompaniabancariaId(Integer companiabancariaId) { + this.companiabancariaId = companiabancariaId; + } + + public String getCvecompania() { + return cvecompania; + } + + public void setCvecompania(String cvecompania) { + this.cvecompania = cvecompania; + } + + public String getCvesucursal() { + return cvesucursal; + } + + public void setCvesucursal(String cvesucursal) { + this.cvesucursal = cvesucursal; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public List getMerchantBancarioList() { + List tmp = new ArrayList(); + if (merchantBancarioList != null) { + for (MerchantBancario ddab : this.merchantBancarioList) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.merchantBancarioList = tmp; + + return tmp; + } + + public void setMerchantBancarioList(List merchantBancarioList) { + this.merchantBancarioList = merchantBancarioList; + } + + public List getUsuarioBancarioList() { + List tmp = new ArrayList(); + if (usuarioBancarioList != null) { + for (UsuarioBancario ddab : this.usuarioBancarioList) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.usuarioBancarioList = tmp; + + return tmp; + } + + public void setUsuarioBancarioList(List usuarioBancarioList) { + this.usuarioBancarioList = usuarioBancarioList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (companiabancariaId != null ? companiabancariaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CompaniaBancaria)) { + return false; + } + CompaniaBancaria other = (CompaniaBancaria) object; + if ((this.companiabancariaId == null && other.companiabancariaId != null) || (this.companiabancariaId != null && !this.companiabancariaId.equals(other.companiabancariaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CompaniaBancaria[companiabancariaId=" + companiabancariaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Conductor.java b/src/com/rjconsultores/ventaboletos/entidad/Conductor.java new file mode 100644 index 000000000..985124b5e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Conductor.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CONDUCTOR_SEQ", sequenceName = "CONDUCTOR_SEQ", allocationSize = 1) +@Table(name = "CONDUCTOR") +public class Conductor implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "CONDUCTOR_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONDUCTOR_SEQ") + private Integer conductorId; + @Column(name = "NOMBCONDUCTOR") + private String nombconductor; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "conductor") + private List corridaList; + @OneToMany(mappedBy = "conductor1") + private List corridaList1; + @OneToOne + @JoinColumn(name = "EMPLEADO_ID") + private Empleado empleado; + @Column(name = "NOMBPATERNO") + private String nomPaterno; + + public String getNomPaterno() { + return nomPaterno; + } + + public void setNomPaterno(String nomPaterno) { + this.nomPaterno = nomPaterno; + } + + public Empleado getEmpleado() { + return empleado; + } + + public void setEmpleado(Empleado empleado) { + this.empleado = empleado; + } + + public Conductor() { + } + + public Conductor(Integer conductorId) { + this.conductorId = conductorId; + } + + public Integer getConductorId() { + return conductorId; + } + + public void setConductorId(Integer conductorId) { + this.conductorId = conductorId; + } + + public String getNombconductor() { + return nombconductor; + } + + public void setNombconductor(String nombconductor) { + this.nombconductor = nombconductor; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public List getCorridaList1() { + return corridaList1; + } + + public void setCorridaList1(List corridaList1) { + this.corridaList1 = corridaList1; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (conductorId != null ? conductorId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Conductor)) { + return false; + } + Conductor other = (Conductor) object; + if ((this.conductorId == null && other.conductorId != null) || (this.conductorId != null && !this.conductorId.equals(other.conductorId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return (this.getEmpleado() != null ? this.getEmpleado().getCveEmpleado() : "") + "-" + this.getNombconductor() + " " + this.getNomPaterno(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ConfigRestriccionPago.java b/src/com/rjconsultores/ventaboletos/entidad/ConfigRestriccionPago.java new file mode 100644 index 000000000..1e8fa5dc1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ConfigRestriccionPago.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CONFIG_RESTRICCION_PAGO_SEQ", sequenceName = "CONFIG_RESTRICCION_PAGO_SEQ",allocationSize=1) +@Table(name = "CONFIG_RESTRICCION_PAGO") +public class ConfigRestriccionPago implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFIG_RESTRICCION_PAGO_SEQ") + @Column(name = "CONFIGRESTRICCION_ID") + private Integer configrestriccionId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESTRICCION_ID", referencedColumnName = "RESTRICCION_ID") + @ManyToOne + private RestriccionPago restriccion; + @JoinColumn(name = "FORMAPAGO_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago; + + public ConfigRestriccionPago() { + } + + public ConfigRestriccionPago(Integer configrestriccionId) { + this.configrestriccionId = configrestriccionId; + } + + public Integer getConfigrestriccionId() { + return configrestriccionId; + } + + public void setConfigrestriccionId(Integer configrestriccionId) { + this.configrestriccionId = configrestriccionId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public RestriccionPago getRestriccion() { + return restriccion; + } + + public void setRestriccion(RestriccionPago restriccion) { + this.restriccion = restriccion; + } + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (configrestriccionId != null ? configrestriccionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ConfigRestriccionPago)) { + return false; + } + ConfigRestriccionPago other = (ConfigRestriccionPago) object; + if ((this.configrestriccionId == null && other.configrestriccionId != null) || (this.configrestriccionId != null && !this.configrestriccionId.equals(other.configrestriccionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago[configrestriccionId=" + configrestriccionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Constante.java b/src/com/rjconsultores/ventaboletos/entidad/Constante.java new file mode 100644 index 000000000..a834a9c57 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Constante.java @@ -0,0 +1,156 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CONSTANTE_SEQ", sequenceName = "CONSTANTE_SEQ", allocationSize = 1) +@Table(name = "CONSTANTE") +public class Constante implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONSTANTE_SEQ") + @Column(name = "CONSTANTE_ID") + private Integer constanteId; + @Column(name = "NOMBCONSTANTE") + private String nombconstante; + @Column(name = "DESCCONSTANTE") + private String descconstante; + @Column(name = "INDTIPOCONSTANTE") + private String indtipoconstante; + @Column(name = "VALORCONSTANTE") + private String valorconstante; + @Column(name = "INDMANTENIMIENTOUSUARIO") + private Boolean indmantenimientousuario; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Constante() { + } + + public Constante(Integer constanteId) { + this.constanteId = constanteId; + } + + public Integer getConstanteId() { + return constanteId; + } + + public void setConstanteId(Integer constanteId) { + this.constanteId = constanteId; + } + + public String getNombconstante() { + return nombconstante; + } + + public void setNombconstante(String nombconstante) { + this.nombconstante = nombconstante; + } + + public String getDescconstante() { + return descconstante; + } + + public void setDescconstante(String descconstante) { + this.descconstante = descconstante; + } + + public String getIndtipoconstante() { + return indtipoconstante; + } + + public void setIndtipoconstante(String indtipoconstante) { + this.indtipoconstante = indtipoconstante; + } + + public String getValorconstante() { + return valorconstante; + } + + public void setValorconstante(String valorconstante) { + this.valorconstante = valorconstante; + } + + public Boolean getIndmantenimientousuario() { + return indmantenimientousuario; + } + + public void setIndmantenimientousuario(Boolean indmantenimientousuario) { + this.indmantenimientousuario = indmantenimientousuario; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (constanteId != null ? constanteId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Constante)) { + return false; + } + Constante other = (Constante) object; + if ((this.constanteId == null && other.constanteId != null) || (this.constanteId != null && !this.constanteId.equals(other.constanteId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Constante[constanteId=" + constanteId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Convenio.java b/src/com/rjconsultores/ventaboletos/entidad/Convenio.java new file mode 100644 index 000000000..67edd011f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Convenio.java @@ -0,0 +1,174 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CONVENIO_SEQ", sequenceName = "CONVENIO_SEQ", allocationSize = 1) +@Table(name = "CONVENIO") +public class Convenio implements Serializable { + + public static final Short IMPRIME_PRECO_TOTAL = 1; + public static final Short IMPRIME_PRECO_MENOS_DESCONTO = 2; + public static final Short IMPRIME_DESCONTO = 3; + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONVENIO_SEQ") + @Basic(optional = false) + @Column(name = "CONVENIO_ID") + private Integer convenioId; + @Column(name = "DESCCONVENIO") + private String descconvenio; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "CVECONVENIO") + private String cveconvenio; + @Column(name = "VALIDAFOLIO") + private Boolean validafolio; + @Column(name = "IMPRIMEPRECIO") + private Short imprimeprecio; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "CONVENIO_ID", referencedColumnName = "CONVENIO_ID") + private List convenioDetList; + + public Convenio() { + } + + public Convenio(Integer convenioId) { + this.convenioId = convenioId; + } + + public Integer getConvenioId() { + return convenioId; + } + + public void setConvenioId(Integer convenioId) { + this.convenioId = convenioId; + } + + public String getDescconvenio() { + return descconvenio; + } + + public void setDescconvenio(String descconvenio) { + this.descconvenio = descconvenio; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getCveconvenio() { + return cveconvenio; + } + + public void setCveconvenio(String cveconvenio) { + this.cveconvenio = cveconvenio; + } + + public Boolean getValidafolio() { + return validafolio; + } + + public void setValidafolio(Boolean validafolio) { + this.validafolio = validafolio; + } + + public Short getImprimeprecio() { + return imprimeprecio; + } + + public void setImprimeprecio(Short imprimeprecio) { + this.imprimeprecio = imprimeprecio; + } + + public List getConvenioDetList() { + List tmp = new ArrayList(); + if (convenioDetList != null) { + for (ConvenioDet cd : this.convenioDetList) { + if (cd.getActivo()) { + tmp.add(cd); + } + } + } + + return tmp; + } + + public void setConvenioDetList(List convenioDetList) { + this.convenioDetList = convenioDetList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (convenioId != null ? convenioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Convenio)) { + return false; + } + Convenio other = (Convenio) object; + if ((this.convenioId == null && other.convenioId != null) || (this.convenioId != null && !this.convenioId.equals(other.convenioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Convenio[convenioId=" + convenioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ConvenioDet.java b/src/com/rjconsultores/ventaboletos/entidad/ConvenioDet.java new file mode 100644 index 000000000..1fe052bc3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ConvenioDet.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "CONVENIO_DET_SEQ", sequenceName = "CONVENIO_DET_SEQ", allocationSize = 1) +@Table(name = "CONVENIO_DET") +public class ConvenioDet implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONVENIO_DET_SEQ") + @Basic(optional = false) + @Column(name = "CONVENIODET_ID") + private Integer conveniodetId; + @Column(name = "PORCDESCUENTO") + private BigDecimal porcdescuento; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "NUMFOLIOINICIAL") + private Long numfolioinicial; + @Column(name = "NUMFOLIOFINAL") + private Long numfoliofinal; + + public ConvenioDet() { + } + + public ConvenioDet(Integer conveniodetId) { + this.conveniodetId = conveniodetId; + } + + public Integer getConveniodetId() { + return conveniodetId; + } + + public void setConveniodetId(Integer conveniodetId) { + this.conveniodetId = conveniodetId; + } + + public BigDecimal getPorcdescuento() { + return porcdescuento; + } + + public void setPorcdescuento(BigDecimal porcdescuento) { + this.porcdescuento = porcdescuento; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Long getNumfolioinicial() { + return numfolioinicial; + } + + public void setNumfolioinicial(Long numfolioinicio) { + this.numfolioinicial = numfolioinicio; + } + + public Long getNumfoliofinal() { + return numfoliofinal; + } + + public void setNumfoliofinal(Long numfoliofinal) { + this.numfoliofinal = numfoliofinal; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (conveniodetId != null ? conveniodetId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ConvenioDet)) { + return false; + } + ConvenioDet other = (ConvenioDet) object; + if ((this.conveniodetId == null && other.conveniodetId != null) || (this.conveniodetId != null && !this.conveniodetId.equals(other.conveniodetId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ConvenioDet[conveniodetId=" + conveniodetId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Corrida.java b/src/com/rjconsultores/ventaboletos/entidad/Corrida.java new file mode 100644 index 000000000..97f37a95d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Corrida.java @@ -0,0 +1,445 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Embeddable; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.NotFound; +import org.hibernate.annotations.NotFoundAction; + +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "CORRIDA") +public class Corrida implements Serializable { + + private static final long serialVersionUID = 1L; + + @Embeddable + public static class Id implements Serializable { + + @Column(name = "CORRIDA_ID") + private Integer corridaId; + @Column(name = "FECCORRIDA") + @Temporal(TemporalType.DATE) + private Date feccorrida; + + public Id() { + } + + public Integer getCorridaId() { + return corridaId; + } + + public void setCorridaId(Integer corridaId) { + this.corridaId = corridaId; + } + + public Date getFeccorrida() { + return feccorrida; + } + + public void setFeccorrida(Date feccorrida) { + this.feccorrida = feccorrida; + } + + @Override + public String toString() { + SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); + return corridaId + " Hora:" + sf.format(feccorrida); + } + } + @EmbeddedId + private Id id = new Id(); + @Column(name = "FECHORSALIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorsalida; + @Column(name = "INDSTATUSCORRIDA") + private String indstatuscorrida; + @Column(name = "FECHORTARJETAVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fechortarjetaviaje; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @ManyToOne + @JoinColumn(name = "AUTOBUS_ID", referencedColumnName = "AUTOBUS_ID") + private Autobus autobus; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "CONDUCTOR1_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor; + @JoinColumn(name = "CONDUCTOR2_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor1; + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID", insertable = false, updatable = false) + @ManyToOne(optional = false) + private CorridaCtrl corridaCtrl; + @OneToMany(mappedBy = "corrida", cascade = CascadeType.ALL) + private List corridaTramoList; + @JoinColumn(name = "EMPRESACORRIDA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "EMPRESAINGRESO_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa1; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "NODO_ID", referencedColumnName = "NODO_ID") + @ManyToOne + private Nodo nodo; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + @JoinColumn(name = "ZONA_ID", referencedColumnName = "ZONA_ID") + @ManyToOne + private Zona zona; + @OneToOne + @JoinColumn(name = "ROLOPERATIVO_ID") + private RolOperativo rolOperativo; + @Column(name = "CANTPARADOS") + private Short cantParados; + @Column(name = "TIPOSERVICIO_ID") + private Short tipoServicio; + @Column(name = "fechorsalidaoriginal") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date fechorSalidaOriginal; + @OneToOne + @NotFound(action = NotFoundAction.IGNORE) + @JoinColumn(name = "esquemacorrida_id", referencedColumnName = "esquemacorrida_id") + private EsquemaCorrida esquemaCorrida; + @Column(name = "indtipoventa") + private String indTipoVenta; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @ManyToOne + @JoinColumns({ + @JoinColumn(name = "CORRIDAREBOTE_ID", referencedColumnName = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDAREBOTE", referencedColumnName = "FECCORRIDA")}) + @NotFound(action = NotFoundAction.IGNORE) + private Corrida corridaRebote; + @ManyToOne + @JoinColumns({ + @JoinColumn(name = "CORRIDA2_ID", referencedColumnName = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDA2", referencedColumnName = "FECCORRIDA")}) + @NotFound(action = NotFoundAction.IGNORE) + private Corrida corridaPiso; + @JoinColumn(name = "DIVISIONINGRESO_ID", referencedColumnName = "DIVISION_ID") + @ManyToOne + private Division division; + @Column(name = "NUMPISO") + private Integer numPiso; + + + public String getIndTipoVenta() { + return indTipoVenta; + } + + public void setIndTipoVenta(String indTipoVenta) { + this.indTipoVenta = indTipoVenta; + } + + public Date getFechorSalidaOriginal() { + return fechorSalidaOriginal; + } + + public void setFechorSalidaOriginal(Date fechorSalidaOriginal) { + if (fechorSalidaOriginal != null) { + fechorSalidaOriginal = DateUtil.normalizar(fechorSalidaOriginal); + } + this.fechorSalidaOriginal = fechorSalidaOriginal; + } + + public EsquemaCorrida getEsquemaCorrida() { + return esquemaCorrida; + } + + public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + this.esquemaCorrida = esquemaCorrida; + } + + public Corrida() { + } + + public Corrida(Marca marca, Integer corridaId, Parada origen, Parada destino, ClaseServicio claseServicio, Date horario) { + this.id = new Id(); + this.id.setCorridaId(corridaId); + this.setFechorsalida(horario); + this.origem = origen; + this.destino = destino; + this.claseServicio = claseServicio; + this.marca = marca; + } + + public Id getId() { + return id; + } + + public void setId(Id id) { + this.id = id; + } + + public List getCorridaTramoList() { + return corridaTramoList; + } + + public void setCorridaTramoList(List corridaTramoList) { + this.corridaTramoList = corridaTramoList; + } + + public Date getFechorsalida() { + return fechorsalida; + } + + public void setFechorsalida(Date fechorsalida) { + if (fechorsalida != null) { + fechorsalida = DateUtil.normalizar(fechorsalida); + } + this.fechorsalida = fechorsalida; + } + + public String getIndstatuscorrida() { + return indstatuscorrida; + } + + public void setIndstatuscorrida(String indstatuscorrida) { + this.indstatuscorrida = indstatuscorrida; + } + + public Date getFechortarjetaviaje() { + return fechortarjetaviaje; + } + + public void setFechortarjetaviaje(Date fechortarjetaviaje) { + this.fechortarjetaviaje = fechortarjetaviaje; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Autobus getAutobus() { + return autobus; + } + + public void setAutobus(Autobus autobus) { + this.autobus = autobus; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Conductor getConductor() { + return conductor; + } + + public void setConductor(Conductor conductor) { + this.conductor = conductor; + } + + public Conductor getConductor1() { + return conductor1; + } + + public void setConductor1(Conductor conductor1) { + this.conductor1 = conductor1; + } + + public CorridaCtrl getCorridaCtrl() { + return corridaCtrl; + } + + public void setCorridaCtrl(CorridaCtrl corridaCtrl) { + this.corridaCtrl = corridaCtrl; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Empresa getEmpresa1() { + return empresa1; + } + + public void setEmpresa1(Empresa empresa1) { + this.empresa1 = empresa1; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public Zona getZona() { + return zona; + } + + public void setZona(Zona zona) { + this.zona = zona; + } + + public RolOperativo getRolOperativo() { + return rolOperativo; + } + + public void setRolOperativo(RolOperativo rolOperativo) { + this.rolOperativo = rolOperativo; + } + + public Short getCantParados() { + return cantParados; + } + + public void setCantParados(Short cantParados) { + this.cantParados = cantParados; + } + + public Short getTipoServicio() { + return tipoServicio; + } + + public void setTipoServicio(Short tipoServicio) { + this.tipoServicio = tipoServicio; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Corrida getCorridaRebote() { + return corridaRebote; + } + + public void setCorridaRebote(Corrida corridaRebote) { + this.corridaRebote = corridaRebote; + } + + public Division getDivision() { + return division; + } + + public void setDivision(Division division) { + this.division = division; + } + + + public Corrida getCorridaPiso() { + return corridaPiso; + } + + public void setCorridaPiso(Corrida corridaPiso) { + this.corridaPiso = corridaPiso; + } + + public Integer getNumPiso() { + return numPiso; + } + + public void setNumPiso(Integer numPiso) { + this.numPiso = numPiso; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CorridaCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/CorridaCtrl.java new file mode 100644 index 000000000..c87317e9e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CorridaCtrl.java @@ -0,0 +1,174 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "CORRIDA_SEQ", sequenceName = "CORRIDA_SEQ", allocationSize = 1) +@Table(name = "CORRIDA_CTRL") +public class CorridaCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "CORRIDA_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CORRIDA_SEQ") + private Integer corridaId; + @Column(name = "HORARIO") + @Temporal(TemporalType.TIME) + private Date horario; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + @OneToOne + @JoinColumn(name = "NODO_ID") + private Nodo nodo; + @Column(name = "INDPISOEXTRA") + private Boolean pisoExtra; + + public CorridaCtrl() { + } + + public Boolean getPisoExtra() { + return pisoExtra; + } + + public void setPisoExtra(Boolean pisoExtra) { + this.pisoExtra = pisoExtra; + } + + public CorridaCtrl(Integer corridaId) { + this.corridaId = corridaId; + } + + public Integer getCorridaId() { + return corridaId; + } + + public void setCorridaId(Integer corridaId) { + this.corridaId = corridaId; + } + + public Date getHorario() { + return horario; + } + + public void setHorario(Date horario) { + this.horario = horario; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (corridaId != null ? corridaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CorridaCtrl)) { + return false; + } + CorridaCtrl other = (CorridaCtrl) object; + if ((this.corridaId == null && other.corridaId != null) || (this.corridaId != null && !this.corridaId.equals(other.corridaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.CorridaCtrl[corridaId=" + corridaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CorridaTramo.java b/src/com/rjconsultores/ventaboletos/entidad/CorridaTramo.java new file mode 100644 index 000000000..3187889c5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CorridaTramo.java @@ -0,0 +1,331 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.SequenceGenerator; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import org.hibernate.annotations.NotFound; +import org.hibernate.annotations.NotFoundAction; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "CORRIDA_TRAMO_SEQ", sequenceName = "CORRIDA_TRAMO_SEQ", allocationSize = 1) +@Table(name = "CORRIDA_TRAMO") +public class CorridaTramo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "CORRIDATRAMO_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CORRIDA_TRAMO_SEQ") + private Integer corridatramoId; + @OneToOne + @NotFound(action=NotFoundAction.IGNORE) + @JoinColumns({ + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDA", referencedColumnName = "FECCORRIDA") + }) + private Corrida corrida; + @Column(name = "NUMSECUENCIA") + private Short numsecuencia; + @Column(name = "FECHORSALIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorsalida; + @Column(name = "FECHORLLEGADA") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorllegada; + @Column(name = "FECHORTARJETAVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fechortarjetaviaje; + @Column(name = "USUARIOTARJETAVIAJE_ID") + private Integer usuariotarjetaviajeId; + @Column(name = "NUMSECORIGEN") + private Short numsecorigen; + @Column(name = "NUMSECDESTINO") + private Short numsecdestino; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "NODO_ID", referencedColumnName = "NODO_ID") + @ManyToOne + private Nodo nodo; + @JoinColumn(name = "CONDUCTOR1_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor; + @JoinColumn(name = "CONDUCTOR2_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor1; + @JoinColumn(name = "AUTOBUS_ID", referencedColumnName = "AUTOBUS_ID") + @ManyToOne + private Autobus autobus; + @Column(name = "fechorsalidaoriginal") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date fechorSalidaOriginal; + @Column(name = "TIEMPOESTANCIA") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date tiempoEstancia; + @Column(name = "INDMANTTARJETA") + private Boolean indmanttarjeta; + @Column(name = "FOLIOTARJETAVIAJE") + private String folioTarjeta; + + public Boolean getIndmanttarjeta() { + return indmanttarjeta; + } + + public void setIndmanttarjeta(Boolean indmanttarjeta) { + this.indmanttarjeta = indmanttarjeta; + } + + public Date getTiempoEstancia() { + return tiempoEstancia; + } + + public void setTiempoEstancia(Date tiempoEstancia) { + this.tiempoEstancia = tiempoEstancia; + } + + public CorridaTramo() { + } + + public CorridaTramo(Integer corridatramoId) { + this.corridatramoId = corridatramoId; + } + + public Date getFechorSalidaOriginal() { + return fechorSalidaOriginal; + } + + public void setFechorSalidaOriginal(Date fechorSalidaOriginal) { + if (fechorSalidaOriginal != null) { + fechorSalidaOriginal = DateUtil.normalizar(fechorSalidaOriginal); + } + this.fechorSalidaOriginal = fechorSalidaOriginal; + } + + public Integer getCorridatramoId() { + return corridatramoId; + } + + public void setCorridatramoId(Integer corridatramoId) { + this.corridatramoId = corridatramoId; + } + + public Corrida getCorrida() { + return corrida; + } + + public void setCorrida(Corrida corrida) { + this.corrida = corrida; + } + + public Short getNumsecuencia() { + return numsecuencia; + } + + public void setNumsecuencia(Short numsecuencia) { + this.numsecuencia = numsecuencia; + } + + public Date getFechorsalida() { + return fechorsalida; + } + + public void setFechorsalida(Date fechorsalida) { + if (fechorsalida != null) { + fechorsalida = DateUtil.normalizar(fechorsalida); + } + this.fechorsalida = fechorsalida; + } + + public Date getFechorllegada() { + return fechorllegada; + } + + public void setFechorllegada(Date fechorllegada) { + if (fechorllegada != null) { + fechorllegada = DateUtil.normalizar(fechorllegada); + } + this.fechorllegada = fechorllegada; + } + + public Date getFechortarjetaviaje() { + return fechortarjetaviaje; + } + + public void setFechortarjetaviaje(Date fechortarjetaviaje) { + this.fechortarjetaviaje = fechortarjetaviaje; + } + + public Integer getUsuariotarjetaviajeId() { + return usuariotarjetaviajeId; + } + + public void setUsuariotarjetaviajeId(Integer usuariotarjetaviajeId) { + this.usuariotarjetaviajeId = usuariotarjetaviajeId; + } + + public Short getNumsecorigen() { + return numsecorigen; + } + + public void setNumsecorigen(Short numsecorigen) { + this.numsecorigen = numsecorigen; + } + + public Short getNumsecdestino() { + return numsecdestino; + } + + public void setNumsecdestino(Short numsecdestino) { + this.numsecdestino = numsecdestino; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public com.rjconsultores.ventaboletos.entidad.Parada getDestino() { + return destino; + } + + public void setDestino(com.rjconsultores.ventaboletos.entidad.Parada destino) { + this.destino = destino; + } + + public com.rjconsultores.ventaboletos.entidad.Parada getOrigem() { + return origem; + } + + public void setOrigem(com.rjconsultores.ventaboletos.entidad.Parada origem) { + this.origem = origem; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + public Conductor getConductor() { + return conductor; + } + + public void setConductor(Conductor conductor) { + this.conductor = conductor; + } + + public Conductor getConductor1() { + return conductor1; + } + + public void setConductor1(Conductor conductor1) { + this.conductor1 = conductor1; + } + + public Autobus getAutobus() { + return autobus; + } + + public void setAutobus(Autobus autobus) { + this.autobus = autobus; + } + + public String getFolioTarjeta() { + return folioTarjeta; + } + + public void setFolioTarjeta(String folioTarjeta) { + this.folioTarjeta = folioTarjeta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (corridatramoId != null ? corridatramoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CorridaTramo)) { + return false; + } + CorridaTramo other = (CorridaTramo) object; + if ((this.corridatramoId == null && other.corridatramoId != null) || (this.corridatramoId != null && !this.corridatramoId.equals(other.corridatramoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.CorridaTramo[corridatramoId=" + corridatramoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Cortesia.java b/src/com/rjconsultores/ventaboletos/entidad/Cortesia.java new file mode 100644 index 000000000..7e7a2ac89 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Cortesia.java @@ -0,0 +1,260 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "CORTESIA_SEQ", sequenceName = "CORTESIA_SEQ", allocationSize = 1) +@Table(name = "CORTESIA") +public class Cortesia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CORTESIA_SEQ") + @Column(name = "CORTESIA_ID") + private Integer cortesiaId; + @Column(name = "DESCCORREO") + private String descCorreo; + @Column(name = "INDTIPOVIAJE") + private String indtipoviaje; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicio; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinal; + @Column(name = "NDSTATUS") + private String ndstatus; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "EMPLEADO_ID") + @OneToOne + private Empleado empleado; + @JoinColumn(name = "TIPOCORTESIA_ID", referencedColumnName = "TIPOCORTESIA_ID") + @ManyToOne + private TipoCortesia tipoCortesia; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "MOTIVOVIAJE_ID", referencedColumnName = "MOTIVOVIAJE_ID") + @ManyToOne + private MotivoViaje motivoViaje; + @OneToMany(mappedBy = "cortesia", cascade = CascadeType.ALL) + @LazyCollection(value = LazyCollectionOption.FALSE) + private List cortesiaBeneficiarioList; + + public MotivoViaje getMotivoViaje() { + return motivoViaje; + } + + public void setMotivoViaje(MotivoViaje motivoViaje) { + this.motivoViaje = motivoViaje; + } + + public List getCortesiaBeneficiarioList() { + List cb = new ArrayList(); + if (cortesiaBeneficiarioList != null) { + for (CortesiaBeneficiario ctb : this.cortesiaBeneficiarioList) { + if (ctb.getActivo() == Boolean.TRUE) { + cb.add(ctb); + } + } + } + + this.cortesiaBeneficiarioList = cb; + + return cb; + } + + public void setCortesiaBeneficiarioList(List cortesiaBeneficiarioList) { + this.cortesiaBeneficiarioList = cortesiaBeneficiarioList; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Integer getCortesiaId() { + return cortesiaId; + } + + public void setCortesiaId(Integer cortesiaId) { + this.cortesiaId = cortesiaId; + } + + public String getDescCorreo() { + return descCorreo; + } + + public void setDescCorreo(String descCorreo) { + this.descCorreo = descCorreo; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Empleado getEmpleado() { + return empleado; + } + + public void setEmpleado(Empleado empleado) { + this.empleado = empleado; + } + + public Date getFecfinal() { + return fecfinal; + } + + public void setFecfinal(Date fecfinal) { + this.fecfinal = fecfinal; + } + + public Date getFecinicio() { + return fecinicio; + } + + public void setFecinicio(Date fecinicio) { + this.fecinicio = fecinicio; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public String getIndtipoviaje() { + return indtipoviaje; + } + + public void setIndtipoviaje(String indtipoviaje) { + this.indtipoviaje = indtipoviaje; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public String getNdstatus() { + return ndstatus; + } + + public void setNdstatus(String ndstatus) { + this.ndstatus = ndstatus; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public TipoCortesia getTipoCortesia() { + return tipoCortesia; + } + + public void setTipoCortesia(TipoCortesia tipoCortesia) { + this.tipoCortesia = tipoCortesia; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cortesiaId != null ? cortesiaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Cortesia)) { + return false; + } + Cortesia other = (Cortesia) object; + if ((this.cortesiaId == null && other.cortesiaId != null) || (this.cortesiaId != null && !this.cortesiaId.equals(other.cortesiaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Cortesia[cortesiaId=" + cortesiaId + "]"; + //return this.getEmpleado() + getDescCorreo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CortesiaBeneficiario.java b/src/com/rjconsultores/ventaboletos/entidad/CortesiaBeneficiario.java new file mode 100644 index 000000000..3bdb744f2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CortesiaBeneficiario.java @@ -0,0 +1,186 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "CORTESIA_BENEFICIARIO_SEQ", sequenceName = "CORTESIA_BENEFICIARIO_SEQ", allocationSize = 1) +@Table(name = "CORTESIA_BENEFICIARIO") +public class CortesiaBeneficiario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CORTESIA_BENEFICIARIO_SEQ") + @Column(name = "CORTESIABENEFICIARIO_ID") + private Integer cortesiaBeneficiarioId; + @Column(name = "NOMBBENEF") + private String nombBenef; + @Column(name = "NOMBPATERNO") + private String nombPaterno; + @Column(name = "NOMBMATERNO") + private String nombMaterno; + @Column(name = "INDTIPOBENEF") + private String indtipobenef; + @Column(name = "FECUTILIZACIONIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecUtilizacionIda; + @Column(name = "FECUTILIZACIONREGRESO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecUtilizacionRegreso; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CORTESIA_ID", referencedColumnName = "CORTESIA_ID") + @ManyToOne + private Cortesia cortesia; + @JoinColumn(name = "TIPOCORTESIADESCUENTO_ID", referencedColumnName = "TIPOCORTESIADESCUENTO_ID") + @ManyToOne + private TipoCortesiaDescuento descuento; + + public TipoCortesiaDescuento getDescuento() { + return descuento; + } + + public void setDescuento(TipoCortesiaDescuento descuento) { + this.descuento = descuento; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Cortesia getCortesia() { + return cortesia; + } + + public void setCortesia(Cortesia cortesia) { + this.cortesia = cortesia; + } + + public Integer getCortesiaBeneficiarioId() { + return cortesiaBeneficiarioId; + } + + public void setCortesiaBeneficiarioId(Integer cortesiaBeneficiarioId) { + this.cortesiaBeneficiarioId = cortesiaBeneficiarioId; + } + + public Date getFecUtilizacionIda() { + return fecUtilizacionIda; + } + + public void setFecUtilizacionIda(Date fecUtilizacionIda) { + this.fecUtilizacionIda = fecUtilizacionIda; + } + + public Date getFecUtilizacionRegreso() { + return fecUtilizacionRegreso; + } + + public void setFecUtilizacionRegreso(Date fecUtilizacionRegreso) { + this.fecUtilizacionRegreso = fecUtilizacionRegreso; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public String getNombBenef() { + return nombBenef; + } + + public void setNombBenef(String nombBenef) { + this.nombBenef = nombBenef; + } + + public String getNombMaterno() { + return nombMaterno; + } + + public void setNombMaterno(String nombMaterno) { + this.nombMaterno = nombMaterno; + } + + public String getNombPaterno() { + return nombPaterno; + } + + public void setNombPaterno(String nombPaterno) { + this.nombPaterno = nombPaterno; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getIndtipobenef() { + return indtipobenef; + } + + public void setIndtipobenef(String indtipobenef) { + this.indtipobenef = indtipobenef; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cortesiaBeneficiarioId != null ? cortesiaBeneficiarioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CortesiaBeneficiario)) { + return false; + } + CortesiaBeneficiario other = (CortesiaBeneficiario) object; + if ((this.cortesiaBeneficiarioId == null && other.cortesiaBeneficiarioId != null) || (this.cortesiaBeneficiarioId != null && !this.cortesiaBeneficiarioId.equals(other.cortesiaBeneficiarioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario[cortesiaBeneficiarioId=" + cortesiaBeneficiarioId + "]"; + //return this.getNombBenef(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CortesiaDireccion.java b/src/com/rjconsultores/ventaboletos/entidad/CortesiaDireccion.java new file mode 100644 index 000000000..a26391f74 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CortesiaDireccion.java @@ -0,0 +1,177 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + * + */ +@Entity +@SequenceGenerator(name = "CORTESIA_DIRECCION_SEQ", sequenceName = "CORTESIA_DIRECCION_SEQ", allocationSize = 1) +@Table(name = "CORTESIA_DIRECCION") +public class CortesiaDireccion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CORTESIA_DIRECCION_SEQ") + @Column(name = "CORTESIADIRECCION_ID") + private Integer cortesiaDireccionId; + @Column(name = "NUMFOLIOINICIO") + private Integer numFolioInicio; + @Column(name = "NUMFOLIOFIN") + private Integer numFolioFin; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecInicioV; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecFinV; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOCORTESIADESCUENTO_ID", referencedColumnName = "TIPOCORTESIADESCUENTO_ID") + @ManyToOne + private TipoCortesiaDescuento tipocortesiaDescuento; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public TipoCortesiaDescuento getTipocortesiaDescuento() { + return tipocortesiaDescuento; + } + + public void setTipocortesiaDescuento(TipoCortesiaDescuento tipocortesiaDescuento) { + this.tipocortesiaDescuento = tipocortesiaDescuento; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getCortesiaDireccionId() { + return cortesiaDireccionId; + } + + public void setCortesiaDireccionId(Integer cortesiaDireccionId) { + this.cortesiaDireccionId = cortesiaDireccionId; + } + + public Date getFecFinV() { + return fecFinV; + } + + public void setFecFinV(Date fecFinV) { + this.fecFinV = fecFinV; + } + + public Date getFecInicioV() { + return fecInicioV; + } + + public void setFecInicioV(Date fecInicioV) { + this.fecInicioV = fecInicioV; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getNumFolioFin() { + return numFolioFin; + } + + public void setNumFolioFin(Integer numFolioFin) { + this.numFolioFin = numFolioFin; + } + + public Integer getNumFolioInicio() { + return numFolioInicio; + } + + public void setNumFolioInicio(Integer numFolioInicio) { + this.numFolioInicio = numFolioInicio; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cortesiaDireccionId != null ? cortesiaDireccionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof CortesiaDireccion)) { + return false; + } + CortesiaDireccion other = (CortesiaDireccion) obj; + if ((this.cortesiaDireccionId == null && other.cortesiaDireccionId != null) || (this.cortesiaDireccionId != null && !this.cortesiaDireccionId.equals(other.cortesiaDireccionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CortesiaDireccion[cortesiaDireccionId=" + cortesiaDireccionId + "]"; + //return this.getDescTipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CuponConvenio.java b/src/com/rjconsultores/ventaboletos/entidad/CuponConvenio.java new file mode 100644 index 000000000..90c16412f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CuponConvenio.java @@ -0,0 +1,133 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "CUPON_CONVENIO_SEQ", sequenceName = "CUPON_CONVENIO_SEQ", allocationSize = 1) +@Table(name = "CUPON_CONVENIO") +public class CuponConvenio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CUPON_CONVENIO_SEQ") + @Column(name = "CUPONCONVENIO_ID") + private Integer cuponConvenioID; + @Column(name = "NUMFOLIOINICIO") + private Integer folioInicio; + @Column(name = "NUMFOLIOFINAL") + private Integer folioFinal; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOCONVENIO_ID", referencedColumnName = "TIPOCONVENIO_ID") + @ManyToOne + private TipoConvenio tipoConvenio; + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getCuponConvenioID() { + return cuponConvenioID; + } + + public void setCuponConvenioID(Integer cuponConvenioID) { + this.cuponConvenioID = cuponConvenioID; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getFolioFinal() { + return folioFinal; + } + + public void setFolioFinal(Integer folioFinal) { + this.folioFinal = folioFinal; + } + + public Integer getFolioInicio() { + return folioInicio; + } + + public void setFolioInicio(Integer folioInicio) { + this.folioInicio = folioInicio; + } + + public TipoConvenio getTipoConvenio() { + return tipoConvenio; + } + + public void setTipoConvenio(TipoConvenio tipoConvenio) { + this.tipoConvenio = tipoConvenio; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cuponConvenioID != null ? cuponConvenioID.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CuponConvenio)) { + return false; + } + CuponConvenio other = (CuponConvenio) object; + if ((this.cuponConvenioID == null && other.cuponConvenioID != null) || (this.cuponConvenioID != null && !this.cuponConvenioID.equals(other.cuponConvenioID))) { + return false; + } + return true; + } + + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.CuponConvenio[cuponConvenioID=" + cuponConvenioID + "]"; + return this.getTipoConvenio().getDescTipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CuponSecretaria.java b/src/com/rjconsultores/ventaboletos/entidad/CuponSecretaria.java new file mode 100644 index 000000000..7084c4cea --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CuponSecretaria.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "CUPON_SECRETARIA") +@SequenceGenerator(name = "CUPON_SECRETARIA_SEQ", sequenceName = "CUPON_SECRETARIA_SEQ", allocationSize = 1) +public class CuponSecretaria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "CUPON_SECRETARIA_SEQ") + @Column(name = "CUPONSECRETARIA_ID") + private Integer cuponsecretariaId; + @Column(name = "NUMFOLIOINICIO") + private Long numfolioinicio; + @Column(name = "NUMFOLIOFINAL") + private Long numfoliofinal; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "PORCDESCUENTO") + private BigDecimal porcdescuento; + + public CuponSecretaria() { + } + + public CuponSecretaria(Integer cuponsecretariaId) { + this.cuponsecretariaId = cuponsecretariaId; + } + + public Integer getCuponsecretariaId() { + return cuponsecretariaId; + } + + public void setCuponsecretariaId(Integer cuponsecretariaId) { + this.cuponsecretariaId = cuponsecretariaId; + } + + public Long getNumfolioinicio() { + return numfolioinicio; + } + + public void setNumfolioinicio(Long numfolioinicio) { + this.numfolioinicio = numfolioinicio; + } + + public Long getNumfoliofinal() { + return numfoliofinal; + } + + public void setNumfoliofinal(Long numfoliofinal) { + this.numfoliofinal = numfoliofinal; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public BigDecimal getPorcdescuento() { + return porcdescuento; + } + + public void setPorcdescuento(BigDecimal porcdescuento) { + this.porcdescuento = porcdescuento; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (cuponsecretariaId != null ? cuponsecretariaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof CuponSecretaria)) { + return false; + } + CuponSecretaria other = (CuponSecretaria) object; + if ((this.cuponsecretariaId == null && other.cuponsecretariaId != null) || (this.cuponsecretariaId != null && !this.cuponsecretariaId.equals(other.cuponsecretariaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.CuponSecretaria[cuponsecretariaId=" + cuponsecretariaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/DepositoBancario.java b/src/com/rjconsultores/ventaboletos/entidad/DepositoBancario.java new file mode 100644 index 000000000..4613f7af0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/DepositoBancario.java @@ -0,0 +1,158 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "DEPOSITO_BANCARIO") +@SequenceGenerator(name = "DEPOSITO_BANCARIO_SEQ", sequenceName = "DEPOSITO_BANCARIO_SEQ", allocationSize = 1) +public class DepositoBancario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "DEPOSITO_BANCARIO_SEQ") + @Column(name = "DEPOSITOBANCARIO_ID") + private Long depositobancarioId; + @Column(name = "PUNTOVENTA_ID") + private Integer puntoventaId; + @Column(name = "IMPORTE") + private BigDecimal importe; + @Column(name = "FORMAPAGO_ID") + private Integer formapagoId; + @Column(name = "BANCO_ID") + private Integer bancoId; + @Column(name = "FECDEPOSITO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecdeposito; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + + public DepositoBancario() { + } + + public DepositoBancario(Long depositobancarioId) { + this.depositobancarioId = depositobancarioId; + } + + public Long getDepositobancarioId() { + return depositobancarioId; + } + + public void setDepositobancarioId(Long depositobancarioId) { + this.depositobancarioId = depositobancarioId; + } + + public Integer getPuntoventaId() { + return puntoventaId; + } + + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public BigDecimal getImporte() { + return importe; + } + + public void setImporte(BigDecimal importe) { + this.importe = importe; + } + + public Integer getFormapagoId() { + return formapagoId; + } + + public void setFormapagoId(Integer formapagoId) { + this.formapagoId = formapagoId; + } + + public Integer getBancoId() { + return bancoId; + } + + public void setBancoId(Integer bancoId) { + this.bancoId = bancoId; + } + + public Date getFecdeposito() { + return fecdeposito; + } + + public void setFecdeposito(Date fecdeposito) { + this.fecdeposito = fecdeposito; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (depositobancarioId != null ? depositobancarioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof DepositoBancario)) { + return false; + } + DepositoBancario other = (DepositoBancario) object; + if ((this.depositobancarioId == null && other.depositobancarioId != null) || (this.depositobancarioId != null && !this.depositobancarioId.equals(other.depositobancarioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.DepositoBancario[depositobancarioId=" + depositobancarioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/DetDiagramaAutobus.java b/src/com/rjconsultores/ventaboletos/entidad/DetDiagramaAutobus.java new file mode 100644 index 000000000..8136ab3da --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/DetDiagramaAutobus.java @@ -0,0 +1,193 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; +import javax.persistence.Transient; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "DET_DIAGRAMA_AUTOBUS_SEQ", sequenceName = "DET_DIAGRAMA_AUTOBUS_SEQ", allocationSize = 1) +@Table(name = "DET_DIAGRAMA_AUTOBUS") +public class DetDiagramaAutobus implements Serializable { + + public final static String WC = "WC";//BAÑO + public final static String TV = "TV";//TELEVISION + public final static String PT = "PT";//PORTA TRAJE + public final static String CF = "CF";//CAFE + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "DET_DIAGRAMA_AUTOBUS_SEQ") + @Column(name = "DETDIAGRAMAAUTOBUS_ID") + private Short detdiagramaautobusId; + @Column(name = "ASIENTO") + private String asiento; + @Column(name = "NUMECOLUMNA") + private Short numecolumna; + @Column(name = "NUMEFILA") + private Short numefila; + @Column(name = "VENDIBLE") + private Boolean vendible; + @Column(name = "INTERNET") + private Boolean internet; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "DIAGRAMAAUTOBUS_ID", referencedColumnName = "DIAGRAMAAUTOBUS_ID") + @ManyToOne + private DiagramaAutobus diagramaAutobus; + + public DetDiagramaAutobus() { + } + + public Short getDetdiagramaautobusId() { + return detdiagramaautobusId; + } + + public void setDetdiagramaautobusId(Short detdiagramaautobusId) { + this.detdiagramaautobusId = detdiagramaautobusId; + } + + public String getAsiento() { + return asiento; + } + + public void setAsiento(String asiento) { + this.asiento = asiento; + } + + public Short getNumecolumna() { + return numecolumna; + } + + public void setNumecolumna(Short numecolumna) { + this.numecolumna = numecolumna; + } + + public Short getNumefila() { + return numefila; + } + + public void setNumefila(Short numefila) { + this.numefila = numefila; + } + + public Boolean getVendible() { + return vendible; + } + + public void setVendible(Boolean vendible) { + this.vendible = vendible; + } + + public Boolean getInternet() { + return internet; + } + + public void setInternet(Boolean internet) { + this.internet = internet; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public DiagramaAutobus getDiagramaAutobus() { + return diagramaAutobus; + } + + public void setDiagramaAutobus(DiagramaAutobus diagramaAutobus) { + this.diagramaAutobus = diagramaAutobus; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (detdiagramaautobusId != null ? detdiagramaautobusId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof DetDiagramaAutobus)) { + return false; + } + DetDiagramaAutobus other = (DetDiagramaAutobus) object; + if ((this.detdiagramaautobusId == null && other.detdiagramaautobusId != null) || (this.detdiagramaautobusId != null && !this.detdiagramaautobusId.equals(other.detdiagramaautobusId))) { + return false; + } + return true; + } + + /** + * Indica se el tipo del asiento es vendible + * @param tipoAsiento + * @return + */ + @Transient + public static boolean asientoVendible(String tipoAsiento){ + if (tipoAsiento == null){ + return false; + } + + if (tipoAsiento.equalsIgnoreCase(CF) + || tipoAsiento.equalsIgnoreCase(PT) + || tipoAsiento.equalsIgnoreCase(TV) + || tipoAsiento.equalsIgnoreCase(WC) + ){ + return false; + } + + return true; + } + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus[detdiagramaautobusId=" + detdiagramaautobusId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/DiagramaAutobus.java b/src/com/rjconsultores/ventaboletos/entidad/DiagramaAutobus.java new file mode 100644 index 000000000..54ea2854c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/DiagramaAutobus.java @@ -0,0 +1,168 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "DIAGRAMA_AUTOBUS_SEQ", sequenceName = "DIAGRAMA_AUTOBUS_SEQ", allocationSize = 1) +@Table(name = "DIAGRAMA_AUTOBUS") +public class DiagramaAutobus implements Serializable { + + @OneToMany(mappedBy = "diagramaAutobus") + private List autobusList; + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "DIAGRAMA_AUTOBUS_SEQ") + @Column(name = "DIAGRAMAAUTOBUS_ID") + private Short diagramaautobusId; + @Column(name = "CANTASIENTOS") + private Short cantasientos; + @Column(name = "MARCAAUTOBUS") + private String marcaautobus; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "diagramaAutobus", cascade = CascadeType.ALL) + private List detDiagramaAutobusList; + @Column(name = "DESCDIAGRAMA") + private String descDiagrama; + + public DiagramaAutobus() { + } + + public Short getDiagramaautobusId() { + return diagramaautobusId; + } + + public void setDiagramaautobusId(Short diagramaautobusId) { + this.diagramaautobusId = diagramaautobusId; + } + + public Short getCantasientos() { + return cantasientos; + } + + public void setCantasientos(Short cantasientos) { + this.cantasientos = cantasientos; + } + + public String getMarcaautobus() { + return marcaautobus; + } + + public void setMarcaautobus(String marcaautobus) { + this.marcaautobus = marcaautobus; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getDetDiagramaAutobusList() { + List tmp = new ArrayList(); + if (detDiagramaAutobusList != null) { + for (DetDiagramaAutobus ddab : this.detDiagramaAutobusList) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.detDiagramaAutobusList = tmp; + + return tmp; + } + + public void setDetDiagramaAutobusList(List detDiagramaAutobusList) { + this.detDiagramaAutobusList = detDiagramaAutobusList; + } + + public String getDescDiagrama() { + return descDiagrama; + } + + public void setDescDiagrama(String descDiagrama) { + this.descDiagrama = descDiagrama; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (diagramaautobusId != null ? diagramaautobusId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof DiagramaAutobus)) { + return false; + } + DiagramaAutobus other = (DiagramaAutobus) object; + if ((this.diagramaautobusId == null && other.diagramaautobusId != null) || (this.diagramaautobusId != null && !this.diagramaautobusId.equals(other.diagramaautobusId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescDiagrama(); + } + + public List getAutobusList() { + return autobusList; + } + + public void setAutobusList(List autobusList) { + this.autobusList = autobusList; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Division.java b/src/com/rjconsultores/ventaboletos/entidad/Division.java new file mode 100644 index 000000000..d1a5a558a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Division.java @@ -0,0 +1,130 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "DIVISION_SEQ", sequenceName = "DIVISION_SEQ", allocationSize = 1) +@Table(name = "DIVISION") +public class Division implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "DIVISION_SEQ") + @Column(name = "DIVISION_ID") + private Integer divisionId; + @Column(name = "NOMBDIVISION") + private String nombDivion; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Division() { + + } + + public Division(Integer divisionId) { + this.divisionId = divisionId; + } + + public Integer getDivisionId() { + return divisionId; + } + + public void setDivisionId(Integer divisionId) { + this.divisionId = divisionId; + } + + public String getNombDivion() { + return nombDivion; + } + + public void setNombDivion(String nombDivion) { + this.nombDivion = nombDivion; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((divisionId == null) ? 0 : divisionId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Division other = (Division) obj; + if (divisionId == null) { + if (other.divisionId != null) + return false; + } else if (!divisionId.equals(other.divisionId)) + return false; + return true; + } + + @Override + public String toString() { + return this.getNombDivion(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Empleado.java b/src/com/rjconsultores/ventaboletos/entidad/Empleado.java new file mode 100644 index 000000000..984307c93 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Empleado.java @@ -0,0 +1,200 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "EMPLEADO_SEQ", sequenceName = "EMPLEADO_SEQ", allocationSize = 1) +@Table(name = "EMPLEADO") +public class Empleado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPLEADO_SEQ") + @Column(name = "EMPLEADO_ID") + private Integer empleadoId; + @Column(name = "CVEEMPLEADO") + private String cveEmpleado; + @Column(name = "NOMBEMPLEADO") + private String nombEmpleado; + @Column(name = "NOMBPATERNO") + private String nombPaterno; + @Column(name = "NOMBMATERNO") + private String nombMaterno; + @Column(name = "FECNACIMIENTO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecNacimiento; + @Column(name = "FECINGRESO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecIngreso; + @Column(name = "FECBAJA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecBaja; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "TIPOEMPLEADO_ID", referencedColumnName = "TIPOEMPLEADO_ID") + @ManyToOne + private TipoEmpleado tipoEmpleado; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public String getCveEmpleado() { + return cveEmpleado; + } + + public void setCveEmpleado(String cveEmpleado) { + this.cveEmpleado = cveEmpleado; + } + + public Integer getEmpleadoId() { + return empleadoId; + } + + public void setEmpleadoId(Integer empleadoId) { + this.empleadoId = empleadoId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Date getFecBaja() { + return fecBaja; + } + + public void setFecBaja(Date fecBaja) { + this.fecBaja = fecBaja; + } + + public Date getFecIngreso() { + return fecIngreso; + } + + public void setFecIngreso(Date fecIngreso) { + this.fecIngreso = fecIngreso; + } + + public Date getFecNacimiento() { + return fecNacimiento; + } + + public void setFecNacimiento(Date fecNacimiento) { + this.fecNacimiento = fecNacimiento; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public String getNombEmpleado() { + return nombEmpleado; + } + + public void setNombEmpleado(String nombEmpleado) { + this.nombEmpleado = nombEmpleado; + } + + public String getNombMaterno() { + return nombMaterno; + } + + public void setNombMaterno(String nombMaterno) { + this.nombMaterno = nombMaterno; + } + + public String getNombPaterno() { + return nombPaterno; + } + + public void setNombPaterno(String nombPaterno) { + this.nombPaterno = nombPaterno; + } + + public TipoEmpleado getTipoEmpleado() { + return tipoEmpleado; + } + + public void setTipoEmpleado(TipoEmpleado tipoEmpleado) { + this.tipoEmpleado = tipoEmpleado; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (empleadoId != null ? empleadoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Empleado)) { + return false; + } + Empleado other = (Empleado) object; + if ((this.empleadoId == null && other.empleadoId != null) || (this.empleadoId != null && !this.empleadoId.equals(other.empleadoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getCveEmpleado(); + // return this.getNombPaterno() + getNombMaterno() + getNombEmpleado(); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Empresa.java b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java new file mode 100644 index 000000000..c53ebeca8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java @@ -0,0 +1,214 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "EMPRESA_SEQ", sequenceName = "EMPRESA_SEQ", allocationSize = 1) +@Table(name = "EMPRESA") +public class Empresa implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_SEQ") + @Column(name = "EMPRESA_ID") + private Integer empresaId; + @Column(name = "NOMBEMPRESA") + private String nombempresa; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "empresa") + private List puntoVentaList; + @Column(name = "INDEXTERNA") + private Boolean indExterna; + @Column(name = "INDTIPO") + private Short indTipo; + @Column(name = "INDPAGOCONDUCTOR") + private Boolean pagoConductor; + @OneToMany(mappedBy = "empresa") + private List corridaList; + @OneToMany(mappedBy = "empresa1") + private List corridaList1; + @Column(name = "EQUIVALENCIAELEKTRA_ID") + private String equivalenciaElektraId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "RFC") + private String rfc; + + public Empresa() { + } + + public Empresa(Integer empresaId) { + this.empresaId = empresaId; + } + + public Empresa(Integer empresaId, Date fecmodif) { + this.empresaId = empresaId; + this.fecmodif = fecmodif; + } + + public Integer getEmpresaId() { + return empresaId; + } + + public void setEmpresaId(Integer empresaId) { + this.empresaId = empresaId; + } + + public String getNombempresa() { + return nombempresa; + } + + public void setNombempresa(String nombempresa) { + this.nombempresa = nombempresa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getPuntoVentaList() { + return puntoVentaList; + } + + public void setPuntoVentaList(List puntoVentaList) { + this.puntoVentaList = puntoVentaList; + } + + public Boolean getIndExterna() { + return indExterna; + } + + public void setIndExterna(Boolean indExterna) { + this.indExterna = indExterna; + } + + public Short getIndTipo() { + return indTipo; + } + + public void setIndTipo(Short indTipo) { + this.indTipo = indTipo; + } + + public Boolean getPagoConductor() { + return pagoConductor; + } + + public void setPagoConductor(Boolean pagoConductor) { + this.pagoConductor = pagoConductor; + } + + public String getEquivalenciaElektraId() { + return equivalenciaElektraId; + } + + public void setEquivalenciaElektraId(String equivalenciaElektraId) { + this.equivalenciaElektraId = equivalenciaElektraId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public String getRfc() { + return rfc; + } + + public void setRfc(String rfc) { + this.rfc = rfc; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (empresaId != null ? empresaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Empresa)) { + return false; + } + Empresa other = (Empresa) object; + if ((this.empresaId == null && other.empresaId != null) || (this.empresaId != null && !this.empresaId.equals(other.empresaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getNombempresa(); + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public List getCorridaList1() { + return corridaList1; + } + + public void setCorridaList1(List corridaList1) { + this.corridaList1 = corridaList1; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EmpresaEquivalencia.java b/src/com/rjconsultores/ventaboletos/entidad/EmpresaEquivalencia.java new file mode 100644 index 000000000..21421e25b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EmpresaEquivalencia.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "EMPRESA_EQUIVALENCIA_SEQ", sequenceName = "EMPRESA_EQUIVALENCIA_SEQ", allocationSize = 1) +@Table(name = "EMPRESA_EQUIVALENCIA") +public class EmpresaEquivalencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "EMPRESAEQUIVALENCIA_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_EQUIVALENCIA_SEQ") + private Integer empresaequivalenciaId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @OneToOne + @JoinColumn(name = "COMISIONISTAEXTERNO_ID") + private ComisionistaExterno comisionistaExterno; + + public EmpresaEquivalencia() { + } + + public EmpresaEquivalencia(Integer empresaequivalenciaId) { + this.empresaequivalenciaId = empresaequivalenciaId; + } + + public Integer getEmpresaequivalenciaId() { + return empresaequivalenciaId; + } + + public void setEmpresaequivalenciaId(Integer empresaequivalenciaId) { + this.empresaequivalenciaId = empresaequivalenciaId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ComisionistaExterno getComisionistaExterno() { + return comisionistaExterno; + } + + public void setComisionistaExterno(ComisionistaExterno comisionistaExterno) { + this.comisionistaExterno = comisionistaExterno; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (empresaequivalenciaId != null ? empresaequivalenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EmpresaEquivalencia)) { + return false; + } + EmpresaEquivalencia other = (EmpresaEquivalencia) object; + if ((this.empresaequivalenciaId == null && other.empresaequivalenciaId != null) || (this.empresaequivalenciaId != null && !this.empresaequivalenciaId.equals(other.empresaequivalenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia[ empresaequivalenciaId=" + empresaequivalenciaId + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java new file mode 100644 index 000000000..122ee8a05 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ESQUEMA_ASIENTO_SEQ", sequenceName = "ESQUEMA_ASIENTO_SEQ",allocationSize=1) +@Table(name = "ESQUEMA_ASIENTO") +public class EsquemaAsiento implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "ESQUEMAASIENTO_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_ASIENTO_SEQ") + private Integer esquemaasientoId; + @Column(name = "NUMASIENTO") + private String numasiento; + @Column(name = "INDVENDIBLE") + private Boolean indvendible; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PARADA_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada; + @JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID") + @ManyToOne + private EsquemaCorrida esquemaCorrida; + + public EsquemaAsiento() { + } + + public EsquemaAsiento(Integer esquemaasientoId) { + this.esquemaasientoId = esquemaasientoId; + } + + public Integer getEsquemaasientoId() { + return esquemaasientoId; + } + + public void setEsquemaasientoId(Integer esquemaasientoId) { + this.esquemaasientoId = esquemaasientoId; + } + + public String getNumasiento() { + return numasiento; + } + + public void setNumasiento(String numasiento) { + this.numasiento = numasiento; + } + + public Boolean getIndvendible() { + return indvendible; + } + + public void setIndvendible(Boolean indvendible) { + this.indvendible = indvendible; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public EsquemaCorrida getEsquemaCorrida() { + return esquemaCorrida; + } + + public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + this.esquemaCorrida = esquemaCorrida; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (esquemaasientoId != null ? esquemaasientoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EsquemaAsiento)) { + return false; + } + EsquemaAsiento other = (EsquemaAsiento) object; + if ((this.esquemaasientoId == null && other.esquemaasientoId != null) || (this.esquemaasientoId != null && !this.esquemaasientoId.equals(other.esquemaasientoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.EsquemaAsiento[esquemaasientoId=" + esquemaasientoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java new file mode 100644 index 000000000..4fccf2333 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java @@ -0,0 +1,404 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ESQUEMA_CORRIDA_SEQ", sequenceName = "ESQUEMA_CORRIDA_SEQ", allocationSize = 1) +@Table(name = "ESQUEMA_CORRIDA") +public class EsquemaCorrida implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "ESQUEMACORRIDA_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_CORRIDA_SEQ") + private Integer esquemacorridaId; + @Column(name = "HORASALIDA") + @Temporal(TemporalType.TIME) + private Date horasalida; + @Column(name = "INDPISOEXTRA") + private Boolean pisoExtra; + @Column(name = "INDLUNES") + private Boolean indlunes; + @Column(name = "INDMARTES") + private Boolean indmartes; + @Column(name = "INDMIERCOLES") + private Boolean indmiercoles; + @Column(name = "INDJUEVES") + private Boolean indjueves; + @Column(name = "INDVIERNES") + private Boolean indviernes; + @Column(name = "INDSABADO") + private Boolean indsabado; + @Column(name = "INDDOMINGO") + private Boolean inddomingo; + @Column(name = "CANTPARADOS") + private Integer cantparados; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "DIAGRAMAAUTOBUS_ID") + private Integer diagramaAutobusId; + @Column(name = "STATUSCORRIDA") + private String statusCorrida; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + @JoinColumn(name = "ROLOPERATIVO_ID", referencedColumnName = "ROLOPERATIVO_ID") + @ManyToOne(cascade = CascadeType.ALL) + private RolOperativo rolOperativo; + @JoinColumn(name = "ROLOPERATIVO2_ID", referencedColumnName = "ROLOPERATIVO_ID") + @ManyToOne(cascade = CascadeType.ALL) + private RolOperativo rolOperativo2; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "ESQUEMAOPERACIONAL_ID", referencedColumnName = "ESQUEMAOPERACIONAL_ID") + @ManyToOne(cascade = CascadeType.ALL) + private EsquemaOperacional esquemaOperacional; + @JoinColumn(name = "EMPRESACORRIDA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "EMPRESAINGRESO_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa1; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "CLASESERVICIO2_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio2; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID") + private List esquemaTramoList; + @OneToMany + @JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID") + private List esquemaAsientoList; + @Column(name = "tipocorrida") + private String tipocorrida; + @JoinColumn(name = "ESQUEMAREBOTE_ID", referencedColumnName = "ESQUEMACORRIDA_ID") + @ManyToOne + private EsquemaCorrida esquemaCorridaRebote; + @JoinColumn(name = "DIVISION_ID", referencedColumnName = "DIVISION_ID") + @ManyToOne + private Division division; + + public String getTipocorrida() { + return tipocorrida; + } + + public void setTipocorrida(String tipocorrida) { + this.tipocorrida = tipocorrida; + } + + public EsquemaCorrida() { + } + + public EsquemaCorrida(Integer esquemacorridaId) { + this.esquemacorridaId = esquemacorridaId; + } + + public Integer getEsquemacorridaId() { + return esquemacorridaId; + } + + public void setEsquemacorridaId(Integer esquemacorridaId) { + this.esquemacorridaId = esquemacorridaId; + } + + public Date getHorasalida() { + return horasalida; + } + + public void setHorasalida(Date horasalida) { + this.horasalida = horasalida; + } + + public Integer getCantparados() { + return cantparados; + } + + public void setCantparados(Integer cantparados) { + this.cantparados = cantparados; + } + + public Boolean getInddomingo() { + return inddomingo; + } + + public void setInddomingo(Boolean inddomingo) { + this.inddomingo = inddomingo; + } + + public Boolean getIndjueves() { + return indjueves; + } + + public void setIndjueves(Boolean indjueves) { + this.indjueves = indjueves; + } + + public Boolean getIndlunes() { + return indlunes; + } + + public void setIndlunes(Boolean indlunes) { + this.indlunes = indlunes; + } + + public Boolean getIndmartes() { + return indmartes; + } + + public void setIndmartes(Boolean indmartes) { + this.indmartes = indmartes; + } + + public Boolean getIndmiercoles() { + return indmiercoles; + } + + public void setIndmiercoles(Boolean indmiercoles) { + this.indmiercoles = indmiercoles; + } + + public Boolean getIndsabado() { + return indsabado; + } + + public void setIndsabado(Boolean indsabado) { + this.indsabado = indsabado; + } + + public Boolean getIndviernes() { + return indviernes; + } + + public void setIndviernes(Boolean indviernes) { + this.indviernes = indviernes; + } + + public Date getFecmodif() { + return fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public RolOperativo getRolOperativo() { + return rolOperativo; + } + + public void setRolOperativo(RolOperativo rolOperativo) { + this.rolOperativo = rolOperativo; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public EsquemaOperacional getEsquemaOperacional() { + return esquemaOperacional; + } + + public void setEsquemaOperacional(EsquemaOperacional esquemaOperacional) { + this.esquemaOperacional = esquemaOperacional; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Empresa getEmpresa1() { + return empresa1; + } + + public void setEmpresa1(Empresa empresa1) { + this.empresa1 = empresa1; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public String getStatusCorrida() { + return statusCorrida; + } + + public void setStatusCorrida(String statusCorrida) { + this.statusCorrida = statusCorrida; + } + + public Integer getDiagramaAutobusId() { + return diagramaAutobusId; + } + + public void setDiagramaAutobusId(Integer diagramaAutobusId) { + this.diagramaAutobusId = diagramaAutobusId; + } + + public Division getDivision() { + return division; + } + + public void setDivision(Division division) { + this.division = division; + } + + public Boolean getPisoExtra() { + return pisoExtra; + } + + public void setPisoExtra(Boolean pisoExtra) { + this.pisoExtra = pisoExtra; + } + + public List getEsquemaTramoList() { + if (this.esquemaTramoList != null) { + List esquemaList = new ArrayList(); + + for (EsquemaTramo ec : this.esquemaTramoList) { + if (ec.getActivo() == Boolean.TRUE) { + esquemaList.add(ec); + } + } + return esquemaList; + } + return null; + + } + + public void setEsquemaTramoList(List esquemaTramoList) { + this.esquemaTramoList = esquemaTramoList; + } + + public List getEsquemaAsientoList() { + List esquemaList = new ArrayList(); + for (EsquemaAsiento ec : this.esquemaAsientoList) { + if (ec.getActivo() == Boolean.TRUE) { + esquemaList.add(ec); + } + } + return esquemaList; + } + + public void setEsquemaAsientoList(List esquemaAsientoList) { + this.esquemaAsientoList = esquemaAsientoList; + } + + public EsquemaCorrida getEsquemaCorridaRebote() { + return esquemaCorridaRebote; + } + + public void setEsquemaCorridaRebote(EsquemaCorrida esquemaCorridaRebote) { + this.esquemaCorridaRebote = esquemaCorridaRebote; + } + + public ClaseServicio getClaseServicio2() { + return claseServicio2; + } + + public void setClaseServicio2(ClaseServicio claseServicio2) { + this.claseServicio2 = claseServicio2; + } + + public RolOperativo getRolOperativo2() { + return rolOperativo2; + } + + public void setRolOperativo2(RolOperativo rolOperativo2) { + this.rolOperativo2 = rolOperativo2; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (esquemacorridaId != null ? esquemacorridaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EsquemaCorrida)) { + return false; + } + EsquemaCorrida other = (EsquemaCorrida) object; + if ((this.esquemacorridaId == null && other.esquemacorridaId != null) || (this.esquemacorridaId != null && !this.esquemacorridaId.equals(other.esquemacorridaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.EsquemaCorrida[esquemacorridaId=" + esquemacorridaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaOperacional.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaOperacional.java new file mode 100644 index 000000000..5d128074b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaOperacional.java @@ -0,0 +1,171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ESQUEMA_OPERACIONAL_SEQ", sequenceName = "ESQUEMA_OPERACIONAL_SEQ", allocationSize = 1) +@Table(name = "ESQUEMA_OPERACIONAL") +public class EsquemaOperacional implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "ESQUEMAOPERACIONAL_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_OPERACIONAL_SEQ") + private Integer esquemaoperacionalId; + @Column(name = "FECNICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinvigencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @OneToMany(mappedBy = "esquemaOperacional") + private List esquemaCorridaList; + + public EsquemaOperacional() { + } + + public EsquemaOperacional(Integer esquemaoperacionalId) { + this.esquemaoperacionalId = esquemaoperacionalId; + } + + public Integer getEsquemaoperacionalId() { + return esquemaoperacionalId; + } + + public void setEsquemaoperacionalId(Integer esquemaoperacionalId) { + this.esquemaoperacionalId = esquemaoperacionalId; + } + + public Date getFecniciovigencia() { + return fecniciovigencia; + } + + public void setFecniciovigencia(Date fecniciovigencia) { + if (fecniciovigencia != null) { + GregorianCalendar fecInicioVigenciaEsquema = new GregorianCalendar(); + + fecInicioVigenciaEsquema.setTime(fecniciovigencia); + fecInicioVigenciaEsquema.set(Calendar.SECOND, 0); + fecInicioVigenciaEsquema.set(Calendar.MILLISECOND, 0); + fecInicioVigenciaEsquema.set(Calendar.MINUTE, 0); + fecInicioVigenciaEsquema.set(Calendar.HOUR_OF_DAY, 0); + + fecniciovigencia = fecInicioVigenciaEsquema.getTime(); + } + this.fecniciovigencia = fecniciovigencia; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + if (fecfinvigencia != null) { + GregorianCalendar fecFinVigenciaEsquema = new GregorianCalendar(); + + fecFinVigenciaEsquema.setTime(fecfinvigencia); + fecFinVigenciaEsquema.set(Calendar.SECOND, 0); + fecFinVigenciaEsquema.set(Calendar.MILLISECOND, 0); + fecFinVigenciaEsquema.set(Calendar.MINUTE, 0); + fecFinVigenciaEsquema.set(Calendar.HOUR_OF_DAY, 0); + + fecfinvigencia = fecFinVigenciaEsquema.getTime(); + } + this.fecfinvigencia = fecfinvigencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public List getEsquemaCorridaList() { + List esquemaList = new ArrayList(); + for (EsquemaCorrida ec : this.esquemaCorridaList) { + if (ec.getActivo() == Boolean.TRUE) { + esquemaList.add(ec); + } + } + return esquemaList; + } + + public void setEsquemaCorridaList(List esquemaCorridaList) { + this.esquemaCorridaList = esquemaCorridaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (esquemaoperacionalId != null ? esquemaoperacionalId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EsquemaOperacional)) { + return false; + } + EsquemaOperacional other = (EsquemaOperacional) object; + if ((this.esquemaoperacionalId == null && other.esquemaoperacionalId != null) || (this.esquemaoperacionalId != null && !this.esquemaoperacionalId.equals(other.esquemaoperacionalId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.EsquemaOperacional[esquemaoperacionalId=" + esquemaoperacionalId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaTramo.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaTramo.java new file mode 100644 index 000000000..be0f99900 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaTramo.java @@ -0,0 +1,151 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ESQUEMA_TRAMO_SEQ", sequenceName = "ESQUEMA_TRAMO_SEQ", allocationSize = 1) +@Table(name = "ESQUEMA_TRAMO") +public class EsquemaTramo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "ESQUEMATRAMO_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_TRAMO_SEQ") + private Integer esquematramoId; + @Column(name = "NUMSECUENCIA") + private Short numsecuencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "TIEMPOESTANCIA") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date tiempoEstancia; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID") + @ManyToOne + private EsquemaCorrida esquemaCorrida; + + public Date getTiempoEstancia() { + return tiempoEstancia; + } + + public void setTiempoEstancia(Date tiempoEstancia) { + this.tiempoEstancia = tiempoEstancia; + } + + public EsquemaTramo() { + } + + public EsquemaTramo(Integer esquematramoId) { + this.esquematramoId = esquematramoId; + } + + public Integer getEsquematramoId() { + return esquematramoId; + } + + public void setEsquematramoId(Integer esquematramoId) { + this.esquematramoId = esquematramoId; + } + + public Short getNumsecuencia() { + return numsecuencia; + } + + public void setNumsecuencia(Short numsecuencia) { + this.numsecuencia = numsecuencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public EsquemaCorrida getEsquemaCorrida() { + return esquemaCorrida; + } + + public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + this.esquemaCorrida = esquemaCorrida; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (esquematramoId != null ? esquematramoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EsquemaTramo)) { + return false; + } + EsquemaTramo other = (EsquemaTramo) object; + if ((this.esquematramoId == null && other.esquematramoId != null) || (this.esquematramoId != null && !this.esquematramoId.equals(other.esquematramoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.test.EsquemaTramo[esquematramoId=" + esquematramoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Estacion.java b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java new file mode 100644 index 000000000..16ce25dbd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "ESTACION") +@SequenceGenerator(name = "ESTACION_SEQ", sequenceName = "ESTACION_SEQ", allocationSize = 1) +public class Estacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESTACION_SEQ") + @Column(name = "ESTACION_ID") + private Integer estacionId; + @Column(name = "NUMCAJA") + private Long numcaja; + @Column(name = "DESCESTACION") + private String descestacion; + @Column(name = "DESCMAC") + private String descmac; + @Column(name = "INDCONEXIONBANCARIA") + private String conexionBancaria; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "INDIMPRESIONPINPAD") + private Boolean pinPadImpresoraPropia; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "PUNTOVENTA_ID") + private PuntoVenta puntoVenta; + @OneToOne + @JoinColumn(name = "USUARIOBANCARIO_ID") + private UsuarioBancario usuarioBancario; + + public Estacion() { + } + + public Estacion(Integer estacionId) { + this.estacionId = estacionId; + } + + public Integer getEstacionId() { + return estacionId; + } + + public void setEstacionId(Integer estacionId) { + this.estacionId = estacionId; + } + + public Long getNumcaja() { + return numcaja; + } + + public void setNumcaja(Long numcaja) { + this.numcaja = numcaja; + } + + public String getDescestacion() { + return descestacion; + } + + public void setDescestacion(String descestacion) { + this.descestacion = descestacion; + } + + public String getDescmac() { + return descmac; + } + + public void setDescmac(String descmac) { + this.descmac = descmac; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public UsuarioBancario getUsuarioBancario() { + return usuarioBancario; + } + + public void setUsuarioBancario(UsuarioBancario usuarioBancario) { + this.usuarioBancario = usuarioBancario; + } + + public String getConexionBancaria() { + return conexionBancaria; + } + + public void setConexionBancaria(String conexionBancaria) { + this.conexionBancaria = conexionBancaria; + } + + public Boolean getPinPadImpresoraPropia() { + return pinPadImpresoraPropia; + } + + public void setPinPadImpresoraPropia(Boolean pinPadImpresoraPropia) { + this.pinPadImpresoraPropia = pinPadImpresoraPropia; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (estacionId != null ? estacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Estacion)) { + return false; + } + Estacion other = (Estacion) object; + if ((this.estacionId == null && other.estacionId != null) || (this.estacionId != null && !this.estacionId.equals(other.estacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Estacion[estacionId=" + estacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Estado.java b/src/com/rjconsultores/ventaboletos/entidad/Estado.java new file mode 100644 index 000000000..d5de8adf8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Estado.java @@ -0,0 +1,151 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ESTADO_SEQ", sequenceName = "ESTADO_SEQ", allocationSize = 1) +@Table(name = "ESTADO") +public class Estado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESTADO_SEQ") + @Basic(optional = false) + @Column(name = "ESTADO_ID") + private Integer estadoId; + @Column(name = "NOMBESTADO") + private String nombestado; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PAIS_ID", referencedColumnName = "PAIS_ID") + @ManyToOne + private Pais pais; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @OneToMany(mappedBy = "estado") + private List ciudadList; + + public Estado() { + } + + public Estado(Integer estadoId) { + this.estadoId = estadoId; + } + + public Integer getEstadoId() { + return estadoId; + } + + public void setEstadoId(Integer estadoId) { + this.estadoId = estadoId; + } + + public String getNombestado() { + return nombestado; + } + + public void setNombestado(String nombestado) { + this.nombestado = nombestado; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pais getPais() { + return pais; + } + + public void setPais(Pais pais) { + this.pais = pais; + } + + public List getCiudadList() { + return ciudadList; + } + + public void setCiudadList(List ciudadList) { + this.ciudadList = ciudadList; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (estadoId != null ? estadoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Estado)) { + return false; + } + Estado other = (Estado) object; + if ((this.estadoId == null && other.estadoId != null) || (this.estadoId != null && !this.estadoId.equals(other.estadoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getNombestado(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EventoExtra.java b/src/com/rjconsultores/ventaboletos/entidad/EventoExtra.java new file mode 100644 index 000000000..5e25cccf4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EventoExtra.java @@ -0,0 +1,249 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "EVENTO_EXTRA") +@SequenceGenerator(name = "EVENTO_EXTRA_SEQ", sequenceName = "EVENTO_EXTRA_SEQ", allocationSize = 1) +public class EventoExtra implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EVENTO_EXTRA_SEQ") + @Column(name = "EVENTOEXTRA_ID") + private Long eventoextraId; + @Column(name = "TIPOEVENTOEXTRA_ID") + private Integer tipoeventoextraId; + @Column(name = "FECHORINGRESO") + @Temporal(TemporalType.TIMESTAMP) + private Date fechoringreso; + @Column(name = "IMPINGRESO") + private BigDecimal impingreso; + @Column(name = "NUMDOCUMENTO") + private String numdocumento; + @Column(name = "IMPORTEIVA") + private BigDecimal importeiva; + @Column(name = "PUNTOVENTA_ID") + private Integer puntoventaId; + @Column(name = "FORMAPAGO_ID") + private Integer formapagoId; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "CANTBOLETOS") + private Short cantboletos; + @Column(name = "CORRIDA_ID") + private Integer corridaId; + @Column(name = "FECCORRIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date feccorrida; + @Column(name = "CONDUCTOR1_ID") + private Integer conductor1Id; + @Column(name = "EMPRESA_ID") + private Integer empresaId; + @Column(name = "CONDUCTOR2_ID") + private Integer conductor2Id; + @Column(name = "AUTOBUS") + private Integer autobus; + + public EventoExtra() { + } + + public EventoExtra(Long eventoextraId) { + this.eventoextraId = eventoextraId; + } + + public Long getEventoextraId() { + return eventoextraId; + } + + public void setEventoextraId(Long eventoextraId) { + this.eventoextraId = eventoextraId; + } + + public Integer getTipoeventoextraId() { + return tipoeventoextraId; + } + + public void setTipoeventoextraId(Integer tipoeventoextraId) { + this.tipoeventoextraId = tipoeventoextraId; + } + + public Date getFechoringreso() { + return fechoringreso; + } + + public void setFechoringreso(Date fechoringreso) { + this.fechoringreso = fechoringreso; + } + + public BigDecimal getImpingreso() { + return impingreso; + } + + public void setImpingreso(BigDecimal impingreso) { + this.impingreso = impingreso; + } + + public String getNumdocumento() { + return numdocumento; + } + + public void setNumdocumento(String numdocumento) { + this.numdocumento = numdocumento; + } + + public BigDecimal getImporteiva() { + return importeiva; + } + + public void setImporteiva(BigDecimal importeiva) { + this.importeiva = importeiva; + } + + public Integer getPuntoventaId() { + return puntoventaId; + } + + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public Integer getFormapagoId() { + return formapagoId; + } + + public void setFormapagoId(Integer formapagoId) { + this.formapagoId = formapagoId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Short getCantboletos() { + return cantboletos; + } + + public void setCantboletos(Short cantboletos) { + this.cantboletos = cantboletos; + } + + public Integer getCorridaId() { + return corridaId; + } + + public void setCorridaId(Integer corridaId) { + this.corridaId = corridaId; + } + + public Date getFeccorrida() { + return feccorrida; + } + + public void setFeccorrida(Date feccorrida) { + this.feccorrida = feccorrida; + } + + public Integer getConductor1Id() { + return conductor1Id; + } + + public void setConductor1Id(Integer conductor1Id) { + this.conductor1Id = conductor1Id; + } + + public Integer getEmpresaId() { + return empresaId; + } + + public void setEmpresaId(Integer empresaId) { + this.empresaId = empresaId; + } + + public Integer getConductor2Id() { + return conductor2Id; + } + + public void setConductor2Id(Integer conductor2Id) { + this.conductor2Id = conductor2Id; + } + + public Integer getAutobus() { + return autobus; + } + + public void setAutobus(Integer autobus) { + this.autobus = autobus; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (eventoextraId != null ? eventoextraId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof EventoExtra)) { + return false; + } + EventoExtra other = (EventoExtra) object; + if ((this.eventoextraId == null && other.eventoextraId != null) || (this.eventoextraId != null && !this.eventoextraId.equals(other.eventoextraId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.EventoExtra[eventoextraId=" + eventoextraId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ExcepcionRedondo.java b/src/com/rjconsultores/ventaboletos/entidad/ExcepcionRedondo.java new file mode 100644 index 000000000..68bb75d18 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ExcepcionRedondo.java @@ -0,0 +1,146 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "EXCEPCION_REDONDO_SEQ", sequenceName = "EXCEPCION_REDONDO_SEQ", allocationSize = 1) +@Table(name = "EXCEPCION_REDONDO") +public class ExcepcionRedondo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EXCEPCION_REDONDO_SEQ") + @Basic(optional = false) + @Column(name = "EXCEPCIONREDONDO_ID") + private Integer excepcionredondoId; + @Column(name = "INDTIPO") + private String indtipo; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "ORIGEN_ID") + private Parada origem; + @OneToOne + @JoinColumn(name = "DESTINO_ID") + private Parada destino; + + public ExcepcionRedondo() { + } + + public ExcepcionRedondo(Integer excepcionredondoId) { + this.excepcionredondoId = excepcionredondoId; + } + + public ExcepcionRedondo(Integer excepcionredondoId, Boolean activo) { + this.excepcionredondoId = excepcionredondoId; + this.activo = activo; + } + + public Integer getExcepcionredondoId() { + return excepcionredondoId; + } + + public void setExcepcionredondoId(Integer excepcionredondoId) { + this.excepcionredondoId = excepcionredondoId; + } + + public String getIndtipo() { + return indtipo; + } + + public void setIndtipo(String indtipo) { + this.indtipo = indtipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (excepcionredondoId != null ? excepcionredondoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ExcepcionRedondo)) { + return false; + } + ExcepcionRedondo other = (ExcepcionRedondo) object; + if ((this.excepcionredondoId == null && other.excepcionredondoId != null) || (this.excepcionredondoId != null && !this.excepcionredondoId.equals(other.excepcionredondoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo[excepcionredondoId=" + excepcionredondoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java b/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java new file mode 100644 index 000000000..222146b0d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java @@ -0,0 +1,158 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1) +@Table(name = "FORMA_PAGO") +public class FormaPago implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "FORMA_PAGO_SEQ") + @Column(name = "FORMAPAGO_ID") + private Short formapagoId; + @Column(name = "DESCPAGO") + private String descpago; + @Column(name = "INDOPERACION") + private Short indoperacion; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "formaPago") + private List configRestriccionPagoList; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + + public FormaPago() { + } + + public FormaPago(Short formapagoId) { + this.formapagoId = formapagoId; + } + + public Short getFormapagoId() { + return formapagoId; + } + + public void setFormapagoId(Short formapagoId) { + this.formapagoId = formapagoId; + } + + public String getDescpago() { + return descpago; + } + + public void setDescpago(String descpago) { + this.descpago = descpago; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Short getIndoperacion() { + return indoperacion; + } + + public void setIndoperacion(Short indoperacion) { + this.indoperacion = indoperacion; + } + + public List getConfigRestriccionPagoList() { + List tmp = new ArrayList(); + if (configRestriccionPagoList != null) { + for (ConfigRestriccionPago crp : this.configRestriccionPagoList) { + if (crp.getActivo()) { + tmp.add(crp); + } + } + } + + return tmp; + } + + public void setConfigRestriccionPagoList(List configRestriccionPagoList) { + this.configRestriccionPagoList = configRestriccionPagoList; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (formapagoId != null ? formapagoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof FormaPago)) { + return false; + } + FormaPago other = (FormaPago) object; + if ((this.formapagoId == null && other.formapagoId != null) || (this.formapagoId != null && !this.formapagoId.equals(other.formapagoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescpago(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/FormaPagoDet.java b/src/com/rjconsultores/ventaboletos/entidad/FormaPagoDet.java new file mode 100644 index 000000000..ead642b6a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/FormaPagoDet.java @@ -0,0 +1,153 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "FORMA_PAGO_DET_SEQ", sequenceName = "FORMA_PAGO_DET_SEQ", allocationSize = 1) +@Table(name = "FORMA_PAGO_DET") +public class FormaPagoDet implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "FORMAPAGODET_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "FORMA_PAGO_DET_SEQ") + private Integer formapagodetId; + @Column(name = "CARGOSEXTRAS") + private BigDecimal cargosextras; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + + + @OneToOne + @JoinColumn(name = "FORMAPAGO_ID") + private FormaPago formaPago; + + public FormaPagoDet() { + } + + public FormaPagoDet(Integer formapagodetId) { + this.formapagodetId = formapagodetId; + } + + public FormaPagoDet(Integer formapagodetId, Date fecmodif) { + this.formapagodetId = formapagodetId; + this.fecmodif = fecmodif; + } + + public Integer getFormapagodetId() { + return formapagodetId; + } + + public void setFormapagodetId(Integer formapagodetId) { + this.formapagodetId = formapagodetId; + } + + public BigDecimal getCargosextras() { + return cargosextras; + } + + public void setCargosextras(BigDecimal cargosextras) { + this.cargosextras = cargosextras; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + + @Override + public int hashCode() { + int hash = 0; + hash += (formapagodetId != null ? formapagodetId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof FormaPagoDet)) { + return false; + } + FormaPagoDet other = (FormaPagoDet) object; + if ((this.formapagodetId == null && other.formapagodetId != null) || (this.formapagodetId != null && !this.formapagodetId.equals(other.formapagodetId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.FormaPagoDet[formapagodetId=" + formapagodetId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/FuncionSistema.java b/src/com/rjconsultores/ventaboletos/entidad/FuncionSistema.java new file mode 100644 index 000000000..580c0e0bb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/FuncionSistema.java @@ -0,0 +1,151 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "FUNCION_SISTEMA") +@SequenceGenerator(name = "FUNCION_SISTEMA_SEQ", sequenceName = "FUNCION_SISTEMA_SEQ", allocationSize = 1) +public class FuncionSistema implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "FUNCIONSISTEMA_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "FUNCION_SISTEMA_SEQ") + private Integer funcionsistemaId; + @Column(name = "NOMBFUNCION") + private String nombfuncion; + @Column(name = "DESCRUTA") + private String descruta; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "funcionSistema") + private List perfilFuncionList; + @JoinColumn(name = "SISTEMA_ID", referencedColumnName = "SISTEMA_ID") + @ManyToOne + private Sistema sistema; + + public FuncionSistema() { + } + + public FuncionSistema(Integer funcionsistemaId) { + this.funcionsistemaId = funcionsistemaId; + } + + public Integer getFuncionsistemaId() { + return funcionsistemaId; + } + + public void setFuncionsistemaId(Integer funcionsistemaId) { + this.funcionsistemaId = funcionsistemaId; + } + + public String getNombfuncion() { + return nombfuncion; + } + + public void setNombfuncion(String nombfuncion) { + this.nombfuncion = nombfuncion; + } + + public String getDescruta() { + return descruta; + } + + public void setDescruta(String descruta) { + this.descruta = descruta; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getPerfilFuncionList() { + return perfilFuncionList; + } + + public void setPerfilFuncionList(List perfilFuncionList) { + this.perfilFuncionList = perfilFuncionList; + } + + public Sistema getSistema() { + return sistema; + } + + public void setSistema(Sistema sistema) { + this.sistema = sistema; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (funcionsistemaId != null ? funcionsistemaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof FuncionSistema)) { + return false; + } + FuncionSistema other = (FuncionSistema) object; + if ((this.funcionsistemaId == null && other.funcionsistemaId != null) || (this.funcionsistemaId != null && !this.funcionsistemaId.equals(other.funcionsistemaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNombfuncion(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GrupoCortesia.java b/src/com/rjconsultores/ventaboletos/entidad/GrupoCortesia.java new file mode 100644 index 000000000..6b4a589a5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GrupoCortesia.java @@ -0,0 +1,129 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "GRUPO_CORTESIA_SEQ", sequenceName = "GRUPO_CORTESIA_SEQ", allocationSize = 1) +@Table(name = "GRUPO_CORTESIA") +public class GrupoCortesia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GRUPO_CORTESIA_SEQ") + @Column(name = "GRUPOCORTESIA_ID") + private Short grupocortesiaId; + @Column(name = "DESCGRUPO") + private String descgrupo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "grupoCortesia") + private List tipoCortesiaList; + + public GrupoCortesia() { + } + + public GrupoCortesia(Short grupocortesiaId) { + this.grupocortesiaId = grupocortesiaId; + } + + public Short getGrupocortesiaId() { + return grupocortesiaId; + } + + public void setGrupocortesiaId(Short grupocortesiaId) { + this.grupocortesiaId = grupocortesiaId; + } + + public String getDescgrupo() { + return descgrupo; + } + + public void setDescgrupo(String descgrupo) { + this.descgrupo = descgrupo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(List tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (grupocortesiaId != null ? grupocortesiaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof GrupoCortesia)) { + return false; + } + GrupoCortesia other = (GrupoCortesia) object; + if ((this.grupocortesiaId == null && other.grupocortesiaId != null) || (this.grupocortesiaId != null && !this.grupocortesiaId.equals(other.grupocortesiaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescgrupo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Marca.java b/src/com/rjconsultores/ventaboletos/entidad/Marca.java new file mode 100644 index 000000000..d50f2ca7e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Marca.java @@ -0,0 +1,220 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "MARCA_SEQ", sequenceName = "MARCA_SEQ", allocationSize = 1) +@Table(name = "MARCA") +public class Marca implements Serializable { + + @OneToMany(mappedBy = "marca") + private List tarifaHistList; + @OneToMany(mappedBy = "marca") + private List corridaList; + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MARCA_SEQ") + @Column(name = "MARCA_ID") + private Short marcaId; + @Column(name = "DESCMARCA") + private String descmarca; + @Lob + @Column(name = "LOGOTIPOMARCA") + private byte[] logotipomarca; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "marca") + private List categoriaMarcaList; + @OneToMany(mappedBy = "marca") + private List reservacionMarcaList; + @OneToMany(mappedBy = "marca") + private List cancelacionCtrlList; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + + + public Marca() { + } + + public Marca(Short marcaId) { + this.marcaId = marcaId; + } + + public Marca(Short marcaId, Date fecmodif) { + this.marcaId = marcaId; + this.fecmodif = fecmodif; + } + + public Marca(Short marcaId, String descMarca) { + this.marcaId = marcaId; + this.descmarca = descMarca; + } + + public Short getMarcaId() { + return marcaId; + } + + public void setMarcaId(Short marcaId) { + this.marcaId = marcaId; + } + + public String getDescmarca() { + return descmarca; + } + + public void setDescmarca(String descmarca) { + this.descmarca = descmarca; + } + + public byte[] getLogotipomarca() { + return logotipomarca; + } + + public void setLogotipomarca(byte[] logotipomarca) { + this.logotipomarca = logotipomarca; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCategoriaMarcaList() { + List tmp = new ArrayList(); + if (categoriaMarcaList != null) { + for (CategoriaMarca cm : this.categoriaMarcaList) { + if (cm.getActivo()) { + tmp.add(cm); + } + } + } + + return tmp; + } + + public void setCategoriaMarcaList(List categoriaMarcaList) { + this.categoriaMarcaList = categoriaMarcaList; + } + + public List getReservacionMarcaList() { + List tmp = new ArrayList(); + for (ReservacionMarca rm : this.reservacionMarcaList) { + if (rm.getActivo()) { + tmp.add(rm); + } + } + + return tmp; + } + + public void setReservacionMarcaList(List reservacionMarcaList) { + this.reservacionMarcaList = reservacionMarcaList; + } + + public List getCancelacionCtrlList() { + return cancelacionCtrlList; + } + + public void setCancelacionCtrlList(List cancelacionCtrlList) { + this.cancelacionCtrlList = cancelacionCtrlList; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (marcaId != null ? marcaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Marca)) { + return false; + } + Marca other = (Marca) object; + if ((this.marcaId == null && other.marcaId != null) || (this.marcaId != null && !this.marcaId.equals(other.marcaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescmarca(); + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public List getTarifaHistList() { + return tarifaHistList; + } + + public void setTarifaHistList(List tarifaHistList) { + this.tarifaHistList = tarifaHistList; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicio.java b/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicio.java new file mode 100644 index 000000000..c10952ad4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicio.java @@ -0,0 +1,94 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "MARCA_CLASESERVICIO") +public class MarcaClaseServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @EmbeddedId + protected MarcaClaseServicioPK marcaClaseservicioPK; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public MarcaClaseServicio() { + } + + public MarcaClaseServicioPK getMarcaClaseservicioPK() { + return marcaClaseservicioPK; + } + + public void setMarcaClaseservicioPK(MarcaClaseServicioPK marcaClaseservicioPK) { + this.marcaClaseservicioPK = marcaClaseservicioPK; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (marcaClaseservicioPK != null ? marcaClaseservicioPK.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MarcaClaseServicio)) { + return false; + } + MarcaClaseServicio other = (MarcaClaseServicio) object; + if ((this.marcaClaseservicioPK == null && other.marcaClaseservicioPK != null) || (this.marcaClaseservicioPK != null && !this.marcaClaseservicioPK.equals(other.marcaClaseservicioPK))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.MarcaClaseservicio[marcaClaseservicioPK=" + marcaClaseservicioPK + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicioPK.java b/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicioPK.java new file mode 100644 index 000000000..6b79b07b3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MarcaClaseServicioPK.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Embeddable; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; + +/** + * + * @author Administrador + */ +@Embeddable +public class MarcaClaseServicioPK implements Serializable { + + @Basic(optional = false) + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseservicio; + @Basic(optional = false) + @OneToOne + @JoinColumn(name = "MARCA_ID") + private Marca marca; + + public MarcaClaseServicioPK() { + } + + public ClaseServicio getClaseservicio() { + return claseservicio; + } + + public void setClaseservicio(ClaseServicio claseservicio) { + this.claseservicio = claseservicio; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MercadoCompetido.java b/src/com/rjconsultores/ventaboletos/entidad/MercadoCompetido.java new file mode 100644 index 000000000..832dcdb0d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MercadoCompetido.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "MERCADO_COMPETIDO_SEQ", sequenceName = "MERCADO_COMPETIDO_SEQ", allocationSize = 1) +@Table(name = "MERCADO_COMPETIDO") +public class MercadoCompetido implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MERCADO_COMPETIDO_SEQ") + @Basic(optional = false) + @Column(name = "MERCADOCOMPETIDO_ID") + private Integer mercadocompetidoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public MercadoCompetido() { + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getMercadocompetidoId() { + return mercadocompetidoId; + } + + public void setMercadocompetidoId(Integer mercadocompetidoId) { + this.mercadocompetidoId = mercadocompetidoId; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (mercadocompetidoId != null ? mercadocompetidoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MercadoCompetido)) { + return false; + } + MercadoCompetido other = (MercadoCompetido) object; + if ((this.mercadocompetidoId == null && other.mercadocompetidoId != null) || (this.mercadocompetidoId != null && !this.mercadocompetidoId.equals(other.mercadocompetidoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "newpackage.MercadoCompetido[mercadocompetidoId=" + mercadocompetidoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MerchantBancario.java b/src/com/rjconsultores/ventaboletos/entidad/MerchantBancario.java new file mode 100644 index 000000000..4bf33934d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MerchantBancario.java @@ -0,0 +1,155 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "MERCHANT_BANCARIO_SEQ", sequenceName = "MERCHANT_BANCARIO_SEQ", allocationSize = 1) +@Table(name = "MERCHANT_BANCARIO") +public class MerchantBancario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MERCHANT_BANCARIO_SEQ") + @Column(name = "MERCHANTBANCARIO_ID") + private Integer merchantbancarioId; + @Column(name = "CVEMERCHANT") + private String cvemerchant; + @Column(name = "DESCMERCHANT") + private String descmerchant; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @JoinColumn(name = "COMPANIABANCARIA_ID", referencedColumnName = "COMPANIABANCARIA_ID") + @ManyToOne(optional = false) + private CompaniaBancaria companiaBancaria; + + public MerchantBancario() { + } + + public MerchantBancario(Integer merchantbancarioId) { + this.merchantbancarioId = merchantbancarioId; + } + + public MerchantBancario(Integer merchantbancarioId, Boolean activo) { + this.merchantbancarioId = merchantbancarioId; + this.activo = activo; + } + + public Integer getMerchantbancarioId() { + return merchantbancarioId; + } + + public void setMerchantbancarioId(Integer merchantbancarioId) { + this.merchantbancarioId = merchantbancarioId; + } + + public String getCvemerchant() { + return cvemerchant; + } + + public void setCvemerchant(String cvemerchant) { + this.cvemerchant = cvemerchant; + } + + public String getDescmerchant() { + return descmerchant; + } + + public void setDescmerchant(String descmerchant) { + this.descmerchant = descmerchant; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public CompaniaBancaria getCompaniaBancaria() { + return companiaBancaria; + } + + public void setCompaniaBancaria(CompaniaBancaria companiaBancaria) { + this.companiaBancaria = companiaBancaria; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final MerchantBancario other = (MerchantBancario) obj; + if ((this.cvemerchant == null) ? (other.cvemerchant != null) : !this.cvemerchant.equals(other.cvemerchant)) { + return false; + } + if ((this.descmerchant == null) ? (other.descmerchant != null) : !this.descmerchant.equals(other.descmerchant)) { + return false; + } + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 53 * hash + (this.cvemerchant != null ? this.cvemerchant.hashCode() : 0); + hash = 53 * hash + (this.descmerchant != null ? this.descmerchant.hashCode() : 0); + hash = 53 * hash + (this.activo != null ? this.activo.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.MerchantBancario[merchantbancarioId=" + merchantbancarioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Moneda.java b/src/com/rjconsultores/ventaboletos/entidad/Moneda.java new file mode 100644 index 000000000..0231acef8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Moneda.java @@ -0,0 +1,148 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "MONEDA_SEQ", sequenceName = "MONEDA_SEQ", allocationSize = 1) +@Table(name = "MONEDA") +public class Moneda implements Serializable { + + @OneToMany(mappedBy = "moneda") + private List tarifaHistList; + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MONEDA_SEQ") + @Column(name = "MONEDA_ID") + private Integer monedaId; + @Column(name = "DESCMONEDA") + private String descmoneda; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "moneda") + private List puntoVentaList; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + + public Moneda() { + } + + public Moneda(Integer monedaId) { + this.monedaId = monedaId; + } + + public Integer getMonedaId() { + return monedaId; + } + + public void setMonedaId(Integer monedaId) { + this.monedaId = monedaId; + } + + public String getDescmoneda() { + return descmoneda; + } + + public void setDescmoneda(String descmoneda) { + this.descmoneda = descmoneda; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getPuntoVentaList() { + return puntoVentaList; + } + + public void setPuntoVentaList(List puntoVentaList) { + this.puntoVentaList = puntoVentaList; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (monedaId != null ? monedaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Moneda)) { + return false; + } + Moneda other = (Moneda) object; + if ((this.monedaId == null && other.monedaId != null) || (this.monedaId != null && !this.monedaId.equals(other.monedaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescmoneda(); + } + + public List getTarifaHistList() { + return tarifaHistList; + } + + public void setTarifaHistList(List tarifaHistList) { + this.tarifaHistList = tarifaHistList; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MotivoCancelacion.java b/src/com/rjconsultores/ventaboletos/entidad/MotivoCancelacion.java new file mode 100644 index 000000000..b0d00c488 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MotivoCancelacion.java @@ -0,0 +1,126 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "MOTIVO_CANCELACION_SEQ", sequenceName = "MOTIVO_CANCELACION_SEQ", allocationSize = 1) +@Table(name = "MOTIVO_CANCELACION") +public class MotivoCancelacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MOTIVO_CANCELACION_SEQ") + @Column(name = "MOTIVOCANCELACION_ID") + private Integer motivocancelacionId; + @Column(name = "DESCMOTIVO") + private String descmotivo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "TIPOMOTIVO") + private String tipomotivo; + + public MotivoCancelacion() { + } + + public MotivoCancelacion(Integer motivocancelacionId) { + this.motivocancelacionId = motivocancelacionId; + } + + public Integer getMotivocancelacionId() { + return motivocancelacionId; + } + + public void setMotivocancelacionId(Integer motivocancelacionId) { + this.motivocancelacionId = motivocancelacionId; + } + + public String getDescmotivo() { + return descmotivo; + } + + public void setDescmotivo(String descmotivo) { + this.descmotivo = descmotivo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getTipomotivo() { + return tipomotivo; + } + + public void setTipomotivo(String tipomotivo) { + this.tipomotivo = tipomotivo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (motivocancelacionId != null ? motivocancelacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MotivoCancelacion)) { + return false; + } + MotivoCancelacion other = (MotivoCancelacion) object; + if ((this.motivocancelacionId == null && other.motivocancelacionId != null) || (this.motivocancelacionId != null && !this.motivocancelacionId.equals(other.motivocancelacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescmotivo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MotivoReimpresion.java b/src/com/rjconsultores/ventaboletos/entidad/MotivoReimpresion.java new file mode 100644 index 000000000..18347ba7d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MotivoReimpresion.java @@ -0,0 +1,122 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "MOTIVO_REIMPRESION_SEQ", sequenceName = "MOTIVO_REIMPRESION_SEQ", allocationSize=1) +@Table(name = "MOTIVO_REIMPRESION") +public class MotivoReimpresion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MOTIVO_REIMPRESION_SEQ") + @Column(name = "MOTIVOREIMPRESION_ID") + private Integer motivoreimpresionId; + @Column(name = "DESCMOTIVO") + private String descmotivo; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public MotivoReimpresion() { + } + + public MotivoReimpresion(Integer motivoreimpresionId) { + this.motivoreimpresionId = motivoreimpresionId; + } + + public MotivoReimpresion(Integer motivoreimpresionId, Date fecmodif) { + this.motivoreimpresionId = motivoreimpresionId; + this.fecmodif = fecmodif; + } + + public Integer getMotivoreimpresionId() { + return motivoreimpresionId; + } + + public void setMotivoreimpresionId(Integer motivoreimpresionId) { + this.motivoreimpresionId = motivoreimpresionId; + } + + public String getDescmotivo() { + return descmotivo; + } + + public void setDescmotivo(String descmotivo) { + this.descmotivo = descmotivo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (motivoreimpresionId != null ? motivoreimpresionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MotivoReimpresion)) { + return false; + } + MotivoReimpresion other = (MotivoReimpresion) object; + if ((this.motivoreimpresionId == null && other.motivoreimpresionId != null) || (this.motivoreimpresionId != null && !this.motivoreimpresionId.equals(other.motivoreimpresionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.MotivoReimpresion[motivoreimpresionId=" + motivoreimpresionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MotivoViaje.java b/src/com/rjconsultores/ventaboletos/entidad/MotivoViaje.java new file mode 100644 index 000000000..db7d21459 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MotivoViaje.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "MOTIVO_VIAJE_SEQ", sequenceName = "MOTIVO_VIAJE_SEQ", allocationSize = 1) +@Table(name = "MOTIVO_VIAJE") +public class MotivoViaje implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MOTIVO_VIAJE_SEQ") + @Column(name = "MOTIVOVIAJE_ID") + private Integer motivoViajeId; + @Column(name = "CVEMOTIVOVIAJE") + private String cveMotivoViaje; + @Column(name = "DESCMOTIVOVIAJE") + private String descMotivoViaje; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "motivoViaje") + private List cortesiaList; + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public List getCortesiaList() { + return cortesiaList; + } + + public void setCortesiaList(List cortesiaList) { + this.cortesiaList = cortesiaList; + } + + public String getCveMotivoViaje() { + return cveMotivoViaje; + } + + public void setCveMotivoViaje(String cveMotivoViaje) { + this.cveMotivoViaje = cveMotivoViaje; + } + + public String getDescMotivoViaje() { + return descMotivoViaje; + } + + public void setDescMotivoViaje(String descMotivoViaje) { + this.descMotivoViaje = descMotivoViaje; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getMotivoViajeId() { + return motivoViajeId; + } + + public void setMotivoViajeId(Integer motivoViajeId) { + this.motivoViajeId = motivoViajeId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (motivoViajeId != null ? motivoViajeId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MotivoViaje)) { + return false; + } + MotivoViaje other = (MotivoViaje) object; + if ((this.motivoViajeId == null && other.motivoViajeId != null) || (this.motivoViajeId != null && !this.motivoViajeId.equals(other.motivoViajeId))) { + return false; + } + return true; + } + + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.GrupoCortesias[grupocortesiaId=" + grupocortesiaId + "]"; + return this.getDescMotivoViaje(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/MotivocancelacionEquivalencia.java b/src/com/rjconsultores/ventaboletos/entidad/MotivocancelacionEquivalencia.java new file mode 100644 index 000000000..0ecf7665f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/MotivocancelacionEquivalencia.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "MOTIVOCANC_EQUIVALENCIA_SEQ", sequenceName = "MOTIVOCANC_EQUIVALENCIA_SEQ", allocationSize = 1) +@Table(name = "MOTIVOCANCELACION_EQUIVALENCIA") +public class MotivocancelacionEquivalencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "MOTIVOCANC_EQUIVALENCIA_SEQ") + @Basic(optional = false) + @Column(name = "MOTIVOEQUIVALENCIA_ID") + private Integer motivoequivalenciaId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "MOTIVOCANCELACION_ID") + private MotivoCancelacion motivoCancelacion; + @OneToOne + @JoinColumn(name = "COMISIONISTAEXTERNO_ID") + private ComisionistaExterno comisionistaExterno; + + public MotivocancelacionEquivalencia() { + } + + public MotivocancelacionEquivalencia(Integer motivoequivalenciaId) { + this.motivoequivalenciaId = motivoequivalenciaId; + } + + public Integer getMotivoequivalenciaId() { + return motivoequivalenciaId; + } + + public void setMotivoequivalenciaId(Integer motivoequivalenciaId) { + this.motivoequivalenciaId = motivoequivalenciaId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ComisionistaExterno getComisionistaExterno() { + return comisionistaExterno; + } + + public void setComisionistaExterno(ComisionistaExterno comisionistaExterno) { + this.comisionistaExterno = comisionistaExterno; + } + + public MotivoCancelacion getMotivoCancelacion() { + return motivoCancelacion; + } + + public void setMotivoCancelacion(MotivoCancelacion motivoCancelacion) { + this.motivoCancelacion = motivoCancelacion; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (motivoequivalenciaId != null ? motivoequivalenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof MotivocancelacionEquivalencia)) { + return false; + } + MotivocancelacionEquivalencia other = (MotivocancelacionEquivalencia) object; + if ((this.motivoequivalenciaId == null && other.motivoequivalenciaId != null) || (this.motivoequivalenciaId != null && !this.motivoequivalenciaId.equals(other.motivoequivalenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia[ motivoequivalenciaId=" + motivoequivalenciaId + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Nodo.java b/src/com/rjconsultores/ventaboletos/entidad/Nodo.java new file mode 100644 index 000000000..82f49bd06 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Nodo.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "NODO_SEQ", sequenceName = "NODO_SEQ", allocationSize=1) +@Table(name = "NODO") +public class Nodo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "NODO_SEQ") + @Basic(optional = false) + @Column(name = "NODO_ID") + private Integer nodoId; + @Column(name = "DESCNODO") + private String descnodo; + @Column(name = "INDCONTINGENCIA") + private Short indcontingencia; + @Column(name = "DIRECCIONNODO") + private String direccionnodo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Nodo() { + } + + public Nodo(Integer nodoId) { + this.nodoId = nodoId; + } + + public Integer getNodoId() { + return nodoId; + } + + public void setNodoId(Integer nodoId) { + this.nodoId = nodoId; + } + + public String getDescnodo() { + return descnodo; + } + + public void setDescnodo(String descnodo) { + this.descnodo = descnodo; + } + + public Short getIndcontingencia() { + return indcontingencia; + } + + public void setIndcontingencia(Short indcontingencia) { + this.indcontingencia = indcontingencia; + } + + public String getDireccionnodo() { + return direccionnodo; + } + + public void setDireccionnodo(String direccionnodo) { + this.direccionnodo = direccionnodo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (nodoId != null ? nodoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Nodo)) { + return false; + } + Nodo other = (Nodo) object; + if ((this.nodoId == null && other.nodoId != null) || (this.nodoId != null && !this.nodoId.equals(other.nodoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescnodo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Pais.java b/src/com/rjconsultores/ventaboletos/entidad/Pais.java new file mode 100644 index 000000000..fca72e805 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Pais.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PAIS_SEQ", sequenceName = "PAIS_SEQ", allocationSize = 1) +@Table(name = "PAIS") +public class Pais implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PAIS_SEQ") + @Basic(optional = false) + @Column(name = "PAIS_ID") + private Integer paisId; + @Column(name = "NOMBPAIS") + private String nombpais; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "pais") + private List estadoList; + + public Pais() { + } + + public Pais(Integer paisId) { + this.paisId = paisId; + } + + public Integer getPaisId() { + return paisId; + } + + public void setPaisId(Integer paisId) { + this.paisId = paisId; + } + + public String getNombpais() { + return nombpais; + } + + public void setNombpais(String nombpais) { + this.nombpais = nombpais; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getEstadoList() { + return estadoList; + } + + public void setEstadoList(List estadoList) { + this.estadoList = estadoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paisId != null ? paisId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Pais)) { + return false; + } + Pais other = (Pais) object; + if ((this.paisId == null && other.paisId != null) || (this.paisId != null && !this.paisId.equals(other.paisId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getNombpais(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Parada.java b/src/com/rjconsultores/ventaboletos/entidad/Parada.java new file mode 100644 index 000000000..b29024e02 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Parada.java @@ -0,0 +1,245 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "PARADA_SEQ", sequenceName = "PARADA_SEQ", allocationSize = 1) +@Table(name = "PARADA") +public class Parada implements Serializable { + public static Integer ID_PARADA_TODOS = -1; + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARADA_SEQ") + @Column(name = "PARADA_ID") + private Integer paradaId; + @Basic(optional = false) + @Column(name = "DESCPARADA") + private String descparada; + @Column(name = "CVEPARADA") + private String cveparada; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "CIUDAD_ID") + private Ciudad ciudad; + @OneToOne + @JoinColumn(name = "TIPOPARADA_ID") + private TipoParada tipoParada; + @OneToMany(mappedBy = "origem") + private List corridaList; + @OneToMany(mappedBy = "destino") + private List corridaList1; + @OneToMany(mappedBy = "paradaOrigem") + private List reservacionMercadoList; + @OneToMany(mappedBy = "paradaDestino") + private List reservacionMercadoList1; + @OneToMany(mappedBy = "destino") + private List categoriaMercadoDestinoList; + @OneToMany(mappedBy = "origem") + private List categoriaMercadoOrigemList; + @OneToOne + @JoinColumn(name = "NODO_ID") + private Nodo nodo; + @OneToMany(mappedBy = "origem") + private List tramoOrigemList; + @OneToMany(mappedBy = "destino") + private List tramoDestinoList; + + public Parada() { + } + + public List getCategoriaMercadoDestinoList() { + return categoriaMercadoDestinoList; + } + + public void setCategoriaMercadoDestinoList(List categoriaMercadoDestinoList) { + this.categoriaMercadoDestinoList = categoriaMercadoDestinoList; + } + + public List getCategoriaMercadoOrigemList() { + return categoriaMercadoOrigemList; + } + + public void setCategoriaMercadoOrigemList(List categoriaMercadoOrigemList) { + this.categoriaMercadoOrigemList = categoriaMercadoOrigemList; + } + + public String getDescparada() { + return descparada; + } + + public void setDescparada(String descparada) { + this.descparada = descparada; + } + + public Integer getParadaId() { + return paradaId; + } + + public void setParadaId(Integer paradaId) { + this.paradaId = paradaId; + } + + public List getReservacionMercadoList() { + return reservacionMercadoList; + } + + public void setReservacionMercadoList(List reservacionMercadoList) { + this.reservacionMercadoList = reservacionMercadoList; + } + + public List getReservacionMercadoList1() { + return reservacionMercadoList1; + } + + public void setReservacionMercadoList1(List reservacionMercadoList1) { + this.reservacionMercadoList1 = reservacionMercadoList1; + } + + public String getCveparada() { + return cveparada; + } + + public void setCveparada(String cveparada) { + this.cveparada = cveparada; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + public List getCorridaList1() { + return corridaList1; + } + + public void setCorridaList1(List corridaList1) { + this.corridaList1 = corridaList1; + } + + public List getTramoDestinoList() { + return tramoDestinoList; + } + + public void setTramoDestinoList(List tramoDestinoList) { + this.tramoDestinoList = tramoDestinoList; + } + + public List getTramoOrigemList() { + return tramoOrigemList; + } + + public void setTramoOrigemList(List tramoOrigemList) { + this.tramoOrigemList = tramoOrigemList; + } + + public Ciudad getCiudad() { + return ciudad; + } + + public void setCiudad(Ciudad ciudad) { + this.ciudad = ciudad; + } + + public TipoParada getTipoParada() { + return tipoParada; + } + + public void setTipoParada(TipoParada tipoParada) { + this.tipoParada = tipoParada; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paradaId != null ? paradaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Parada)) { + return false; + } + Parada other = (Parada) object; + if ((this.paradaId == null && other.paradaId != null) || (this.paradaId != null && !this.paradaId.equals(other.paradaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescparada(); + } + + public String toStringCve() { + return getCveparada(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParadaEquivalencia.java b/src/com/rjconsultores/ventaboletos/entidad/ParadaEquivalencia.java new file mode 100644 index 000000000..1613b86d2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParadaEquivalencia.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "PARADA_EQUIVALENCIA") +@SequenceGenerator(name = "PARADA_EQUIVALENCIA_SEQ", sequenceName = "PARADA_EQUIVALENCIA_SEQ", allocationSize = 1) +public class ParadaEquivalencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARADA_EQUIVALENCIA_SEQ") + @Basic(optional = false) + @Column(name = "PARADAEQUIVALENCIA_ID") + private Integer paradaequivalenciaId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "PARADA_ID") + private Parada parada; + @OneToOne + @JoinColumn(name = "COMISIONISTAEXTERNO_ID") + private ComisionistaExterno comisionistaExterno; + + public ParadaEquivalencia() { + } + + public ParadaEquivalencia(Integer paradaequivalenciaId) { + this.paradaequivalenciaId = paradaequivalenciaId; + } + + public Integer getParadaequivalenciaId() { + return paradaequivalenciaId; + } + + public void setParadaequivalenciaId(Integer paradaequivalenciaId) { + this.paradaequivalenciaId = paradaequivalenciaId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public ComisionistaExterno getComisionistaExterno() { + return comisionistaExterno; + } + + public void setComisionistaExterno(ComisionistaExterno comisionistaExterno) { + this.comisionistaExterno = comisionistaExterno; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paradaequivalenciaId != null ? paradaequivalenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParadaEquivalencia)) { + return false; + } + ParadaEquivalencia other = (ParadaEquivalencia) object; + if ((this.paradaequivalenciaId == null && other.paradaequivalenciaId != null) || (this.paradaequivalenciaId != null && !this.paradaequivalenciaId.equals(other.paradaequivalenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia[ paradaequivalenciaId=" + paradaequivalenciaId + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParadaEsquema.java b/src/com/rjconsultores/ventaboletos/entidad/ParadaEsquema.java new file mode 100644 index 000000000..f6d7aaf13 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParadaEsquema.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.util.Date; + +/** + * + * @author Administrador + */ +public class ParadaEsquema { + + private Short numsecuencia; + private Date tiempoEstancia; + private Parada parada; + private Boolean activo; + + public ParadaEsquema() { + } + + public Short getNumsecuencia() { + return numsecuencia; + } + + public void setNumsecuencia(Short numsecuencia) { + this.numsecuencia = numsecuencia; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public Date getTiempoEstancia() { + return tiempoEstancia; + } + + public void setTiempoEstancia(Date tiempoEstancia) { + this.tiempoEstancia = tiempoEstancia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParadaSecuencia.java b/src/com/rjconsultores/ventaboletos/entidad/ParadaSecuencia.java new file mode 100644 index 000000000..8ebf082ce --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParadaSecuencia.java @@ -0,0 +1,43 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +/** + * + * @author Administrador + */ +public class ParadaSecuencia { + + private Short secuencia; + private Parada parada; + private Via via; + + public ParadaSecuencia() { + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public Short getSecuencia() { + return secuencia; + } + + public void setSecuencia(Short secuencia) { + this.secuencia = secuencia; + } + + public Via getVia() { + return via; + } + + public void setVia(Via via) { + this.via = via; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaMasivo.java b/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaMasivo.java new file mode 100644 index 000000000..90f2b7f3b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaMasivo.java @@ -0,0 +1,159 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PARAM_ACUMULA_MASIVO_SEQ", sequenceName = "PARAM_ACUMULA_MASIVO_SEQ", allocationSize = 1) +@Table(name = "PARAM_ACUMULA_MASIVO") +public class ParamAcumulaMasivo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_ACUMULA_MASIVO_SEQ") + @Column(name = "PARAMACUMULAMASIVO") + private Integer paramacumulamasivo; + @Column(name = "MAXPUNTOOTORGA") + private Integer maxpuntootorga; + @Column(name = "MINPUNTOOTORGA") + private Integer minpuntootorga; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date feciniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinvigencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + + public ParamAcumulaMasivo() { + } + + public ParamAcumulaMasivo(Integer paramacumulamasivo) { + this.paramacumulamasivo = paramacumulamasivo; + } + + public Integer getParamacumulamasivo() { + return paramacumulamasivo; + } + + public void setParamacumulamasivo(Integer paramacumulamasivo) { + this.paramacumulamasivo = paramacumulamasivo; + } + + public Integer getMaxpuntootorga() { + return maxpuntootorga; + } + + public void setMaxpuntootorga(Integer maxpuntootorga) { + this.maxpuntootorga = maxpuntootorga; + } + + public Integer getMinpuntootorga() { + return minpuntootorga; + } + + public void setMinpuntootorga(Integer minpuntootorga) { + this.minpuntootorga = minpuntootorga; + } + + public Date getFeciniciovigencia() { + return feciniciovigencia; + } + + public void setFeciniciovigencia(Date feciniciovigencia) { + this.feciniciovigencia = feciniciovigencia; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramacumulamasivo != null ? paramacumulamasivo.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamAcumulaMasivo)) { + return false; + } + ParamAcumulaMasivo other = (ParamAcumulaMasivo) object; + if ((this.paramacumulamasivo == null && other.paramacumulamasivo != null) || (this.paramacumulamasivo != null && !this.paramacumulamasivo.equals(other.paramacumulamasivo))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.dao.ParamAcumulaMasivo[paramacumulamasivo=" + paramacumulamasivo + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaPunto.java b/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaPunto.java new file mode 100644 index 000000000..d9594a0b0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamAcumulaPunto.java @@ -0,0 +1,226 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PARAM_ACUMULA_PUNTO_SEQ", sequenceName = "PARAM_ACUMULA_PUNTO_SEQ", allocationSize = 1) +@Table(name = "PARAM_ACUMULA_PUNTO") +public class ParamAcumulaPunto implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_ACUMULA_PUNTO_SEQ") + @Column(name = "PARAMACUMULAPUNTO_ID") + private Integer paramacumulapuntoId; + @Column(name = "CANTOPERACIONDIA") + private Short cantoperaciondia; + @Column(name = "CANTBOLETOOPERACION") + private Integer cantboletooperacion; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date feciniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinvigencia; + @Column(name = "PORCCLIENTE") + private BigDecimal porccliente; + @Column(name = "PORCEMPRESA") + private BigDecimal porcempresa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "FORMAPAGO_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + + public ParamAcumulaPunto() { + } + + public ParamAcumulaPunto(Integer paramacumulapuntoId) { + this.paramacumulapuntoId = paramacumulapuntoId; + } + + public Integer getParamacumulapuntoId() { + return paramacumulapuntoId; + } + + public void setParamacumulapuntoId(Integer paramacumulapuntoId) { + this.paramacumulapuntoId = paramacumulapuntoId; + } + + public Short getCantoperaciondia() { + return cantoperaciondia; + } + + public void setCantoperaciondia(Short cantoperaciondia) { + this.cantoperaciondia = cantoperaciondia; + } + + public Integer getCantboletooperacion() { + return cantboletooperacion; + } + + public void setCantboletooperacion(Integer cantboletooperacion) { + this.cantboletooperacion = cantboletooperacion; + } + + public Date getFeciniciovigencia() { + return feciniciovigencia; + } + + public void setFeciniciovigencia(Date feciniciovigencia) { + this.feciniciovigencia = feciniciovigencia; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public BigDecimal getPorccliente() { + return porccliente; + } + + public void setPorccliente(BigDecimal porccliente) { + this.porccliente = porccliente; + } + + public BigDecimal getPorcempresa() { + return porcempresa; + } + + public void setPorcempresa(BigDecimal porcempresa) { + this.porcempresa = porcempresa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramacumulapuntoId != null ? paramacumulapuntoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamAcumulaPunto)) { + return false; + } + ParamAcumulaPunto other = (ParamAcumulaPunto) object; + if ((this.paramacumulapuntoId == null && other.paramacumulapuntoId != null) || (this.paramacumulapuntoId != null && !this.paramacumulapuntoId.equals(other.paramacumulapuntoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "novasEntidades.ParamAcumulaPunto[paramacumulapuntoId=" + paramacumulapuntoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamArticulo.java b/src/com/rjconsultores/ventaboletos/entidad/ParamArticulo.java new file mode 100644 index 000000000..2bc51217c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamArticulo.java @@ -0,0 +1,79 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +@SequenceGenerator(name = "PARAM_ARTICULO_SEQ", sequenceName = "PARAM_ARTICULO_SEQ", allocationSize = 1) +@Table(name = "PARAM_ARTICULO") +public class ParamArticulo implements Serializable{ + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_ARTICULO_SEQ") + @Basic(optional = false) + @Column(name = "PARAMARTICULO_ID") + private Integer paramArticuloID; + @Column(name = "CONCEPTO") + private String concepto; + @Column(name = "ARTICULO") + private String articulo; + + public Integer getParamArticuloID() { + return paramArticuloID; + } + public void setParamArticuloID(Integer paramArticuloID) { + this.paramArticuloID = paramArticuloID; + } + public String getConcepto() { + return concepto; + } + public void setConcepto(String concepto) { + this.concepto = concepto; + } + public String getArticulo() { + return articulo; + } + public void setArticulo(String articulo) { + this.articulo = articulo; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((paramArticuloID == null) ? 0 : paramArticuloID.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ParamArticulo other = (ParamArticulo) obj; + if (paramArticuloID == null) { + if (other.paramArticuloID != null) + return false; + } else if (!paramArticuloID.equals(other.paramArticuloID)) + return false; + return true; + } + @Override + public String toString() { + return this.getParamArticuloID() + " - " + this.getConcepto(); + } + + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamCanjePunto.java b/src/com/rjconsultores/ventaboletos/entidad/ParamCanjePunto.java new file mode 100644 index 000000000..bf700ee09 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamCanjePunto.java @@ -0,0 +1,181 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PARAM_CANJE_PUNTO_SEQ", sequenceName = "PARAM_CANJE_PUNTO_SEQ", allocationSize = 1) +@Table(name = "PARAM_CANJE_PUNTO") +public class ParamCanjePunto implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_CANJE_PUNTO_SEQ") + @Column(name = "PARAMCANJEPUNTO_ID") + private Integer paramcanjepuntoId; + @Column(name = "CANTOPERACIONDIA") + private Short cantoperaciondia; + @Column(name = "CANTBOLETOOPERACION") + private Short cantboletooperacion; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date feciniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinvigencia; + @Column(name = "PORCENTAJE") + private BigDecimal porcentaje; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + + public ParamCanjePunto() { + } + + public ParamCanjePunto(Integer paramcanjepuntoId) { + this.paramcanjepuntoId = paramcanjepuntoId; + } + + public Integer getParamcanjepuntoId() { + return paramcanjepuntoId; + } + + public void setParamcanjepuntoId(Integer paramcanjepuntoId) { + this.paramcanjepuntoId = paramcanjepuntoId; + } + + public Short getCantoperaciondia() { + return cantoperaciondia; + } + + public void setCantoperaciondia(Short cantoperaciondia) { + this.cantoperaciondia = cantoperaciondia; + } + + public Short getCantboletooperacion() { + return cantboletooperacion; + } + + public void setCantboletooperacion(Short cantboletooperacion) { + this.cantboletooperacion = cantboletooperacion; + } + + public Date getFeciniciovigencia() { + return feciniciovigencia; + } + + public void setFeciniciovigencia(Date feciniciovigencia) { + this.feciniciovigencia = feciniciovigencia; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramcanjepuntoId != null ? paramcanjepuntoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamCanjePunto)) { + return false; + } + ParamCanjePunto other = (ParamCanjePunto) object; + if ((this.paramcanjepuntoId == null && other.paramcanjepuntoId != null) || (this.paramcanjepuntoId != null && !this.paramcanjepuntoId.equals(other.paramcanjepuntoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "novasEntidades.ParamCanjePunto[paramcanjepuntoId=" + paramcanjepuntoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamCompraPunto.java b/src/com/rjconsultores/ventaboletos/entidad/ParamCompraPunto.java new file mode 100644 index 000000000..f23f12d9c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamCompraPunto.java @@ -0,0 +1,127 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PARAM_COMPRA_PUNTO_SEQ", sequenceName = "PARAM_COMPRA_PUNTO_SEQ", allocationSize=1) +@Table(name = "PARAM_COMPRA_PUNTO") +public class ParamCompraPunto implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_COMPRA_PUNTO_SEQ") + @Column(name = "PARAMCOMPRAPUNTO_ID") + private Integer paramcomprapuntoId; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date feciniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinvigencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public ParamCompraPunto() { + } + + public ParamCompraPunto(Integer paramcomprapuntoId) { + this.paramcomprapuntoId = paramcomprapuntoId; + } + + public Integer getParamcomprapuntoId() { + return paramcomprapuntoId; + } + + public void setParamcomprapuntoId(Integer paramcomprapuntoId) { + this.paramcomprapuntoId = paramcomprapuntoId; + } + + public Date getFeciniciovigencia() { + return feciniciovigencia; + } + + public void setFeciniciovigencia(Date feciniciovigencia) { + this.feciniciovigencia = feciniciovigencia; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramcomprapuntoId != null ? paramcomprapuntoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamCompraPunto)) { + return false; + } + ParamCompraPunto other = (ParamCompraPunto) object; + if ((this.paramcomprapuntoId == null && other.paramcomprapuntoId != null) || (this.paramcomprapuntoId != null && !this.paramcomprapuntoId.equals(other.paramcomprapuntoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "te.ParamCompraPunto[paramcomprapuntoId=" + paramcomprapuntoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamCostoTarjeta.java b/src/com/rjconsultores/ventaboletos/entidad/ParamCostoTarjeta.java new file mode 100644 index 000000000..30573ee3b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamCostoTarjeta.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PARAM_COSTO_TARJETA_SEQ", sequenceName = "PARAM_COSTO_TARJETA_SEQ", allocationSize=1) +@Table(name = "PARAM_COSTO_TARJETA") +public class ParamCostoTarjeta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_COSTO_TARJETA_SEQ") + @Column(name = "PARAMCOSTOTARJETA_ID") + private Integer paramcostotarjetaId; + @Column(name = "VALCOSTOINICIAL") + private BigDecimal valcostoinicial; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + + public ParamCostoTarjeta() { + } + + public ParamCostoTarjeta(Integer paramcostotarjetaId) { + this.paramcostotarjetaId = paramcostotarjetaId; + } + + public Integer getParamcostotarjetaId() { + return paramcostotarjetaId; + } + + public void setParamcostotarjetaId(Integer paramcostotarjetaId) { + this.paramcostotarjetaId = paramcostotarjetaId; + } + + public BigDecimal getValcostoinicial() { + return valcostoinicial; + } + + public void setValcostoinicial(BigDecimal valcostoinicial) { + this.valcostoinicial = valcostoinicial; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramcostotarjetaId != null ? paramcostotarjetaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamCostoTarjeta)) { + return false; + } + ParamCostoTarjeta other = (ParamCostoTarjeta) object; + if ((this.paramcostotarjetaId == null && other.paramcostotarjetaId != null) || (this.paramcostotarjetaId != null && !this.paramcostotarjetaId.equals(other.paramcostotarjetaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "te.ParamCostoTarjeta[paramcostotarjetaId=" + paramcostotarjetaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java b/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java new file mode 100644 index 000000000..08a6a6d80 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "PARAM_RECOLECCION_SEQ", sequenceName = "PARAM_RECOLECCION_SEQ", allocationSize = 1) +@Table(name = "PARAM_RECOLECCION") +public class ParamRecoleccion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "PARAMRECOLECCION_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PARAM_RECOLECCION_SEQ") + private Integer paramrecoleccionId; + @Column(name = "IMPORTEINICIAL") + private BigDecimal importeinicial; + @Column(name = "IMPORTEADICIONAL") + private BigDecimal importeadicional; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + + public ParamRecoleccion() { + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public ParamRecoleccion(Integer paramrecoleccionId) { + this.paramrecoleccionId = paramrecoleccionId; + } + + public Integer getParamrecoleccionId() { + return paramrecoleccionId; + } + + public void setParamrecoleccionId(Integer paramrecoleccionId) { + this.paramrecoleccionId = paramrecoleccionId; + } + + public BigDecimal getImporteinicial() { + return importeinicial; + } + + public void setImporteinicial(BigDecimal importeinicial) { + this.importeinicial = importeinicial; + } + + public BigDecimal getImporteadicional() { + return importeadicional; + } + + public void setImporteadicional(BigDecimal importeadicional) { + this.importeadicional = importeadicional; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (paramrecoleccionId != null ? paramrecoleccionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ParamRecoleccion)) { + return false; + } + ParamRecoleccion other = (ParamRecoleccion) object; + if ((this.paramrecoleccionId == null && other.paramrecoleccionId != null) || (this.paramrecoleccionId != null && !this.paramrecoleccionId.equals(other.paramrecoleccionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ParamRecoleccion[paramrecoleccionId=" + paramrecoleccionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Perfil.java b/src/com/rjconsultores/ventaboletos/entidad/Perfil.java new file mode 100644 index 000000000..f10b6cca7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Perfil.java @@ -0,0 +1,158 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PERFIL_SEQ", sequenceName = "PERFIL_SEQ", allocationSize = 1) +@Table(name = "PERFIL") +public class Perfil implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PERFIL_SEQ") + @Column(name = "PERFIL_ID") + private Integer perfilId; + @Column(name = "DESCPERFIL") + private String descperfil; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "perfil") + private List usuarioPerfilList; + @OneToMany(mappedBy = "perfil", cascade = CascadeType.ALL) + private List perfilFuncionList; + + public Perfil() { + } + + public Perfil(Integer perfilId) { + this.perfilId = perfilId; + } + + public Integer getPerfilId() { + return perfilId; + } + + public void setPerfilId(Integer perfilId) { + this.perfilId = perfilId; + } + + public String getDescperfil() { + return descperfil; + } + + public void setDescperfil(String descperfil) { + this.descperfil = descperfil; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getUsuarioPerfilList() { + List tmp = new ArrayList(); + if (usuarioPerfilList != null) { + for (UsuarioPerfil cp : this.usuarioPerfilList) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setUsuarioPerfilList(List usuarioPerfilList) { + this.usuarioPerfilList = usuarioPerfilList; + } + + public List getPerfilFuncionList() { + List tmp = new ArrayList(); + if (perfilFuncionList != null) { + for (PerfilFuncion cp : this.perfilFuncionList) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setPerfilFuncionList(List perfilFuncionList) { + this.perfilFuncionList = perfilFuncionList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (perfilId != null ? perfilId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Perfil)) { + return false; + } + Perfil other = (Perfil) object; + if ((this.perfilId == null && other.perfilId != null) || (this.perfilId != null && !this.perfilId.equals(other.perfilId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescperfil(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PerfilFuncion.java b/src/com/rjconsultores/ventaboletos/entidad/PerfilFuncion.java new file mode 100644 index 000000000..376e16362 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PerfilFuncion.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "PERFIL_FUNCION") +@SequenceGenerator(name = "PERFIL_FUNCION_SEQ", sequenceName = "PERFIL_FUNCION_SEQ", allocationSize = 1) +public class PerfilFuncion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "PERFILFUNCION_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PERFIL_FUNCION_SEQ") + private Integer perfilfuncionId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PERFIL_ID", referencedColumnName = "PERFIL_ID") + @ManyToOne + private Perfil perfil; + @JoinColumn(name = "FUNCIONSISTEMA_ID", referencedColumnName = "FUNCIONSISTEMA_ID") + @ManyToOne + private FuncionSistema funcionSistema; + + public PerfilFuncion() { + } + + public PerfilFuncion(Integer perfilfuncionId) { + this.perfilfuncionId = perfilfuncionId; + } + + public Integer getPerfilfuncionId() { + return perfilfuncionId; + } + + public void setPerfilfuncionId(Integer perfilfuncionId) { + this.perfilfuncionId = perfilfuncionId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Perfil getPerfil() { + return perfil; + } + + public void setPerfil(Perfil perfil) { + this.perfil = perfil; + } + + public FuncionSistema getFuncionSistema() { + return funcionSistema; + } + + public void setFuncionSistema(FuncionSistema funcionSistema) { + this.funcionSistema = funcionSistema; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (perfilfuncionId != null ? perfilfuncionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PerfilFuncion)) { + return false; + } + PerfilFuncion other = (PerfilFuncion) object; + if ((this.perfilfuncionId == null && other.perfilfuncionId != null) || (this.perfilfuncionId != null && !this.perfilfuncionId.equals(other.perfilfuncionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.PerfilFuncion[perfilfuncionId=" + perfilfuncionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PeriodoVacacional.java b/src/com/rjconsultores/ventaboletos/entidad/PeriodoVacacional.java new file mode 100644 index 000000000..229f6bd6e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PeriodoVacacional.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PERIODO_VACACIONAL_SEQ", sequenceName = "PERIODO_VACACIONAL_SEQ", allocationSize = 1) +@Table(name = "PERIODO_VACACIONAL") +public class PeriodoVacacional implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PERIODO_VACACIONAL_SEQ") + @Column(name = "PERIODOVACACIONAL_ID") + private Integer periodovacacionalId; + @Column(name = "FECINICIO") + @Temporal(TemporalType.DATE) + private Date fecinicio; + @Column(name = "FECFINAL") + @Temporal(TemporalType.DATE) + private Date fecfinal; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public PeriodoVacacional() { + } + + public PeriodoVacacional(Integer periodovacacionalId) { + this.periodovacacionalId = periodovacacionalId; + } + + public Integer getPeriodovacacionalId() { + return periodovacacionalId; + } + + public void setPeriodovacacionalId(Integer periodovacacionalId) { + this.periodovacacionalId = periodovacacionalId; + } + + public Date getFecinicio() { + return fecinicio; + } + + public void setFecinicio(Date fecinicio) { + this.fecinicio = fecinicio; + } + + public Date getFecfinal() { + return fecfinal; + } + + public void setFecfinal(Date fecfinal) { + this.fecfinal = fecfinal; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (periodovacacionalId != null ? periodovacacionalId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PeriodoVacacional)) { + return false; + } + PeriodoVacacional other = (PeriodoVacacional) object; + if ((this.periodovacacionalId == null && other.periodovacacionalId != null) || (this.periodovacacionalId != null && !this.periodovacacionalId.equals(other.periodovacacionalId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.PeriodoVacacional[periodovacacionalId=" + periodovacacionalId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Plaza.java b/src/com/rjconsultores/ventaboletos/entidad/Plaza.java new file mode 100644 index 000000000..f64fb239f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Plaza.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "PLAZA_SEQ", sequenceName = "PLAZA_SEQ", allocationSize=1) +@Table(name = "PLAZA") +public class Plaza implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PLAZA_SEQ") + @Column(name = "PLAZA_ID") + private Integer plazaId; + @Column(name = "NOMBPLAZA") + private String nombplaza; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Plaza() { + } + + public Plaza(Integer plazaId) { + this.plazaId = plazaId; + } + + public Integer getPlazaId() { + return plazaId; + } + + public void setPlazaId(Integer plazaId) { + this.plazaId = plazaId; + } + + public String getNombplaza() { + return nombplaza; + } + + public void setNombplaza(String nombplaza) { + this.nombplaza = nombplaza; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (plazaId != null ? plazaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Plaza)) { + return false; + } + Plaza other = (Plaza) object; + if ((this.plazaId == null && other.plazaId != null) || (this.plazaId != null && !this.plazaId.equals(other.plazaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNombplaza(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Pricing.java b/src/com/rjconsultores/ventaboletos/entidad/Pricing.java new file mode 100644 index 000000000..61f957355 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Pricing.java @@ -0,0 +1,457 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_SEQ", sequenceName = "PRICING_SEQ", allocationSize = 1) +@Table(name = "PRICING") +public class Pricing implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_SEQ") + @Column(name = "PRICING_ID") + private Integer pricingId; + @Column(name = "NOMBPRICING") + private String nombPricing; + @Column(name = "CANTBOLETO") + private Short cantboleto; + //Rafael - Campo retirado pela Leticia no dia 15/02/2011. + //@Column(name = "DESCUENTOIMPORTE") + //private BigDecimal descuentoimporte; + @Column(name = "DESCUENTOPORCENTAJE") + private BigDecimal descuentoporcentaje; + @Column(name = "DESCUENTOPORCREDONDO") + private BigDecimal descuentoporcredondo; + @Column(name = "INDTRANSFERIBLE") + private Boolean indtransferible; + @Column(name = "INDRESERVABLE") + private Boolean indreservable; + @Column(name = "INDCANCELABLE") + private Boolean indcancelable; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "CANTDIASANTICIPACION") + private Integer cantdiasanticipacion; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingOcupacionList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingAsientoList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingMercadoList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingMarcaList; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingRutaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingDiaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingImporteList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingTipoptovtaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingCategoriaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingVigenciaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingClaseList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingCorridaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingPuntoventaList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingAnticipacionList; + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingTipoServicioList; + + public Pricing() { + } + + public Pricing(Integer pricingId) { + this.pricingId = pricingId; + } + + public Integer getPricingId() { + return pricingId; + } + + public void setPricingId(Integer pricingId) { + this.pricingId = pricingId; + } + + public Short getCantboleto() { + return cantboleto; + } + + public Integer getCantdiasanticipacion() { + return cantdiasanticipacion; + } + + public void setCantdiasanticipacion(Integer cantdiasanticipacion) { + this.cantdiasanticipacion = cantdiasanticipacion; + } + + public void setCantboleto(Short cantboleto) { + this.cantboleto = cantboleto; + } + + public BigDecimal getDescuentoporcentaje() { + return descuentoporcentaje; + } + + public void setDescuentoporcentaje(BigDecimal descuentoporcentaje) { + this.descuentoporcentaje = descuentoporcentaje; + } + + public BigDecimal getDescuentoporcredondo() { + return descuentoporcredondo; + } + + public void setDescuentoporcredondo(BigDecimal descuentoporcredondo) { + this.descuentoporcredondo = descuentoporcredondo; + } + + public Boolean getIndtransferible() { + return indtransferible; + } + + public void setIndtransferible(Boolean indtransferible) { + this.indtransferible = indtransferible; + } + + public Boolean getIndreservable() { + return indreservable; + } + + public void setIndreservable(Boolean indreservable) { + this.indreservable = indreservable; + } + + public Boolean getIndcancelable() { + return indcancelable; + } + + public void setIndcancelable(Boolean indcancelable) { + this.indcancelable = indcancelable; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getPricingOcupacionList() { + List poList = new ArrayList(); + for (PricingOcupacion po : this.pricingOcupacionList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setPricingOcupacionList(List pricingOcupacionList) { + this.pricingOcupacionList = pricingOcupacionList; + } + + public List getPricingAsientoList() { + List paList = new ArrayList(); + for (PricingAsiento pa : this.pricingAsientoList) { + if (pa.getActivo() == Boolean.TRUE) { + paList.add(pa); + } + } + return paList; + } + + public void setPricingAsientoList(List pricingAsientoList) { + this.pricingAsientoList = pricingAsientoList; + } + + public List getPricingMercadoList() { + List pmList = new ArrayList(); + for (PricingMercado pm : this.pricingMercadoList) { + if (pm.getActivo() == Boolean.TRUE) { + pmList.add(pm); + } + } + return pmList; + } + + public void setPricingMercadoList(List pricingMercadoList) { + this.pricingMercadoList = pricingMercadoList; + } + + public List getPricingMarcaList() { + List pmList = new ArrayList(); + for (PricingMarca pm : this.pricingMarcaList) { + if (pm.getActivo() == Boolean.TRUE) { + pmList.add(pm); + } + } + return pmList; + } + + public void setPricingMarcaList(List pricingMarcaList) { + this.pricingMarcaList = pricingMarcaList; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public List getPricingRutaList() { + List prList = new ArrayList(); + for (PricingRuta pr : this.pricingRutaList) { + if (pr.getActivo() == Boolean.TRUE) { + prList.add(pr); + } + } + return prList; + } + + public void setPricingRutaList(List pricingRutaList) { + this.pricingRutaList = pricingRutaList; + } + + public List getPricingDiaList() { + List pdList = new ArrayList(); + for (PricingDia pd : this.pricingDiaList) { + if (pd.getActivo() == Boolean.TRUE) { + pdList.add(pd); + } + } + return pdList; + } + + public void setPricingDiaList(List pricingDiaList) { + this.pricingDiaList = pricingDiaList; + } + + public List getPricingImporteList() { + List piList = new ArrayList(); + for (PricingImporte pi : this.pricingImporteList) { + if (pi.getActivo() == Boolean.TRUE) { + piList.add(pi); + } + } + return piList; + } + + public void setPricingImporteList(List pricingImporteList) { + this.pricingImporteList = pricingImporteList; + } + + public List getPricingTipoptovtaList() { + List ptList = new ArrayList(); + for (PricingTipoPtoVta pt : this.pricingTipoptovtaList) { + if (pt.getActivo() == Boolean.TRUE) { + ptList.add(pt); + } + } + return ptList; + } + + public void setPricingTipoptovtaList(List pricingTipoptovtaList) { + this.pricingTipoptovtaList = pricingTipoptovtaList; + } + + public List getPricingCategoriaList() { + List pcList = new ArrayList(); + for (PricingCategoria pc : this.pricingCategoriaList) { + if (pc.getActivo() == Boolean.TRUE) { + pcList.add(pc); + } + } + return pcList; + } + + public void setPricingCategoriaList(List pricingCategoriaList) { + this.pricingCategoriaList = pricingCategoriaList; + } + + public List getPricingVigenciaList() { + List pvList = new ArrayList(); + for (PricingVigencia pv : this.pricingVigenciaList) { + if (pv.getActivo() == Boolean.TRUE) { + pvList.add(pv); + } + } + return pvList; + } + + public void setPricingVigenciaList(List pricingVigenciaList) { + this.pricingVigenciaList = pricingVigenciaList; + } + + public List getPricingClaseList() { + List pcList = new ArrayList(); + for (PricingClase pc : this.pricingClaseList) { + if (pc.getActivo() == Boolean.TRUE) { + pcList.add(pc); + } + } + return pcList; + } + + public void setPricingClaseList(List pricingClaseList) { + this.pricingClaseList = pricingClaseList; + } + + public List getPricingCorridaList() { + + List pcList = new ArrayList(); + if (pricingCorridaList == null) { + return null; + } + for (PricingCorrida pc : this.pricingCorridaList) { + if (pc.getActivo() == Boolean.TRUE) { + pcList.add(pc); + } + } + return pcList; + } + + public void setPricingCorridaList(List pricingCorridaList) { + this.pricingCorridaList = pricingCorridaList; + } + + public List getPricingPuntoventaList() { + List ppList = new ArrayList(); + for (PricingPuntoVenta pp : this.pricingPuntoventaList) { + if (pp.getActivo() == Boolean.TRUE) { + ppList.add(pp); + } + } + return ppList; + } + + public void setPricingPuntoventaList(List pricingPuntoventaList) { + this.pricingPuntoventaList = pricingPuntoventaList; + } + + public List getPricingAnticipacionList() { + List ppList = new ArrayList(); + for (PricingAnticipacion pp : this.pricingAnticipacionList) { + if (pp.getActivo() == Boolean.TRUE) { + ppList.add(pp); + } + } + return ppList; + } + + public void setPricingAnticipacionList(List pricingAnticipacionList) { + this.pricingAnticipacionList = pricingAnticipacionList; + } + + public List getPricingTipoServicioList() { + List ppList = new ArrayList(); + for (PricingTipoServicio pp : this.pricingTipoServicioList) { + if (pp.getActivo() == Boolean.TRUE) { + ppList.add(pp); + } + } + return ppList; + } + + public void setPricingTipoServicioList(List pricingTipoServicioList) { + this.pricingTipoServicioList = pricingTipoServicioList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingId != null ? pricingId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Pricing)) { + return false; + } + Pricing other = (Pricing) object; + if ((this.pricingId == null && other.pricingId != null) || (this.pricingId != null && !this.pricingId.equals(other.pricingId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.Pricing[pricingId=" + pricingId + "]"; + } + + /** + * @return the nombPricing + */ + public String getNombPricing() { + return nombPricing; + } + + /** + * @param nombPricing the nombPricing to set + */ + public void setNombPricing(String nombPricing) { + this.nombPricing = nombPricing; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingAnticipacion.java b/src/com/rjconsultores/ventaboletos/entidad/PricingAnticipacion.java new file mode 100644 index 000000000..5a5e40062 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingAnticipacion.java @@ -0,0 +1,156 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "PRICING_ANTICIPACION_SEQ", sequenceName = "PRICING_ANTICIPACION_SEQ", allocationSize = 1) +@Table(name = "PRICING_ANTICIPACION") +public class PricingAnticipacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_ANTICIPACION_SEQ") + @Column(name = "PRICINGANTICIPACION_ID") + private Integer pricinganticipacionId; + @Basic(optional = false) + @Column(name = "CANTDIASMIN") + private Integer cantdiasmin; + @Basic(optional = false) + @Column(name = "CANTDIASMAX") + private Integer cantdiasmax; + @Basic(optional = false) + @Column(name = "PORCPRICING") + private BigDecimal porcpricing; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private int usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingAnticipacion() { + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public PricingAnticipacion(Integer pricinganticipacionId) { + this.pricinganticipacionId = pricinganticipacionId; + } + + public Integer getPricinganticipacionId() { + return pricinganticipacionId; + } + + public void setPricinganticipacionId(Integer pricinganticipacionId) { + this.pricinganticipacionId = pricinganticipacionId; + } + + public Integer getCantdiasmax() { + return cantdiasmax; + } + + public void setCantdiasmax(Integer cantdiasmax) { + this.cantdiasmax = cantdiasmax; + } + + public Integer getCantdiasmin() { + return cantdiasmin; + } + + public void setCantdiasmin(Integer cantdiasmin) { + this.cantdiasmin = cantdiasmin; + } + + public BigDecimal getPorcpricing() { + return porcpricing; + } + + public void setPorcpricing(BigDecimal porcpricing) { + this.porcpricing = porcpricing; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public int getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(int usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricinganticipacionId != null ? pricinganticipacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingAnticipacion)) { + return false; + } + PricingAnticipacion other = (PricingAnticipacion) object; + if ((this.pricinganticipacionId == null && other.pricinganticipacionId != null) || (this.pricinganticipacionId != null && !this.pricinganticipacionId.equals(other.pricinganticipacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.PricingAnticipacion[pricinganticipacionId=" + pricinganticipacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingAsiento.java b/src/com/rjconsultores/ventaboletos/entidad/PricingAsiento.java new file mode 100644 index 000000000..3f3e084ba --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingAsiento.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_ASIENTO_SEQ", sequenceName = "PRICING_ASIENTO_SEQ", allocationSize = 1) +@Table(name = "PRICING_ASIENTO") +public class PricingAsiento implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_ASIENTO_SEQ") + @Column(name = "PRICINGASIENTO_ID") + private Integer pricingasientoId; + @Column(name = "NUMEASIENTO") + private String numeasiento; + @Column(name = "NOMBIMAGEN") + private String nombImagen; + @Column(name = "PORCENTAJE") + private BigDecimal porcentaje; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingAsiento() { + } + + public PricingAsiento(Integer pricingasientoId) { + this.pricingasientoId = pricingasientoId; + } + + public Integer getPricingasientoId() { + return pricingasientoId; + } + + public void setPricingasientoId(Integer pricingasientoId) { + this.pricingasientoId = pricingasientoId; + } + + public String getNumeasiento() { + return numeasiento; + } + + public void setNumeasiento(String numeasiento) { + this.numeasiento = numeasiento; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public String getNombImagen() { + return nombImagen; + } + + public void setNombImagen(String nombImagen) { + this.nombImagen = nombImagen; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingasientoId != null ? pricingasientoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingAsiento)) { + return false; + } + PricingAsiento other = (PricingAsiento) object; + if ((this.pricingasientoId == null && other.pricingasientoId != null) || (this.pricingasientoId != null && !this.pricingasientoId.equals(other.pricingasientoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingAsiento[pricingasientoId=" + pricingasientoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingCategoria.java b/src/com/rjconsultores/ventaboletos/entidad/PricingCategoria.java new file mode 100644 index 000000000..625ce3644 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingCategoria.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_CATEGORIA_SEQ", sequenceName = "PRICING_CATEGORIA_SEQ", allocationSize = 1) +@Table(name = "PRICING_CATEGORIA") +public class PricingCategoria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_CATEGORIA_SEQ") + @Column(name = "PRICINGCATEGORIA_ID") + private Integer pricingcategoriaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + + public PricingCategoria() { + } + + public PricingCategoria(Integer pricingcategoriaId) { + this.pricingcategoriaId = pricingcategoriaId; + } + + public Integer getPricingcategoriaId() { + return pricingcategoriaId; + } + + public void setPricingcategoriaId(Integer pricingcategoriaId) { + this.pricingcategoriaId = pricingcategoriaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingcategoriaId != null ? pricingcategoriaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingCategoria)) { + return false; + } + PricingCategoria other = (PricingCategoria) object; + if ((this.pricingcategoriaId == null && other.pricingcategoriaId != null) || (this.pricingcategoriaId != null && !this.pricingcategoriaId.equals(other.pricingcategoriaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingCategoria[pricingcategoriaId=" + pricingcategoriaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingClase.java b/src/com/rjconsultores/ventaboletos/entidad/PricingClase.java new file mode 100644 index 000000000..d2a2de8ee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingClase.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_CLASE_SEQ", sequenceName = "PRICING_CLASE_SEQ", allocationSize = 1) +@Table(name = "PRICING_CLASE") +public class PricingClase implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_CLASE_SEQ") + @Column(name = "PRICINGCLASE_ID") + private Integer pricingclaseId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public PricingClase() { + } + + public PricingClase(Integer pricingclaseId) { + this.pricingclaseId = pricingclaseId; + } + + public Integer getPricingclaseId() { + return pricingclaseId; + } + + public void setPricingclaseId(Integer pricingclaseId) { + this.pricingclaseId = pricingclaseId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingclaseId != null ? pricingclaseId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingClase)) { + return false; + } + PricingClase other = (PricingClase) object; + if ((this.pricingclaseId == null && other.pricingclaseId != null) || (this.pricingclaseId != null && !this.pricingclaseId.equals(other.pricingclaseId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingClase[pricingclaseId=" + pricingclaseId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/PricingCorrida.java new file mode 100644 index 000000000..ec8ea7f65 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingCorrida.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_CORRIDA_SEQ", sequenceName = "PRICING_CORRIDA_SEQ", allocationSize = 1) +@Table(name = "PRICING_CORRIDA") +public class PricingCorrida implements Serializable { + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_CORRIDA_SEQ") + @Column(name = "PRICINGCORRIDA_ID") + private Integer pricingcorridaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID") + @ManyToOne + private CorridaCtrl corridaCtrl; + + public PricingCorrida() { + } + + public PricingCorrida(Integer pricingcorridaId) { + this.pricingcorridaId = pricingcorridaId; + } + + public Integer getPricingcorridaId() { + return pricingcorridaId; + } + + public void setPricingcorridaId(Integer pricingcorridaId) { + this.pricingcorridaId = pricingcorridaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public CorridaCtrl getCorridaCtrl() { + return corridaCtrl; + } + + public void setCorridaCtrl(CorridaCtrl corridaCtrl) { + this.corridaCtrl = corridaCtrl; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingcorridaId != null ? pricingcorridaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingCorrida)) { + return false; + } + PricingCorrida other = (PricingCorrida) object; + if ((this.pricingcorridaId == null && other.pricingcorridaId != null) || (this.pricingcorridaId != null && !this.pricingcorridaId.equals(other.pricingcorridaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingCorrida[pricingcorridaId=" + pricingcorridaId + "]"; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java b/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java new file mode 100644 index 000000000..f6303955e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java @@ -0,0 +1,211 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_DIA_SEQ", sequenceName = "PRICING_DIA_SEQ", allocationSize = 1) +@Table(name = "PRICING_DIA") +public class PricingDia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_DIA_SEQ") + @Column(name = "PRICINGDIA_ID") + private Integer pricingdiaId; + @Column(name = "INDLUNES") + private Boolean indlunes; + @Column(name = "INDMARTES") + private Boolean indmartes; + @Column(name = "INDMIERCOLES") + private Boolean indmiercoles; + @Column(name = "INDJUEVES") + private Boolean indjueves; + @Column(name = "INDVIERNES") + private Boolean indviernes; + @Column(name = "INDSABADO") + private Boolean indsabado; + @Column(name = "INDDOMINGO") + private Boolean inddomingo; + @Column(name = "HORARIOINICIO") + @Temporal(TemporalType.TIMESTAMP)//Fue cambido de TIME para TIMESTAMP porque cuando está time el año que se salva el 1900 y no 1970. + private Date horarioinicio; + @Column(name = "HORARIOFIN") + @Temporal(TemporalType.TIMESTAMP)//Fue cambido de TIME para TIMESTAMP porque cuando está time el año que se salva el 1900 y no 1970. + private Date horariofin; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingDia() { + } + + public PricingDia(Integer pricingdiaId) { + this.pricingdiaId = pricingdiaId; + } + + public Integer getPricingdiaId() { + return pricingdiaId; + } + + public void setPricingdiaId(Integer pricingdiaId) { + this.pricingdiaId = pricingdiaId; + } + + public Boolean getInddomingo() { + return inddomingo; + } + + public void setInddomingo(Boolean inddomingo) { + this.inddomingo = inddomingo; + } + + public Boolean getIndjueves() { + return indjueves; + } + + public void setIndjueves(Boolean indjueves) { + this.indjueves = indjueves; + } + + public Boolean getIndlunes() { + return indlunes; + } + + public void setIndlunes(Boolean indlunes) { + this.indlunes = indlunes; + } + + public Boolean getIndmartes() { + return indmartes; + } + + public void setIndmartes(Boolean indmartes) { + this.indmartes = indmartes; + } + + public Boolean getIndmiercoles() { + return indmiercoles; + } + + public void setIndmiercoles(Boolean indmiercoles) { + this.indmiercoles = indmiercoles; + } + + public Boolean getIndsabado() { + return indsabado; + } + + public void setIndsabado(Boolean indsabado) { + this.indsabado = indsabado; + } + + public Boolean getIndviernes() { + return indviernes; + } + + public void setIndviernes(Boolean indviernes) { + this.indviernes = indviernes; + } + + public Date getHorarioinicio() { + return horarioinicio; + } + + public void setHorarioinicio(Date horarioinicio) { + this.horarioinicio = horarioinicio; + } + + public Date getHorariofin() { + return horariofin; + } + + public void setHorariofin(Date horariofin) { + this.horariofin = horariofin; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingdiaId != null ? pricingdiaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingDia)) { + return false; + } + PricingDia other = (PricingDia) object; + if ((this.pricingdiaId == null && other.pricingdiaId != null) || (this.pricingdiaId != null && !this.pricingdiaId.equals(other.pricingdiaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingDia[pricingdiaId=" + pricingdiaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingEspecifico.java b/src/com/rjconsultores/ventaboletos/entidad/PricingEspecifico.java new file mode 100644 index 000000000..0043241d2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingEspecifico.java @@ -0,0 +1,238 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_ESPECIFICO_SEQ", sequenceName = "PRICING_ESPECIFICO_SEQ", allocationSize = 1) +@Table(name = "PRICING_ESPECIFICO") +public class PricingEspecifico implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_ESPECIFICO_SEQ") + @Column(name = "PRICINGESPECIFICO_ID") + private Long pricingespecificoId; + @Column(name = "NOMBPRICING") + private String nombPricing; + @Column(name = "FECHORINICIO") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorinicio; + @Column(name = "FECHORFIN") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorfin; + @Column(name = "TARIFA") + private BigDecimal tarifa; + @Column(name = "TARIFAREDABIERTO") + private BigDecimal tarifaredabierto; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPtovta; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada1; + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + + public PricingEspecifico() { + } + + public PricingEspecifico(Long pricingespecificoId) { + this.pricingespecificoId = pricingespecificoId; + } + + public Long getPricingespecificoId() { + return pricingespecificoId; + } + + public void setPricingespecificoId(Long pricingespecificoId) { + this.pricingespecificoId = pricingespecificoId; + } + + public Date getFechorinicio() { + return fechorinicio; + } + + public void setFechorinicio(Date fechorinicio) { + this.fechorinicio = fechorinicio; + } + + public Date getFechorfin() { + return fechorfin; + } + + public void setFechorfin(Date fechorfin) { + this.fechorfin = fechorfin; + } + + public BigDecimal getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + public BigDecimal getTarifaredabierto() { + return tarifaredabierto; + } + + public void setTarifaredabierto(BigDecimal tarifaredabierto) { + this.tarifaredabierto = tarifaredabierto; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public TipoPuntoVenta getTipoPtovta() { + return tipoPtovta; + } + + public void setTipoPtovta(TipoPuntoVenta tipoPtovta) { + this.tipoPtovta = tipoPtovta; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public Parada getParada1() { + return parada1; + } + + public void setParada1(Parada parada1) { + this.parada1 = parada1; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + public String getNombPricing() { + return nombPricing; + } + + public void setNombPricing(String nombPricing) { + this.nombPricing = nombPricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingespecificoId != null ? pricingespecificoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingEspecifico)) { + return false; + } + PricingEspecifico other = (PricingEspecifico) object; + if ((this.pricingespecificoId == null && other.pricingespecificoId != null) || (this.pricingespecificoId != null && !this.pricingespecificoId.equals(other.pricingespecificoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingEspecifico[pricingespecificoId=" + pricingespecificoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingImporte.java b/src/com/rjconsultores/ventaboletos/entidad/PricingImporte.java new file mode 100644 index 000000000..856958f56 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingImporte.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_IMPORTE_SEQ", sequenceName = "PRICING_IMPORTE_SEQ", allocationSize = 1) +@Table(name = "PRICING_IMPORTE") +public class PricingImporte implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_IMPORTE_SEQ") + @Column(name = "PRICINGIMPORTE_ID") + private Integer pricingimporteId; + @Column(name = "IMPORTE") + private BigDecimal importe; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + + public PricingImporte() { + } + + public PricingImporte(Integer pricingimporteId) { + this.pricingimporteId = pricingimporteId; + } + + public Integer getPricingimporteId() { + return pricingimporteId; + } + + public void setPricingimporteId(Integer pricingimporteId) { + this.pricingimporteId = pricingimporteId; + } + + public BigDecimal getImporte() { + return importe; + } + + public void setImporte(BigDecimal importe) { + this.importe = importe; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingimporteId != null ? pricingimporteId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingImporte)) { + return false; + } + PricingImporte other = (PricingImporte) object; + if ((this.pricingimporteId == null && other.pricingimporteId != null) || (this.pricingimporteId != null && !this.pricingimporteId.equals(other.pricingimporteId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingImporte[pricingimporteId=" + pricingimporteId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingMarca.java b/src/com/rjconsultores/ventaboletos/entidad/PricingMarca.java new file mode 100644 index 000000000..228d3f0a1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingMarca.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_MARCA_SEQ", sequenceName = "PRICING_MARCA_SEQ", allocationSize = 1) +@Table(name = "PRICING_MARCA") +public class PricingMarca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_MARCA_SEQ") + @Column(name = "PRICINGMARCA_ID") + private Integer pricingmarcaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + public PricingMarca() { + } + + public PricingMarca(Integer pricingmarcaId) { + this.pricingmarcaId = pricingmarcaId; + } + + public Integer getPricingmarcaId() { + return pricingmarcaId; + } + + public void setPricingmarcaId(Integer pricingmarcaId) { + this.pricingmarcaId = pricingmarcaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingmarcaId != null ? pricingmarcaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingMarca)) { + return false; + } + PricingMarca other = (PricingMarca) object; + if ((this.pricingmarcaId == null && other.pricingmarcaId != null) || (this.pricingmarcaId != null && !this.pricingmarcaId.equals(other.pricingmarcaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingMarca[pricingmarcaId=" + pricingmarcaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingMercado.java b/src/com/rjconsultores/ventaboletos/entidad/PricingMercado.java new file mode 100644 index 000000000..69ac942f9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingMercado.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_MERCADO_SEQ", sequenceName = "PRICING_MERCADO_SEQ", allocationSize = 1) +@Table(name = "PRICING_MERCADO") +public class PricingMercado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_MERCADO_SEQ") + @Column(name = "PRICINGPARADA_ID") + private Integer pricingparadaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origen; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + + public PricingMercado() { + } + + public PricingMercado(Integer pricingparadaId) { + this.pricingparadaId = pricingparadaId; + } + + public Integer getPricingparadaId() { + return pricingparadaId; + } + + public void setPricingparadaId(Integer pricingparadaId) { + this.pricingparadaId = pricingparadaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigen() { + return origen; + } + + public void setOrigen(Parada origen) { + this.origen = origen; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingparadaId != null ? pricingparadaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingMercado)) { + return false; + } + PricingMercado other = (PricingMercado) object; + if ((this.pricingparadaId == null && other.pricingparadaId != null) || (this.pricingparadaId != null && !this.pricingparadaId.equals(other.pricingparadaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingMercado[pricingparadaId=" + pricingparadaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingOcupacion.java b/src/com/rjconsultores/ventaboletos/entidad/PricingOcupacion.java new file mode 100644 index 000000000..cba650b2c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingOcupacion.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_OCUPACION_SEQ", sequenceName = "PRICING_OCUPACION_SEQ", allocationSize = 1) +@Table(name = "PRICING_OCUPACION") +public class PricingOcupacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_OCUPACION_SEQ") + @Column(name = "PRICINGOCUPACION_ID") + private Integer pricingocupacionId; + @Column(name = "OCUPACIONINICIAL") + private BigDecimal ocupacioninicial; + @Column(name = "OCUPACIONFINAL") + private BigDecimal ocupacionfinal; + @Column(name = "PORCENTAJE") + private BigDecimal porcentaje; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingOcupacion() { + } + + public PricingOcupacion(Integer pricingocupacionId) { + this.pricingocupacionId = pricingocupacionId; + } + + public Integer getPricingocupacionId() { + return pricingocupacionId; + } + + public void setPricingocupacionId(Integer pricingocupacionId) { + this.pricingocupacionId = pricingocupacionId; + } + + public BigDecimal getOcupacioninicial() { + return ocupacioninicial; + } + + public void setOcupacioninicial(BigDecimal ocupacioninicial) { + this.ocupacioninicial = ocupacioninicial; + } + + public BigDecimal getOcupacionfinal() { + return ocupacionfinal; + } + + public void setOcupacionfinal(BigDecimal ocupacionfinal) { + this.ocupacionfinal = ocupacionfinal; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingocupacionId != null ? pricingocupacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingOcupacion)) { + return false; + } + PricingOcupacion other = (PricingOcupacion) object; + if ((this.pricingocupacionId == null && other.pricingocupacionId != null) || (this.pricingocupacionId != null && !this.pricingocupacionId.equals(other.pricingocupacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingOcupacion[pricingocupacionId=" + pricingocupacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/PricingPuntoVenta.java new file mode 100644 index 000000000..615b6ec83 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingPuntoVenta.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_PUNTOVENTA_SEQ", sequenceName = "PRICING_PUNTOVENTA_SEQ", allocationSize = 1) +@Table(name = "PRICING_PUNTOVENTA") +public class PricingPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_PUNTOVENTA_SEQ") + @Column(name = "PRICINGPTOVTA_ID") + private Integer pricingptovtaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingPuntoVenta() { + } + + public PricingPuntoVenta(Integer pricingptovtaId) { + this.pricingptovtaId = pricingptovtaId; + } + + public Integer getPricingptovtaId() { + return pricingptovtaId; + } + + public void setPricingptovtaId(Integer pricingptovtaId) { + this.pricingptovtaId = pricingptovtaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingptovtaId != null ? pricingptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingPuntoVenta)) { + return false; + } + PricingPuntoVenta other = (PricingPuntoVenta) object; + if ((this.pricingptovtaId == null && other.pricingptovtaId != null) || (this.pricingptovtaId != null && !this.pricingptovtaId.equals(other.pricingptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingPuntoventa[pricingptovtaId=" + pricingptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingRuta.java b/src/com/rjconsultores/ventaboletos/entidad/PricingRuta.java new file mode 100644 index 000000000..70c854095 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingRuta.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_RUTA_SEQ", sequenceName = "PRICING_RUTA_SEQ", allocationSize = 1) +@Table(name = "PRICING_RUTA") +public class PricingRuta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_RUTA_SEQ") + @Column(name = "PRICINGRUTA_ID") + private Integer pricingrutaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingRuta() { + } + + public PricingRuta(Integer pricingrutaId) { + this.pricingrutaId = pricingrutaId; + } + + public Integer getPricingrutaId() { + return pricingrutaId; + } + + public void setPricingrutaId(Integer pricingrutaId) { + this.pricingrutaId = pricingrutaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingrutaId != null ? pricingrutaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingRuta)) { + return false; + } + PricingRuta other = (PricingRuta) object; + if ((this.pricingrutaId == null && other.pricingrutaId != null) || (this.pricingrutaId != null && !this.pricingrutaId.equals(other.pricingrutaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingRuta[pricingrutaId=" + pricingrutaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingTipoPtoVta.java b/src/com/rjconsultores/ventaboletos/entidad/PricingTipoPtoVta.java new file mode 100644 index 000000000..ac1003a3d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingTipoPtoVta.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_TIPOPTOVTA_SEQ", sequenceName = "PRICING_TIPOPTOVTA_SEQ", allocationSize = 1) +@Table(name = "PRICING_TIPOPTOVTA") +public class PricingTipoPtoVta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_TIPOPTOVTA_SEQ") + @Column(name = "PRICINGTIPOPTOVTA_ID") + private Integer pricingtipoptovtaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPtovta; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingTipoPtoVta() { + } + + public PricingTipoPtoVta(Integer pricingtipoptovtaId) { + this.pricingtipoptovtaId = pricingtipoptovtaId; + } + + public Integer getPricingtipoptovtaId() { + return pricingtipoptovtaId; + } + + public void setPricingtipoptovtaId(Integer pricingtipoptovtaId) { + this.pricingtipoptovtaId = pricingtipoptovtaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public TipoPuntoVenta getTipoPtovta() { + return tipoPtovta; + } + + public void setTipoPtovta(TipoPuntoVenta tipoPtovta) { + this.tipoPtovta = tipoPtovta; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingtipoptovtaId != null ? pricingtipoptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingTipoPtoVta)) { + return false; + } + PricingTipoPtoVta other = (PricingTipoPtoVta) object; + if ((this.pricingtipoptovtaId == null && other.pricingtipoptovtaId != null) || (this.pricingtipoptovtaId != null && !this.pricingtipoptovtaId.equals(other.pricingtipoptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingTipoptovta[pricingtipoptovtaId=" + pricingtipoptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingTipoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/PricingTipoServicio.java new file mode 100644 index 000000000..cec06f164 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingTipoServicio.java @@ -0,0 +1,133 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "PRICING_TIPOSERVICIO_SEQ", sequenceName = "PRICING_TIPOSERVICIO_SEQ", allocationSize = 1) +@Table(name = "PRICING_TIPOSERVICIO") +public class PricingTipoServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_TIPOSERVICIO_SEQ") + @Column(name = "PRICINGTIPOSERVICIO_ID") + private Integer pricingtiposervicioId; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private int usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + @JoinColumn(name = "TIPOSERVICIO_ID", referencedColumnName = "TIPOSERVICIO_ID") + @ManyToOne + private TipoServicio tipoServicio; + + public PricingTipoServicio() { + } + + public PricingTipoServicio(Integer pricingtiposervicioId) { + this.pricingtiposervicioId = pricingtiposervicioId; + } + + public Integer getPricingtiposervicioId() { + return pricingtiposervicioId; + } + + public void setPricingtiposervicioId(Integer pricingtiposervicioId) { + this.pricingtiposervicioId = pricingtiposervicioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public int getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(int usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public TipoServicio getTipoServicio() { + return tipoServicio; + } + + public void setTipoServicio(TipoServicio tipoServicio) { + this.tipoServicio = tipoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingtiposervicioId != null ? pricingtiposervicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingTipoServicio)) { + return false; + } + PricingTipoServicio other = (PricingTipoServicio) object; + if ((this.pricingtiposervicioId == null && other.pricingtiposervicioId != null) || (this.pricingtiposervicioId != null && !this.pricingtiposervicioId.equals(other.pricingtiposervicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.PricingTiposervicio[pricingtiposervicioId=" + pricingtiposervicioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingVigencia.java b/src/com/rjconsultores/ventaboletos/entidad/PricingVigencia.java new file mode 100644 index 000000000..6a774cbfb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingVigencia.java @@ -0,0 +1,163 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRICING_VIGENCIA_SEQ", sequenceName = "PRICING_VIGENCIA_SEQ", allocationSize = 1) +@Table(name = "PRICING_VIGENCIA") +public class PricingVigencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_VIGENCIA_SEQ") + @Column(name = "PRICINGVIGENCIA_ID") + private Integer pricingvigenciaId; + @Column(name = "FECINICIOVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicioviaje; + @Column(name = "FECFINVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinviaje; + @Column(name = "FECINICIOVENTA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicioventa; + @Column(name = "FECFINVENTA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinventa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private Pricing pricing; + + public PricingVigencia() { + } + + public PricingVigencia(Integer pricingvigenciaId) { + this.pricingvigenciaId = pricingvigenciaId; + } + + public Integer getPricingvigenciaId() { + return pricingvigenciaId; + } + + public void setPricingvigenciaId(Integer pricingvigenciaId) { + this.pricingvigenciaId = pricingvigenciaId; + } + + public Date getFecinicioviaje() { + return fecinicioviaje; + } + + public void setFecinicioviaje(Date fecinicioviaje) { + this.fecinicioviaje = fecinicioviaje; + } + + public Date getFecfinviaje() { + return fecfinviaje; + } + + public void setFecfinviaje(Date fecfinviaje) { + this.fecfinviaje = fecfinviaje; + } + + public Date getFecinicioventa() { + return fecinicioventa; + } + + public void setFecinicioventa(Date fecinicioventa) { + this.fecinicioventa = fecinicioventa; + } + + public Date getFecfinventa() { + return fecfinventa; + } + + public void setFecfinventa(Date fecfinventa) { + this.fecfinventa = fecfinventa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingvigenciaId != null ? pricingvigenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PricingVigencia)) { + return false; + } + PricingVigencia other = (PricingVigencia) object; + if ((this.pricingvigenciaId == null && other.pricingvigenciaId != null) || (this.pricingvigenciaId != null && !this.pricingvigenciaId.equals(other.pricingvigenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingVigencia[pricingvigenciaId=" + pricingvigenciaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdClaseServicio.java b/src/com/rjconsultores/ventaboletos/entidad/ProdClaseServicio.java new file mode 100644 index 000000000..4d35011f4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdClaseServicio.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_CLASESERVICIO_SEQ", sequenceName = "PROD_CLASESERVICIO_SEQ", allocationSize = 1) +@Table(name = "PROD_CLASESERVICIO") +public class ProdClaseServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_CLASESERVICIO_SEQ") + @Column(name = "PRODCLASESERVICIO_ID") + private Integer prodclaseservicioId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public ProdClaseServicio() { + } + + public ProdClaseServicio(Integer prodclaseservicioId) { + this.prodclaseservicioId = prodclaseservicioId; + } + + public Integer getProdclaseservicioId() { + return prodclaseservicioId; + } + + public void setProdclaseservicioId(Integer prodclaseservicioId) { + this.prodclaseservicioId = prodclaseservicioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodclaseservicioId != null ? prodclaseservicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdClaseServicio)) { + return false; + } + ProdClaseServicio other = (ProdClaseServicio) object; + if ((this.prodclaseservicioId == null && other.prodclaseservicioId != null) || (this.prodclaseservicioId != null && !this.prodclaseservicioId.equals(other.prodclaseservicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdClaseservicio[prodclaseservicioId=" + prodclaseservicioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdFormaPago.java b/src/com/rjconsultores/ventaboletos/entidad/ProdFormaPago.java new file mode 100644 index 000000000..deb07048b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdFormaPago.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_FORMAPAGO_SEQ", sequenceName = "PROD_FORMAPAGO_SEQ", allocationSize = 1) +@Table(name = "PROD_FORMAPAGO") +public class ProdFormaPago implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_FORMAPAGO_SEQ") + @Column(name = "PRODFORMAPAGO_ID") + private Integer prodformapagoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + @JoinColumn(name = "FORMAPAGO_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago; + + public ProdFormaPago() { + } + + public ProdFormaPago(Integer prodformapagoId) { + this.prodformapagoId = prodformapagoId; + } + + public Integer getProdformapagoId() { + return prodformapagoId; + } + + public void setProdformapagoId(Integer prodformapagoId) { + this.prodformapagoId = prodformapagoId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodformapagoId != null ? prodformapagoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdFormaPago)) { + return false; + } + ProdFormaPago other = (ProdFormaPago) object; + if ((this.prodformapagoId == null && other.prodformapagoId != null) || (this.prodformapagoId != null && !this.prodformapagoId.equals(other.prodformapagoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdFormapago[prodformapagoId=" + prodformapagoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdMarca.java b/src/com/rjconsultores/ventaboletos/entidad/ProdMarca.java new file mode 100644 index 000000000..c2beedb32 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdMarca.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_MARCA_SEQ", sequenceName = "PROD_MARCA_SEQ", allocationSize = 1) +@Table(name = "PROD_MARCA") +public class ProdMarca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_MARCA_SEQ") + @Column(name = "PRODMARCA_ID") + private Integer prodmarcaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + public ProdMarca() { + } + + public ProdMarca(Integer prodmarcaId) { + this.prodmarcaId = prodmarcaId; + } + + public Integer getProdmarcaId() { + return prodmarcaId; + } + + public void setProdmarcaId(Integer prodmarcaId) { + this.prodmarcaId = prodmarcaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodmarcaId != null ? prodmarcaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdMarca)) { + return false; + } + ProdMarca other = (ProdMarca) object; + if ((this.prodmarcaId == null && other.prodmarcaId != null) || (this.prodmarcaId != null && !this.prodmarcaId.equals(other.prodmarcaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdMarca[prodmarcaId=" + prodmarcaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdMercado.java b/src/com/rjconsultores/ventaboletos/entidad/ProdMercado.java new file mode 100644 index 000000000..37b2fcbc4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdMercado.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_MERCADO_SEQ", sequenceName = "PROD_MERCADO_SEQ", allocationSize = 1) +@Table(name = "PROD_MERCADO") +public class ProdMercado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_MERCADO_SEQ") + @Column(name = "PRODMERCADO_ID") + private Integer prodmercadoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada1; + + public ProdMercado() { + } + + public ProdMercado(Integer prodmercadoId) { + this.prodmercadoId = prodmercadoId; + } + + public Integer getProdmercadoId() { + return prodmercadoId; + } + + public void setProdmercadoId(Integer prodmercadoId) { + this.prodmercadoId = prodmercadoId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public Parada getParada1() { + return parada1; + } + + public void setParada1(Parada parada1) { + this.parada1 = parada1; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodmercadoId != null ? prodmercadoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdMercado)) { + return false; + } + ProdMercado other = (ProdMercado) object; + if ((this.prodmercadoId == null && other.prodmercadoId != null) || (this.prodmercadoId != null && !this.prodmercadoId.equals(other.prodmercadoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdMercado[prodmercadoId=" + prodmercadoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdPrecio.java b/src/com/rjconsultores/ventaboletos/entidad/ProdPrecio.java new file mode 100644 index 000000000..6987d5ec3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdPrecio.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author gleimar + */ +@Entity +@SequenceGenerator(name = "PROD_PRECIO_SEQ", sequenceName = "PROD_PRECIO_SEQ", allocationSize = 1) +@Table(name = "PROD_PRECIO") +public class ProdPrecio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_PRECIO_SEQ") + @Column(name = "PRODPRECIO") + private Integer prodprecio; + // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation + @Column(name = "IMPORTEINICIAL") + private BigDecimal importeinicial; + @Column(name = "IMPORTEFINAL") + private BigDecimal importefinal; + @Column(name = "PRECIO") + private BigDecimal precio; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoservicio; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + public ProdPrecio() { + } + + public ProdPrecio(Integer prodprecio) { + this.prodprecio = prodprecio; + } + + public Integer getProdprecio() { + return prodprecio; + } + + public void setProdprecio(Integer prodprecio) { + this.prodprecio = prodprecio; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + public BigDecimal getImporteinicial() { + return importeinicial; + } + + public void setImporteinicial(BigDecimal importeinicial) { + this.importeinicial = importeinicial; + } + + public BigDecimal getImportefinal() { + return importefinal; + } + + public void setImportefinal(BigDecimal importefinal) { + this.importefinal = importefinal; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public ProductoServicio getProductoservicio() { + return productoservicio; + } + + public void setProductoservicio(ProductoServicio productoservicio) { + this.productoservicio = productoservicio; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ProdPrecio other = (ProdPrecio) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.productoservicio != other.productoservicio && (this.productoservicio == null || !this.productoservicio.equals(other.productoservicio))) { + return false; + } + if (this.marca != other.marca && (this.marca == null || !this.marca.equals(other.marca))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 53 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 53 * hash + (this.productoservicio != null ? this.productoservicio.hashCode() : 0); + hash = 53 * hash + (this.marca != null ? this.marca.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.entidad.ProdPrecio[ prodprecio=" + prodprecio + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/ProdPuntoVenta.java new file mode 100644 index 000000000..6c3844775 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdPuntoVenta.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_PUNTOVENTA_SEQ", sequenceName = "PROD_PUNTOVENTA_SEQ", allocationSize = 1) +@Table(name = "PROD_PUNTOVENTA") +public class ProdPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_PUNTOVENTA_SEQ") + @Column(name = "PRODPUNTOVENTA_ID") + private Integer prodpuntoventaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + + public ProdPuntoVenta() { + } + + public ProdPuntoVenta(Integer prodpuntoventaId) { + this.prodpuntoventaId = prodpuntoventaId; + } + + public Integer getProdpuntoventaId() { + return prodpuntoventaId; + } + + public void setProdpuntoventaId(Integer prodpuntoventaId) { + this.prodpuntoventaId = prodpuntoventaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodpuntoventaId != null ? prodpuntoventaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdPuntoVenta)) { + return false; + } + ProdPuntoVenta other = (ProdPuntoVenta) object; + if ((this.prodpuntoventaId == null && other.prodpuntoventaId != null) || (this.prodpuntoventaId != null && !this.prodpuntoventaId.equals(other.prodpuntoventaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdPuntoventa[prodpuntoventaId=" + prodpuntoventaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdRuta.java b/src/com/rjconsultores/ventaboletos/entidad/ProdRuta.java new file mode 100644 index 000000000..622435d40 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdRuta.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity + +@SequenceGenerator(name = "PROD_RUTA_SEQ", sequenceName = "PROD_RUTA_SEQ", allocationSize = 1) +@Table(name = "PROD_RUTA") +public class ProdRuta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_RUTA_SEQ") + @Column(name = "PRODRUTA_ID") + private Integer prodrutaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + + public ProdRuta() { + } + + public ProdRuta(Integer prodrutaId) { + this.prodrutaId = prodrutaId; + } + + public Integer getProdrutaId() { + return prodrutaId; + } + + public void setProdrutaId(Integer prodrutaId) { + this.prodrutaId = prodrutaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodrutaId != null ? prodrutaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdRuta)) { + return false; + } + ProdRuta other = (ProdRuta) object; + if ((this.prodrutaId == null && other.prodrutaId != null) || (this.prodrutaId != null && !this.prodrutaId.equals(other.prodrutaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdRuta[prodrutaId=" + prodrutaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdTipoptovta.java b/src/com/rjconsultores/ventaboletos/entidad/ProdTipoptovta.java new file mode 100644 index 000000000..388f85e9c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdTipoptovta.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_TIPOPTOVTA_SEQ", sequenceName = "PROD_TIPOPTOVTA_SEQ", allocationSize = 1) +@Table(name = "PROD_TIPOPTOVTA") +public class ProdTipoptovta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_TIPOPTOVTA_SEQ") + @Column(name = "PRODTIPOPTOVTA_ID") + private Integer prodtipoptovtaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPtovta; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + + public ProdTipoptovta() { + } + + public ProdTipoptovta(Integer prodtipoptovtaId) { + this.prodtipoptovtaId = prodtipoptovtaId; + } + + public Integer getProdtipoptovtaId() { + return prodtipoptovtaId; + } + + public void setProdtipoptovtaId(Integer prodtipoptovtaId) { + this.prodtipoptovtaId = prodtipoptovtaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public TipoPuntoVenta getTipoPtovta() { + return tipoPtovta; + } + + public void setTipoPtovta(TipoPuntoVenta tipoPtovta) { + this.tipoPtovta = tipoPtovta; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodtipoptovtaId != null ? prodtipoptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdTipoptovta)) { + return false; + } + ProdTipoptovta other = (ProdTipoptovta) object; + if ((this.prodtipoptovtaId == null && other.prodtipoptovtaId != null) || (this.prodtipoptovtaId != null && !this.prodtipoptovtaId.equals(other.prodtipoptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdTipoptovta[prodtipoptovtaId=" + prodtipoptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProdVigencia.java b/src/com/rjconsultores/ventaboletos/entidad/ProdVigencia.java new file mode 100644 index 000000000..e9e0ee471 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProdVigencia.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PROD_VIGENCIA_SEQ", sequenceName = "PROD_VIGENCIA_SEQ", allocationSize = 1) +@Table(name = "PROD_VIGENCIA") +public class ProdVigencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PROD_VIGENCIA_SEQ") + @Basic(optional = false) + @Column(name = "PRODVIGENCIA_ID") + private Integer prodvigenciaId; + @Column(name = "FECVIGENCIAINICIO") + @Temporal(TemporalType.DATE) + private Date fecvigenciainicio; + @Column(name = "FECVIGENCIAFIN") + @Temporal(TemporalType.DATE) + private Date fecvigenciafin; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRODUCTOSERVICIO_ID", referencedColumnName = "PRODUCTOSERVICIO_ID") + @ManyToOne + private ProductoServicio productoServicio; + + public ProdVigencia() { + } + + public ProdVigencia(Integer prodvigenciaId) { + this.prodvigenciaId = prodvigenciaId; + } + + public Integer getProdvigenciaId() { + return prodvigenciaId; + } + + public void setProdvigenciaId(Integer prodvigenciaId) { + this.prodvigenciaId = prodvigenciaId; + } + + public Date getFecvigenciainicio() { + return fecvigenciainicio; + } + + public void setFecvigenciainicio(Date fecvigenciainicio) { + this.fecvigenciainicio = fecvigenciainicio; + } + + public Date getFecvigenciafin() { + return fecvigenciafin; + } + + public void setFecvigenciafin(Date fecvigenciafin) { + this.fecvigenciafin = fecvigenciafin; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (prodvigenciaId != null ? prodvigenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProdVigencia)) { + return false; + } + ProdVigencia other = (ProdVigencia) object; + if ((this.prodvigenciaId == null && other.prodvigenciaId != null) || (this.prodvigenciaId != null && !this.prodvigenciaId.equals(other.prodvigenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProdVigencia[prodvigenciaId=" + prodvigenciaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ProductoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/ProductoServicio.java new file mode 100644 index 000000000..dbd845123 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ProductoServicio.java @@ -0,0 +1,299 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PRODUCTO_SERVICIO_SEQ", sequenceName = "PRODUCTO_SERVICIO_SEQ", allocationSize = 1) +@Table(name = "PRODUCTO_SERVICIO") +public class ProductoServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRODUCTO_SERVICIO_SEQ") + @Basic(optional = false) + @Column(name = "PRODUCTOSERVICIO_ID") + private Integer productoservicioId; + @Column(name = "DESCPRODUCTOSERVICIO") + private String descproductoservicio; + @Column(name = "INDTIPO") + private String indtipo; + @Column(name = "DESCIMPRESIONBOLETO") + private String descImpresionBoleto; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodRutaList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodMarcaList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodTipoptovtaList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodPuntoVentaList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodFormaPagoList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodMercadoList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodVigenciaList; + @OneToMany(mappedBy = "productoServicio", cascade = CascadeType.ALL) + private List prodClaseServicioList; + @OneToMany(mappedBy = "productoservicio", cascade = CascadeType.ALL) + private List prodPrecioList; + + public ProductoServicio() { + } + + public ProductoServicio(Integer productoservicioId) { + this.productoservicioId = productoservicioId; + } + + public Integer getProductoservicioId() { + return productoservicioId; + } + + public void setProductoservicioId(Integer productoservicioId) { + this.productoservicioId = productoservicioId; + } + + public String getDescproductoservicio() { + return descproductoservicio; + } + + public void setDescproductoservicio(String descproductoservicio) { + this.descproductoservicio = descproductoservicio; + } + + public String getIndtipo() { + return indtipo; + } + + public void setIndtipo(String indtipo) { + this.indtipo = indtipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public List getProdClaseServicioList() { + List poList = new ArrayList(); + for (ProdClaseServicio po : this.prodClaseServicioList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdClaseServicioList(List prodClaseServicioList) { + this.prodClaseServicioList = prodClaseServicioList; + } + + public List getProdFormaPagoList() { + List poList = new ArrayList(); + for (ProdFormaPago po : this.prodFormaPagoList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdFormaPagoList(List prodFormaPagoList) { + this.prodFormaPagoList = prodFormaPagoList; + } + + public List getProdMarcaList() { + List poList = new ArrayList(); + for (ProdMarca po : this.prodMarcaList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdMarcaList(List prodMarcaList) { + this.prodMarcaList = prodMarcaList; + } + + public List getProdMercadoList() { + + List poList = new ArrayList(); + for (ProdMercado po : this.prodMercadoList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdMercadoList(List prodMercadoList) { + this.prodMercadoList = prodMercadoList; + } + + public List getProdPuntoVentaList() { + + List poList = new ArrayList(); + for (ProdPuntoVenta po : this.prodPuntoVentaList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdPuntoVentaList(List prodPuntoVentaList) { + this.prodPuntoVentaList = prodPuntoVentaList; + } + + public List getProdRutaList() { + List poList = new ArrayList(); + for (ProdRuta po : this.prodRutaList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdRutaList(List prodRutaList) { + this.prodRutaList = prodRutaList; + } + + public List getProdTipoptovtaList() { + List poList = new ArrayList(); + for (ProdTipoptovta po : this.prodTipoptovtaList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdTipoptovtaList(List prodTipoptovtaList) { + this.prodTipoptovtaList = prodTipoptovtaList; + } + + public List getProdVigenciaList() { + List poList = new ArrayList(); + for (ProdVigencia po : this.prodVigenciaList) { + if (po.getActivo() == Boolean.TRUE) { + poList.add(po); + } + } + return poList; + } + + public void setProdVigenciaList(List prodVigenciaList) { + this.prodVigenciaList = prodVigenciaList; + } + + public List getProdPrecioList() { + List ppList = new ArrayList(); + for (ProdPrecio pp : this.prodPrecioList) { + if (pp.getActivo() == Boolean.TRUE) { + ppList.add(pp); + } + } + return ppList; + } + + public void setProdPrecioList(List prodPrecioList) { + this.prodPrecioList = prodPrecioList; + } + + public String getDescImpresionBoleto() { + return descImpresionBoleto; + } + + public void setDescImpresionBoleto(String descImpresionBoleto) { + this.descImpresionBoleto = descImpresionBoleto; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (productoservicioId != null ? productoservicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ProductoServicio)) { + return false; + } + ProductoServicio other = (ProductoServicio) object; + if ((this.productoservicioId == null && other.productoservicioId != null) || (this.productoservicioId != null && !this.productoservicioId.equals(other.productoservicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.utilerias.ProductoServicio[productoservicioId=" + productoservicioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtoVtaUsuarioBancario.java b/src/com/rjconsultores/ventaboletos/entidad/PtoVtaUsuarioBancario.java new file mode 100644 index 000000000..faea97fa4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PtoVtaUsuarioBancario.java @@ -0,0 +1,149 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@Table(name = "PTOVTA_USUARIO_BANCARIO") +public class PtoVtaUsuarioBancario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "PTOVTAUSUARIOBANCARIO_ID") + private Integer ptovtaUsuarioBancarioID; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + @JoinColumn(name = "USUARIOBANCARIO_ID", referencedColumnName = "USUARIOBANCARIO_ID") + @ManyToOne + private UsuarioBancario usuarioBancario; + + public PtoVtaUsuarioBancario() { + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getPtovtaUsuarioBancarioID() { + return ptovtaUsuarioBancarioID; + } + + public void setPtovtaUsuarioBancarioID(Integer ptovtaUsuarioBancarioID) { + this.ptovtaUsuarioBancarioID = ptovtaUsuarioBancarioID; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public UsuarioBancario getUsuarioBancario() { + return usuarioBancario; + } + + public void setUsuarioBancario(UsuarioBancario usuarioBancario) { + this.usuarioBancario = usuarioBancario; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PtoVtaUsuarioBancario other = (PtoVtaUsuarioBancario) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.empresa != other.empresa && (this.empresa == null || !this.empresa.equals(other.empresa))) { + return false; + } + if (this.puntoVenta != other.puntoVenta && (this.puntoVenta == null || !this.puntoVenta.equals(other.puntoVenta))) { + return false; + } + if (this.usuarioBancario != other.usuarioBancario && (this.usuarioBancario == null || !this.usuarioBancario.equals(other.usuarioBancario))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 97 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 97 * hash + (this.empresa != null ? this.empresa.hashCode() : 0); + hash = 97 * hash + (this.puntoVenta != null ? this.puntoVenta.hashCode() : 0); + hash = 97 * hash + (this.usuarioBancario != null ? this.usuarioBancario.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "PtoVtaUsuarioBancario{" + "ptovtaUsuarioBancarioID=" + ptovtaUsuarioBancarioID + '}'; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtovtaEmpresa.java b/src/com/rjconsultores/ventaboletos/entidad/PtovtaEmpresa.java new file mode 100644 index 000000000..232c77d07 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PtovtaEmpresa.java @@ -0,0 +1,138 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "PTOVTA_EMPRESA_SEQ", sequenceName = "PTOVTA_EMPRESA_SEQ", allocationSize = 1) +@Table(name = "PTOVTA_EMPRESA") +public class PtovtaEmpresa implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTA_EMPRESA_SEQ") + @Column(name = "PTOVTAEMPRESA_ID") + private Integer ptovtaempresaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + + public PtovtaEmpresa() { + } + + public PtovtaEmpresa(Integer ptovtaempresaId) { + this.ptovtaempresaId = ptovtaempresaId; + } + + public Integer getPtovtaempresaId() { + return ptovtaempresaId; + } + + public void setPtovtaempresaId(Integer ptovtaempresaId) { + this.ptovtaempresaId = ptovtaempresaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (ptovtaempresaId != null ? ptovtaempresaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PtovtaEmpresa other = (PtovtaEmpresa) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.empresa != other.empresa && (this.empresa == null || !this.empresa.equals(other.empresa))) { + return false; + } + if (this.puntoVenta != other.puntoVenta && (this.puntoVenta == null || !this.puntoVenta.equals(other.puntoVenta))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa[ptovtaempresaId=" + ptovtaempresaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java new file mode 100644 index 000000000..1ec25a280 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java @@ -0,0 +1,408 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "PUNTO_VENTA_SEQ", sequenceName = "PUNTO_VENTA_SEQ", allocationSize = 1) +@Table(name = "PUNTO_VENTA") +public class PuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PUNTO_VENTA_SEQ") + @Column(name = "PUNTOVENTA_ID") + private Integer puntoventaId; + @Column(name = "NOMBPUNTOVENTA") + private String nombpuntoventa; + @Column(name = "DIRECCIONCALLE") + private String direccioncalle; + @Column(name = "DIRECCIONNUMERO") + private String direccionnumero; + @Column(name = "STATUSAPROBACION") + private String statusaprobacion; + @Column(name = "COMENTARIOS") + private String comentarios; + @Column(name = "NUMTELEFONOUNO") + private String numtelefonouno; + @Column(name = "NUMTELEFONODOS") + private String numtelefonodos; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "DESCCORREO") + private String descCorreo; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @OneToOne + @JoinColumn(name = "COLONIA_ID") + private Colonia colonia; + @OneToOne + @JoinColumn(name = "MONEDA_ID") + private Moneda moneda; + @OneToOne + @JoinColumn(name = "PARADA_ID") + private Parada parada; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPuntoVenta; + @OneToMany(mappedBy = "puntoVenta") + private List reservacionPuntoventaList; + @OneToOne + @JoinColumn(name = "NODO_ID") + private Nodo nodo; + @Column(name = "INDCONEXIONBANCARIA") + private String conexionBancaria; + @Column(name = "DSCUSUARIOINTERNET") + private String dscUsuarioInternet; + @Column(name = "DSCCONTRASENAINTERNET") + private String dscContrasenaInternet; + @OneToOne + @JoinColumn(name = "USUARIOBANCARIO_ID") + private UsuarioBancario usuarioBancario; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + private List lsFormaPagoDet; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + private List lsParamRecoleccion; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + private List lsPtovtaEmpresa; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + private List lsPtovtaUsuarioBancario; + + public PuntoVenta() { + } + + public PuntoVenta(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public Integer getPuntoventaId() { + return puntoventaId; + } + + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public Nodo getNodo() { + return nodo; + } + + public void setNodo(Nodo nodo) { + this.nodo = nodo; + } + + public String getNombpuntoventa() { + return nombpuntoventa; + } + + public void setNombpuntoventa(String nombpuntoventa) { + this.nombpuntoventa = nombpuntoventa; + } + + public String getDireccioncalle() { + return direccioncalle; + } + + public void setDireccioncalle(String direccioncalle) { + this.direccioncalle = direccioncalle; + } + + public String getDireccionnumero() { + return direccionnumero; + } + + public void setDireccionnumero(String direccionnumero) { + this.direccionnumero = direccionnumero; + } + + public String getStatusaprobacion() { + return statusaprobacion; + } + + public void setStatusaprobacion(String statusaprobacion) { + this.statusaprobacion = statusaprobacion; + } + + public String getComentarios() { + return comentarios; + } + + public void setComentarios(String comentarios) { + this.comentarios = comentarios; + } + + public String getNumtelefonouno() { + return numtelefonouno; + } + + public void setNumtelefonouno(String numtelefonouno) { + this.numtelefonouno = numtelefonouno; + } + + public String getNumtelefonodos() { + return numtelefonodos; + } + + public void setNumtelefonodos(String numtelefonodos) { + this.numtelefonodos = numtelefonodos; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public TipoPuntoVenta getTipoPuntoVenta() { + return tipoPuntoVenta; + } + + public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + this.tipoPuntoVenta = tipoPuntoVenta; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public List getReservacionPuntoventaList() { + return reservacionPuntoventaList; + } + + public void setReservacionPuntoventaList(List reservacionPuntoventaList) { + this.reservacionPuntoventaList = reservacionPuntoventaList; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public List getLsFormaPagoDet() { + List tmp = new ArrayList(); + if (lsFormaPagoDet != null) { + for (FormaPagoDet ddab : this.lsFormaPagoDet) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsFormaPagoDet = tmp; + + return tmp; + } + + public List getLsParamRecoleccion() { + List tmp = new ArrayList(); + if (this.lsParamRecoleccion != null) { + for (ParamRecoleccion ddab : this.lsParamRecoleccion) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsParamRecoleccion = tmp; + + return tmp; + } + + public List getLsPtovtaEmpresa() { + List tmp = new ArrayList(); + if (this.lsPtovtaEmpresa != null) { + for (PtovtaEmpresa ddab : this.lsPtovtaEmpresa) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsPtovtaEmpresa = tmp; + + return tmp; + +// return lsPtovtaEmpresa; + } + + public void setLsPtovtaEmpresa(List lsPtovtaEmpresa) { + this.lsPtovtaEmpresa = lsPtovtaEmpresa; + } + + public List getLsPtovtaUsuarioBancario() { + List tmp = new ArrayList(); + if (this.lsPtovtaUsuarioBancario != null) { + for (PtoVtaUsuarioBancario ddab : this.lsPtovtaUsuarioBancario) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsPtovtaUsuarioBancario = tmp; + + return tmp; + //return lsPtovtaUsuarioBancario; + } + + public void setLsPtovtaUsuarioBancario(List lsPtovtaUsuarioBancario) { + this.lsPtovtaUsuarioBancario = lsPtovtaUsuarioBancario; + } + + public void setLsParamRecoleccion(List lsParamRecoleccion) { + this.lsParamRecoleccion = lsParamRecoleccion; + } + + public String getConexionBancaria() { + return conexionBancaria; + } + + public void setConexionBancaria(String conexionBancaria) { + this.conexionBancaria = conexionBancaria; + } + + public UsuarioBancario getUsuarioBancario() { + return usuarioBancario; + } + + public void setUsuarioBancario(UsuarioBancario usuarioBancario) { + this.usuarioBancario = usuarioBancario; + } + + public void setLsFormaPagoDet(List lsFormaPagoDet) { + this.lsFormaPagoDet = lsFormaPagoDet; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (puntoventaId != null ? puntoventaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof PuntoVenta)) { + return false; + } + PuntoVenta other = (PuntoVenta) object; + if ((this.puntoventaId == null && other.puntoventaId != null) || (this.puntoventaId != null && !this.puntoventaId.equals(other.puntoventaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getNombpuntoventa(); + } + + /** + * @return the colonia + */ + public Colonia getColonia() { + return colonia; + } + + /** + * @param colonia the colonia to set + */ + public void setColonia(Colonia colonia) { + this.colonia = colonia; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public String getDescCorreo() { + return descCorreo; + } + + public void setDescCorreo(String descCorreo) { + this.descCorreo = descCorreo; + } + + public String getDscContrasenaInternet() { + return dscContrasenaInternet; + } + + public void setDscContrasenaInternet(String dscContrasenaInternet) { + this.dscContrasenaInternet = dscContrasenaInternet; + } + + public String getDscUsuarioInternet() { + return dscUsuarioInternet; + } + + public void setDscUsuarioInternet(String dscUsuarioInternet) { + this.dscUsuarioInternet = dscUsuarioInternet; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Redondeo.java b/src/com/rjconsultores/ventaboletos/entidad/Redondeo.java new file mode 100644 index 000000000..77dbc0a93 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Redondeo.java @@ -0,0 +1,169 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "REDONDEO_SEQ", sequenceName = "REDONDEO_SEQ", allocationSize = 1) +@Table(name = "REDONDEO") +public class Redondeo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_SEQ") + @Basic(optional = false) + @Column(name = "REDONDEO_ID") + private Integer redondeoId; + @Column(name = "VALORINICIAL") + private BigDecimal valorinicial; + @Column(name = "VALORFINAL") + private BigDecimal valorfinal; + @Column(name = "VALORREDONDEO") + private BigDecimal valorredondeo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "REDONDEOCTRL_ID", referencedColumnName = "REDONDEOCTRL_ID") + @ManyToOne + private RedondeoCtrl redondeoCtrl; + + public Redondeo() { + } + + public Redondeo(Integer redondeoId) { + this.redondeoId = redondeoId; + } + + public Integer getRedondeoId() { + return redondeoId; + } + + public void setRedondeoId(Integer redondeoId) { + this.redondeoId = redondeoId; + } + + public BigDecimal getValorinicial() { + return valorinicial; + } + + public void setValorinicial(BigDecimal valorinicial) { + this.valorinicial = valorinicial; + } + + public BigDecimal getValorfinal() { + return valorfinal; + } + + public void setValorfinal(BigDecimal valorfinal) { + this.valorfinal = valorfinal; + } + + public BigDecimal getValorredondeo() { + return valorredondeo; + } + + public void setValorredondeo(BigDecimal valorredondeo) { + this.valorredondeo = valorredondeo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public RedondeoCtrl getRedondeoCtrl() { + return redondeoCtrl; + } + + public void setRedondeoCtrl(RedondeoCtrl redondeoCtrl) { + this.redondeoCtrl = redondeoCtrl; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Redondeo other = (Redondeo) obj; + if (this.valorinicial != other.valorinicial && (this.valorinicial == null || !this.valorinicial.equals(other.valorinicial))) { + return false; + } + if (this.valorfinal != other.valorfinal && (this.valorfinal == null || !this.valorfinal.equals(other.valorfinal))) { + return false; + } + if (this.valorredondeo != other.valorredondeo && (this.valorredondeo == null || !this.valorredondeo.equals(other.valorredondeo))) { + return false; + } + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.redondeoCtrl != other.redondeoCtrl && (this.redondeoCtrl == null || !this.redondeoCtrl.equals(other.redondeoCtrl))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 41 * hash + (this.valorinicial != null ? this.valorinicial.hashCode() : 0); + hash = 41 * hash + (this.valorfinal != null ? this.valorfinal.hashCode() : 0); + hash = 41 * hash + (this.valorredondeo != null ? this.valorredondeo.hashCode() : 0); + hash = 41 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 41 * hash + (this.redondeoCtrl != null ? this.redondeoCtrl.hashCode() : 0); + return hash; + } + + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Redondeo[redondeoId=" + redondeoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RedondeoCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/RedondeoCtrl.java new file mode 100644 index 000000000..795f4ce88 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RedondeoCtrl.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "REDONDEO_CTRL_SEQ", sequenceName = "REDONDEO_CTRL_SEQ", allocationSize = 1) +@Table(name = "REDONDEO_CTRL") +public class RedondeoCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_CTRL_SEQ") + @Basic(optional = false) + @Column(name = "REDONDEOCTRL_ID") + private Integer redondeoctrlId; + @Column(name = "INDAPLICADESCUENTO") + private Boolean indaplicadescuento; + @Column(name = "INDAPLICAPRICING") + private Boolean indaplicapricing; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "redondeoCtrl", cascade = CascadeType.ALL) + private List redondeoMarcaList; + @OneToMany(mappedBy = "redondeoCtrl", cascade = CascadeType.ALL) + private List redondeoList; + + public RedondeoCtrl() { + } + + public RedondeoCtrl(Integer redondeoctrlId) { + this.redondeoctrlId = redondeoctrlId; + } + + public Integer getRedondeoctrlId() { + return redondeoctrlId; + } + + public void setRedondeoctrlId(Integer redondeoctrlId) { + this.redondeoctrlId = redondeoctrlId; + } + + public Boolean getIndaplicadescuento() { + return indaplicadescuento; + } + + public void setIndaplicadescuento(Boolean indaplicadescuento) { + this.indaplicadescuento = indaplicadescuento; + } + + public Boolean getIndaplicapricing() { + return indaplicapricing; + } + + public void setIndaplicapricing(Boolean indaplicapricing) { + this.indaplicapricing = indaplicapricing; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getRedondeoMarcaList() { + List rmList = new ArrayList(); + for (RedondeoMarca rm : this.redondeoMarcaList) { + if (rm.getActivo() == Boolean.TRUE) { + rmList.add(rm); + } + } + return rmList; + } + + public void setRedondeoMarcaList(List redondeoMarcaList) { + this.redondeoMarcaList = redondeoMarcaList; + } + + public List getRedondeoList() { + List rmList = new ArrayList(); + for (Redondeo rm : this.redondeoList) { + if (rm.getActivo() == Boolean.TRUE) { + rmList.add(rm); + } + } + return rmList; + } + + public void setRedondeoList(List redondeoList) { + this.redondeoList = redondeoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (redondeoctrlId != null ? redondeoctrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RedondeoCtrl)) { + return false; + } + RedondeoCtrl other = (RedondeoCtrl) object; + if ((this.redondeoctrlId == null && other.redondeoctrlId != null) || (this.redondeoctrlId != null && !this.redondeoctrlId.equals(other.redondeoctrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.RedondeoCtrl[redondeoctrlId=" + redondeoctrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RedondeoMarca.java b/src/com/rjconsultores/ventaboletos/entidad/RedondeoMarca.java new file mode 100644 index 000000000..6058d0508 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RedondeoMarca.java @@ -0,0 +1,144 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "REDONDEO_MARCA_SEQ", sequenceName = "REDONDEO_MARCA_SEQ", allocationSize = 1) +@Table(name = "REDONDEO_MARCA") +public class RedondeoMarca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_MARCA_SEQ") + @Basic(optional = false) + @Column(name = "REDONDEO_MARCA") + private Integer redondeoMarca; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "REDONDEOCTRL_ID", referencedColumnName = "REDONDEOCTRL_ID") + @ManyToOne + private RedondeoCtrl redondeoCtrl; + @OneToOne + @JoinColumn(name = "MARCA_ID") + private Marca marca; + + public RedondeoMarca() { + } + + public RedondeoMarca(Integer redondeoMarca) { + this.redondeoMarca = redondeoMarca; + } + + public Integer getRedondeoMarca() { + return redondeoMarca; + } + + public void setRedondeoMarca(Integer redondeoMarca) { + this.redondeoMarca = redondeoMarca; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public RedondeoCtrl getRedondeoCtrl() { + return redondeoCtrl; + } + + public void setRedondeoCtrl(RedondeoCtrl redondeoCtrl) { + this.redondeoCtrl = redondeoCtrl; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final RedondeoMarca other = (RedondeoMarca) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.redondeoCtrl != other.redondeoCtrl && (this.redondeoCtrl == null || !this.redondeoCtrl.equals(other.redondeoCtrl))) { + return false; + } + if (this.marca != other.marca && (this.marca == null || !this.marca.equals(other.marca))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 47 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 47 * hash + (this.redondeoCtrl != null ? this.redondeoCtrl.hashCode() : 0); + hash = 47 * hash + (this.marca != null ? this.marca.hashCode() : 0); + return hash; + } + + + + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.RedondeoMarca[redondeoMarca=" + redondeoMarca + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionCategoria.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionCategoria.java new file mode 100644 index 000000000..823873551 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionCategoria.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESERVACION_CATEGORIA_SEQ", sequenceName = "RESERVACION_CATEGORIA_SEQ", allocationSize = 1) +@Table(name = "RESERVACION_CATEGORIA") +public class ReservacionCategoria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_CATEGORIA_SEQ") + @Column(name = "RESERVACIONCATEGORIA_ID") + private Integer reservacioncategoriaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID") + @ManyToOne + private ReservacionCtrl reservacionCtrl; + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + + public ReservacionCategoria() { + } + + public ReservacionCategoria(Integer reservacioncategoriaId) { + this.reservacioncategoriaId = reservacioncategoriaId; + } + + public Integer getReservacioncategoriaId() { + return reservacioncategoriaId; + } + + public void setReservacioncategoriaId(Integer reservacioncategoriaId) { + this.reservacioncategoriaId = reservacioncategoriaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReservacionCategoria other = (ReservacionCategoria) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) { + return false; + } + if (this.categoria != other.categoria && (this.categoria == null || !this.categoria.equals(other.categoria))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 73 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 73 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0); + hash = 73 * hash + (this.categoria != null ? this.categoria.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionCategoria[reservacioncategoriaId=" + reservacioncategoriaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionClase.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionClase.java new file mode 100644 index 000000000..107cba96b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionClase.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESERVACION_CLASE_SEQ", sequenceName = "RESERVACION_CLASE_SEQ", allocationSize = 1) +@Table(name = "RESERVACION_CLASE") +public class ReservacionClase implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_CLASE_SEQ") + @Column(name = "RESERVACIONCLASE_ID") + private Integer reservacionclaseId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID") + @ManyToOne + private ReservacionCtrl reservacionCtrl; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public ReservacionClase() { + } + + public ReservacionClase(Integer reservacionclaseId) { + this.reservacionclaseId = reservacionclaseId; + } + + public Integer getReservacionclaseId() { + return reservacionclaseId; + } + + public void setReservacionclaseId(Integer reservacionclaseId) { + this.reservacionclaseId = reservacionclaseId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReservacionClase other = (ReservacionClase) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) { + return false; + } + if (this.claseServicio != other.claseServicio && (this.claseServicio == null || !this.claseServicio.equals(other.claseServicio))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 97 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 97 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0); + hash = 97 * hash + (this.claseServicio != null ? this.claseServicio.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionClase[reservacionclaseId=" + reservacionclaseId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionCtrl.java new file mode 100644 index 000000000..60b390aee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionCtrl.java @@ -0,0 +1,424 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESERVACION_CTRL_SEQ", sequenceName = "RESERVACION_CTRL_SEQ", allocationSize = 1) +@Table(name = "RESERVACION_CTRL") +public class ReservacionCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_CTRL_SEQ") + @Column(name = "RESERVACIONCTRL_ID") + private Integer reservacionctrlId; + @Column(name = "DESCCONFIG") + private String descConfig; + @Column(name = "FECINICIO") + @Temporal(TemporalType.DATE) + private Date fecinicio; + @Column(name = "FECFINAL") + @Temporal(TemporalType.DATE) + private Date fecfinal; + @Column(name = "TIEMPOLIBERACION") + @Temporal(TemporalType.TIMESTAMP) + private Date tiempoliberacion; + @Column(name = "TIEMPOLIBERACIONINTERNET") + @Temporal(TemporalType.TIMESTAMP) + private Date tiempoliberacioninternet; + @Column(name = "TIEMPOPREVIO") + @Temporal(TemporalType.TIMESTAMP) + private Date tiempoprevio; + @Column(name = "TIEMPOPREVIOINTERNET") + @Temporal(TemporalType.TIMESTAMP) + private Date tiempopreviointernet; + @Column(name = "NUMASIENTOSCORRIDA") + private Short numasientoscorrida; + @Column(name = "INDAPLICLUN") + private Boolean indapliclun; + @Column(name = "INDAPLICMAR") + private Boolean indaplicmar; + @Column(name = "INDAPLICMIE") + private Boolean indaplicmie; + @Column(name = "INDAPLICJUE") + private Boolean indaplicjue; + @Column(name = "INDAPLICVIE") + private Boolean indaplicvie; + @Column(name = "INDAPLICSAB") + private Boolean indaplicsab; + @Column(name = "INDAPLICDOM") + private Boolean indaplicdom; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "reservacionCtrl", cascade = CascadeType.ALL) + private List reservacionCategoriaList; + @OneToMany(mappedBy = "reservacionCtrl", cascade = CascadeType.ALL) + private List reservacionMercadoList; + @OneToMany(mappedBy = "reservacionCtrl", cascade = CascadeType.ALL) + private List reservacionMarcaList; + @OneToMany(mappedBy = "reservacionCtrl", cascade = CascadeType.ALL) + private List reservacionClaseList; + @OneToMany(mappedBy = "reservacionCtrl", cascade = CascadeType.ALL) + private List reservacionPuntoVentaList; + + public ReservacionCtrl() { + } + + public ReservacionCtrl(Integer reservacionctrlId) { + this.reservacionctrlId = reservacionctrlId; + } + + public ReservacionCtrl(Integer reservacionctrlId, Date fecmodif) { + this.reservacionctrlId = reservacionctrlId; + this.fecmodif = fecmodif; + } + + public Integer getReservacionctrlId() { + return reservacionctrlId; + } + + public void setReservacionctrlId(Integer reservacionctrlId) { + this.reservacionctrlId = reservacionctrlId; + } + + public Date getFecinicio() { + return fecinicio; + } + + public void setFecinicio(Date fecinicio) { + this.fecinicio = fecinicio; + } + + public Date getFecfinal() { + return fecfinal; + } + + public void setFecfinal(Date fecfinal) { + this.fecfinal = fecfinal; + } + + public Date getTiempoliberacion() { + return tiempoliberacion; + } + + public void setTiempoliberacion(Integer hora, Integer minuto) { + Calendar c = Calendar.getInstance(); + c.set(Calendar.YEAR, 1970); + c.set(Calendar.DAY_OF_MONTH, 1); + c.set(Calendar.MONTH, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + setTiempoliberacion(c.getTime()); + } + + public void setTiempoliberacion(Date tiempoliberacion) { + this.tiempoliberacion = tiempoliberacion; + } + + public Date getTiempoliberacioninternet() { + return tiempoliberacioninternet; + } + + public void setTiempoliberacioninternet(Integer hora, Integer minuto) { + Calendar c = Calendar.getInstance(); + c.set(Calendar.YEAR, 1970); + c.set(Calendar.DAY_OF_MONTH, 1); + c.set(Calendar.MONTH, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + setTiempoliberacioninternet(c.getTime()); + } + + public void setTiempoliberacioninternet(Date tiempoliberacioninternet) { + this.tiempoliberacioninternet = tiempoliberacioninternet; + } + + public Date getTiempoprevio() { + return tiempoprevio; + } + + public void setTiempoprevio(Integer hora, Integer minuto) { + Calendar c = Calendar.getInstance(); + c.set(Calendar.YEAR, 1970); + c.set(Calendar.DAY_OF_MONTH, 1); + c.set(Calendar.MONTH, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + setTiempoprevio(c.getTime()); + } + + public void setTiempoprevio(Date tiempoprevio) { + this.tiempoprevio = tiempoprevio; + } + + public Date getTiempopreviointernet() { + return tiempopreviointernet; + } + + public void setTiempopreviointernet(Integer hora, Integer minuto) { + Calendar c = Calendar.getInstance(); + c.set(Calendar.YEAR, 1970); + c.set(Calendar.DAY_OF_MONTH, 1); + c.set(Calendar.MONTH, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + setTiempopreviointernet(c.getTime()); + } + + public void setTiempopreviointernet(Date tiempopreviointernet) { + this.tiempopreviointernet = tiempopreviointernet; + } + + public Short getNumasientoscorrida() { + return numasientoscorrida; + } + + public void setNumasientoscorrida(Short numasientoscorrida) { + this.numasientoscorrida = numasientoscorrida; + } + + public Boolean getIndaplicdom() { + return indaplicdom; + } + + public void setIndaplicdom(Boolean indaplicdom) { + this.indaplicdom = indaplicdom; + } + + public Boolean getIndaplicjue() { + return indaplicjue; + } + + public void setIndaplicjue(Boolean indaplicjue) { + this.indaplicjue = indaplicjue; + } + + public Boolean getIndapliclun() { + return indapliclun; + } + + public void setIndapliclun(Boolean indapliclun) { + this.indapliclun = indapliclun; + } + + public Boolean getIndaplicmar() { + return indaplicmar; + } + + public void setIndaplicmar(Boolean indaplicmar) { + this.indaplicmar = indaplicmar; + } + + public Boolean getIndaplicmie() { + return indaplicmie; + } + + public void setIndaplicmie(Boolean indaplicmie) { + this.indaplicmie = indaplicmie; + } + + public Boolean getIndaplicsab() { + return indaplicsab; + } + + public void setIndaplicsab(Boolean indaplicsab) { + this.indaplicsab = indaplicsab; + } + + public Boolean getIndaplicvie() { + return indaplicvie; + } + + public void setIndaplicvie(Boolean indaplicvie) { + this.indaplicvie = indaplicvie; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getReservacionCategoriaList() { + List rcList = new ArrayList(); + if (reservacionCategoriaList != null) { + for (ReservacionCategoria rc : this.reservacionCategoriaList) { + if (rc.getActivo() == Boolean.TRUE) { + rcList.add(rc); + } + } + } + + return rcList; + } + + public void setReservacionCategoriaList(List reservacionCategoriaList) { + this.reservacionCategoriaList = reservacionCategoriaList; + } + + public List getReservacionMercadoList() { + List rmList = new ArrayList(); + for (ReservacionMercado rc : this.reservacionMercadoList) { + if (rc.getActivo() == Boolean.TRUE) { + rmList.add(rc); + } + } + return rmList; + } + + public void setReservacionMercadoList(List reservacionMercadoList) { + this.reservacionMercadoList = reservacionMercadoList; + } + + public List getReservacionMarcaList() { + List rmList = new ArrayList(); + for (ReservacionMarca rm : this.reservacionMarcaList) { + if (rm.getActivo() == Boolean.TRUE) { + rmList.add(rm); + } + } + return rmList; + } + + public void setReservacionMarcaList(List reservacionMarcaList) { + this.reservacionMarcaList = reservacionMarcaList; + } + + public List getReservacionClaseList() { + List rcList = new ArrayList(); + for (ReservacionClase rc : this.reservacionClaseList) { + if (rc.getActivo() == Boolean.TRUE) { + rcList.add(rc); + } + } + return rcList; + } + + public void setReservacionClaseList(List reservacionClaseList) { + this.reservacionClaseList = reservacionClaseList; + } + + public String getDescConfig() { + return descConfig; + } + + public void setDescConfig(String descConfig) { + this.descConfig = descConfig; + } + + public List getReservacionPuntoVentaList() { + List rpvList = new ArrayList(); + for (ReservacionPuntoVenta rpv : this.reservacionPuntoVentaList) { + if (rpv.getActivo() == Boolean.TRUE) { + rpvList.add(rpv); + } + } + return rpvList; + } + + public void setReservacionPuntoVentaList(List reservacionPuntoventaList) { + this.reservacionPuntoVentaList = reservacionPuntoventaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (reservacionctrlId != null ? reservacionctrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof ReservacionCtrl)) { + return false; + } + ReservacionCtrl other = (ReservacionCtrl) object; + if ((this.reservacionctrlId == null && other.reservacionctrlId != null) || (this.reservacionctrlId != null && !this.reservacionctrlId.equals(other.reservacionctrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionCtrl[reservacionctrlId=" + reservacionctrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionMarca.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionMarca.java new file mode 100644 index 000000000..4269abbf8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionMarca.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESERVACION_MARCA_SEQ", sequenceName = "RESERVACION_MARCA_SEQ", allocationSize = 1) +@Table(name = "RESERVACION_MARCA") +public class ReservacionMarca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_MARCA_SEQ") + @Column(name = "RESERVACIONMARCA_ID") + private Integer reservacionmarcaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID") + @ManyToOne + private ReservacionCtrl reservacionCtrl; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + public ReservacionMarca() { + } + + public ReservacionMarca(Integer reservacionmarcaId) { + this.reservacionmarcaId = reservacionmarcaId; + } + + public Integer getReservacionmarcaId() { + return reservacionmarcaId; + } + + public void setReservacionmarcaId(Integer reservacionmarcaId) { + this.reservacionmarcaId = reservacionmarcaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReservacionMarca other = (ReservacionMarca) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) { + return false; + } + if (this.marca != other.marca && (this.marca == null || !this.marca.equals(other.marca))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 11 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 11 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0); + hash = 11 * hash + (this.marca != null ? this.marca.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionMarca[reservacionmarcaId=" + reservacionmarcaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionMercado.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionMercado.java new file mode 100644 index 000000000..f54caa076 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionMercado.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESERVACION_MERCADO_SEQ", sequenceName = "RESERVACION_MERCADO_SEQ", allocationSize=1) +@Table(name = "RESERVACION_MERCADO") +public class ReservacionMercado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_MERCADO_SEQ") + @Column(name = "RESERVACIONMERCADO_ID") + private Integer reservacionmercadoId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID") + @ManyToOne + private ReservacionCtrl reservacionCtrl; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada paradaOrigem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada paradaDestino; + + public ReservacionMercado() { + } + + public ReservacionMercado(Integer reservacionmercadoId) { + this.reservacionmercadoId = reservacionmercadoId; + } + + public Integer getReservacionmercadoId() { + return reservacionmercadoId; + } + + public void setReservacionmercadoId(Integer reservacionmercadoId) { + this.reservacionmercadoId = reservacionmercadoId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public Parada getParadaDestino() { + return paradaDestino; + } + + public void setParadaDestino(Parada paradaDestino) { + this.paradaDestino = paradaDestino; + } + + public Parada getParadaOrigem() { + return paradaOrigem; + } + + public void setParadaOrigem(Parada paradaOrigem) { + this.paradaOrigem = paradaOrigem; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReservacionMercado other = (ReservacionMercado) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) { + return false; + } + if (this.paradaOrigem != other.paradaOrigem && (this.paradaOrigem == null || !this.paradaOrigem.equals(other.paradaOrigem))) { + return false; + } + if (this.paradaDestino != other.paradaDestino && (this.paradaDestino == null || !this.paradaDestino.equals(other.paradaDestino))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 73 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 73 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0); + hash = 73 * hash + (this.paradaOrigem != null ? this.paradaOrigem.hashCode() : 0); + hash = 73 * hash + (this.paradaDestino != null ? this.paradaDestino.hashCode() : 0); + return hash; + } + + + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionMercado[reservacionmercadoId=" + reservacionmercadoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ReservacionPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/ReservacionPuntoVenta.java new file mode 100644 index 000000000..2afd57bcb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ReservacionPuntoVenta.java @@ -0,0 +1,142 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "RESERVACION_PUNTOVENTA_SEQ", sequenceName = "RESERVACION_PUNTOVENTA_SEQ", allocationSize=1) +@Table(name = "RESERVACION_PUNTOVENTA") +public class ReservacionPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_PUNTOVENTA_SEQ") + @Column(name = "RESERVACIONPTOVTA_ID") + private Integer reservacionptovtaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID") + @ManyToOne + private ReservacionCtrl reservacionCtrl; + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + + public ReservacionPuntoVenta() { + } + + public ReservacionPuntoVenta(Integer reservacionptovtaId) { + this.reservacionptovtaId = reservacionptovtaId; + } + + public Integer getReservacionptovtaId() { + return reservacionptovtaId; + } + + public void setReservacionptovtaId(Integer reservacionptovtaId) { + this.reservacionptovtaId = reservacionptovtaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReservacionPuntoVenta other = (ReservacionPuntoVenta) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) { + return false; + } + if (this.puntoVenta != other.puntoVenta && (this.puntoVenta == null || !this.puntoVenta.equals(other.puntoVenta))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 79 * hash + (this.activo != null ? this.activo.hashCode() : 0); + hash = 79 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0); + hash = 79 * hash + (this.puntoVenta != null ? this.puntoVenta.hashCode() : 0); + return hash; + } + + + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.ReservacionPuntoventa[reservacionptovtaId=" + reservacionptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RestriccionPago.java b/src/com/rjconsultores/ventaboletos/entidad/RestriccionPago.java new file mode 100644 index 000000000..c88eb2509 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RestriccionPago.java @@ -0,0 +1,135 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RESTRICCION_SEQ", sequenceName = "RESTRICCION_SEQ", allocationSize=1) +@Table(name = "RESTRICCION") +public class RestriccionPago implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESTRICCION_SEQ") + @Column(name = "RESTRICCION_ID") + private Short restriccionId; + @Column(name = "DESCRESTRICCION") + private String descrestriccion; + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "restriccion") + private List configRestriccionPagoList; + + public RestriccionPago() { + } + + public Short getRestriccionId() { + return restriccionId; + } + + public void setRestriccionId(Short restriccionId) { + this.restriccionId = restriccionId; + } + + public String getDescrestriccion() { + return descrestriccion; + } + + public void setDescrestriccion(String descrestriccion) { + this.descrestriccion = descrestriccion; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getConfigRestriccionPagoList() { + List tmp = new ArrayList(); + if (configRestriccionPagoList != null) { + for (ConfigRestriccionPago crp : this.configRestriccionPagoList) { + if (crp.getActivo()) { + tmp.add(crp); + } + } + } + + return tmp; + } + + public void setConfigRestriccionPagoList(List configRestriccionPagoList) { + this.configRestriccionPagoList = configRestriccionPagoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (restriccionId != null ? restriccionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RestriccionPago)) { + return false; + } + RestriccionPago other = (RestriccionPago) object; + if ((this.restriccionId == null && other.restriccionId != null) || (this.restriccionId != null && !this.restriccionId.equals(other.restriccionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDescrestriccion(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RhPagoConductor.java b/src/com/rjconsultores/ventaboletos/entidad/RhPagoConductor.java new file mode 100644 index 000000000..1e92fcb88 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RhPagoConductor.java @@ -0,0 +1,227 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@Table(name = "RH_SALIDAS") +public class RhPagoConductor implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "RHPAGOCONDUCTOR_ID") + private Integer rhpagoconductorId; +// @Column(name = "NUMPAGOCONDUCTOR") +// private Integer numpagoconductor; + @Column(name = "NUMAUTOBUS") + private Integer numautobus; + @Column(name = "NUMCORRIDA") + private Integer numcorrida; + @Column(name = "DESCRUTA") + private String descruta; + @Column(name = "FECHORSALIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorsalida; + @Column(name = "CVEOPERADOR1") + private String cveoperador1; + @Column(name = "NOMBREOPERADOR1") + private String nombreoperador1; + @Column(name = "CANTKMSOPERADOR1") + private BigDecimal cantkmsoperador1; + @Column(name = "CVEOPERADOR2") + private String cveoperador2; + @Column(name = "NOMBREOPERADOR2") + private String nombreoperador2; + @Column(name = "CANTKMSOPERADOR2") + private BigDecimal cantkmsoperador2; + @Column(name = "INDEXTRA") + private Boolean indextra; + @Column(name = "CVEORIGEN") + private String cveOrigen; + @Column(name = "CVEDESTINO") + private String cveDestino; + @Column(name = "RUTA_ID ") + private Integer ruta; + @Column(name = "MARCA_ID ") + private Short marca; + + public RhPagoConductor() { + } + + public RhPagoConductor(Integer rhpagoconductorId) { + this.rhpagoconductorId = rhpagoconductorId; + } + + public Integer getRhpagoconductorId() { + return rhpagoconductorId; + } + + public void setRhpagoconductorId(Integer rhpagoconductorId) { + this.rhpagoconductorId = rhpagoconductorId; + } + + public Integer getNumautobus() { + return numautobus; + } + + public void setNumautobus(Integer numautobus) { + this.numautobus = numautobus; + } + + public Integer getNumcorrida() { + return numcorrida; + } + + public void setNumcorrida(Integer numcorrida) { + this.numcorrida = numcorrida; + } + + public String getDescruta() { + return descruta; + } + + public void setDescruta(String descruta) { + this.descruta = descruta; + } + + public Date getFechorsalida() { + return fechorsalida; + } + + public void setFechorsalida(Date fechorsalida) { + this.fechorsalida = fechorsalida; + } + + public String getCveoperador1() { + return cveoperador1; + } + + public void setCveoperador1(String cveoperador1) { + this.cveoperador1 = cveoperador1; + } + + public String getNombreoperador1() { + return nombreoperador1; + } + + public void setNombreoperador1(String nombreoperador1) { + this.nombreoperador1 = nombreoperador1; + } + + public BigDecimal getCantkmsoperador1() { + return cantkmsoperador1; + } + + public void setCantkmsoperador1(BigDecimal cantkmsoperador1) { + this.cantkmsoperador1 = cantkmsoperador1; + } + + public String getCveoperador2() { + return cveoperador2; + } + + public void setCveoperador2(String cveoperador2) { + this.cveoperador2 = cveoperador2; + } + + public String getNombreoperador2() { + return nombreoperador2; + } + + public void setNombreoperador2(String nombreoperador2) { + this.nombreoperador2 = nombreoperador2; + } + + public BigDecimal getCantkmsoperador2() { + return cantkmsoperador2; + } + + public void setCantkmsoperador2(BigDecimal cantkmsoperador2) { + this.cantkmsoperador2 = cantkmsoperador2; + } + + public Boolean getIndextra() { + return indextra; + } + + public void setIndextra(Boolean indextra) { + this.indextra = indextra; + } + + public String getCveDestino() { + return cveDestino; + } + + public void setCveDestino(String cveDestino) { + this.cveDestino = cveDestino; + } + + public String getCveOrigen() { + return cveOrigen; + } + + public void setCveOrigen(String cveOrigen) { + this.cveOrigen = cveOrigen; + } + + public Integer getRuta() { + return ruta; + } + + public void setRuta(Integer ruta) { + this.ruta = ruta; + } + + public Short getMarca() { + return marca; + } + + public void setMarca(Short marca) { + this.marca = marca; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (rhpagoconductorId != null ? rhpagoconductorId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RhPagoConductor)) { + return false; + } + RhPagoConductor other = (RhPagoConductor) object; + if ((this.rhpagoconductorId == null && other.rhpagoconductorId != null) || (this.rhpagoconductorId != null && !this.rhpagoconductorId.equals(other.rhpagoconductorId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.RhPagoConductor[rhpagoconductorId=" + rhpagoconductorId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RolOperativo.java b/src/com/rjconsultores/ventaboletos/entidad/RolOperativo.java new file mode 100644 index 000000000..22c2b6136 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RolOperativo.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "ROL_OPERATIVO_SEQ", sequenceName = "ROL_OPERATIVO_SEQ", allocationSize=1) +@Table(name = "ROL_OPERATIVO") +public class RolOperativo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ROL_OPERATIVO_SEQ") + @Column(name = "ROLOPERATIVO_ID") + private Integer roloperativoId; + @Column(name = "DESCROLOPERATIVO") + private String descroloperativo; + @Column(name = "TIEMPOPREVIO") + @Temporal(TemporalType.TIMESTAMP) + private Date tiempoprevio; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "rolOperativo") + private List esquemaCorridaList; + @JoinColumn(name = "DIAGRAMAAUTOBUS_ID", referencedColumnName = "DIAGRAMAAUTOBUS_ID") + @ManyToOne + private DiagramaAutobus diagramaAutobus; + + public RolOperativo() { + } + + public RolOperativo(Integer roloperativoId) { + this.roloperativoId = roloperativoId; + } + + public Integer getRoloperativoId() { + return roloperativoId; + } + + public void setRoloperativoId(Integer roloperativoId) { + this.roloperativoId = roloperativoId; + } + + public String getDescroloperativo() { + return descroloperativo; + } + + public void setDescroloperativo(String descroloperativo) { + this.descroloperativo = descroloperativo; + } + + public Date getTiempoprevio() { + return tiempoprevio; + } + + public void setTiempoprevio(Date tiempoprevio) { + this.tiempoprevio = tiempoprevio; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getEsquemaCorridaList() { + return esquemaCorridaList; + } + + public void setEsquemaCorridaList(List esquemaCorridaList) { + this.esquemaCorridaList = esquemaCorridaList; + } + + public DiagramaAutobus getDiagramaAutobus() { + return diagramaAutobus; + } + + public void setDiagramaAutobus(DiagramaAutobus diagramaAutobus) { + this.diagramaAutobus = diagramaAutobus; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (roloperativoId != null ? roloperativoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RolOperativo)) { + return false; + } + RolOperativo other = (RolOperativo) object; + if ((this.roloperativoId == null && other.roloperativoId != null) || (this.roloperativoId != null && !this.roloperativoId.equals(other.roloperativoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescroloperativo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Ruta.java b/src/com/rjconsultores/ventaboletos/entidad/Ruta.java new file mode 100644 index 000000000..2668b2a8c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Ruta.java @@ -0,0 +1,211 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "RUTA_SEQ", sequenceName = "RUTA_SEQ", allocationSize = 1) +@org.hibernate.annotations.Entity(dynamicUpdate = true) +@Table(name = "RUTA") +public class Ruta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_SEQ") + @Column(name = "RUTA_ID") + private Integer rutaId; + @Column(name = "DESCRUTA") + private String descruta; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @OneToMany(mappedBy = "ruta") + private List rutaSecuenciaList; + @OneToMany(mappedBy = "ruta") + private List rutaCombinacionList; + @Column(name = "indnombreobligatorio") + private Boolean indNombreObligatorio; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + private List lsRutaEmpresa; + @Column(name = "INDVENTAOFFLINE") + private Boolean ventaOffLine; + + public Boolean getIndNombreObligatorio() { + return indNombreObligatorio; + } + + public void setIndNombreObligatorio(Boolean indNombreObligatorio) { + this.indNombreObligatorio = indNombreObligatorio; + } + + public Ruta() { + } + + public Ruta(Integer rutaId) { + this.rutaId = rutaId; + } + + public Integer getRutaId() { + return rutaId; + } + + public void setRutaId(Integer rutaId) { + this.rutaId = rutaId; + } + + public String getDescruta() { + return descruta; + } + + public void setDescruta(String descruta) { + this.descruta = descruta; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getRutaSecuenciaList() { + List rsList = new ArrayList(); + for (RutaSecuencia rs : this.rutaSecuenciaList) { + if (rs.getActivo() == Boolean.TRUE) { + rsList.add(rs); + } + } + + return rsList; + } + + public void setRutaSecuenciaList(List rutaSecuenciaList) { + this.rutaSecuenciaList = rutaSecuenciaList; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public List getRutaCombinacionList() { + + List rcList = new ArrayList(); + if (this.rutaCombinacionList == null){ + return rcList; + } + for (RutaCombinacion rc : this.rutaCombinacionList) { + if (rc.getActivo() == Boolean.TRUE) { + rcList.add(rc); + } + } + + return rcList; + } + + public void setRutaCombinacionList(List rutaCombinacionList) { + this.rutaCombinacionList = rutaCombinacionList; + } + + public List getLsRutaEmpresa() { + List rsList = new ArrayList(); + for (RutaEmpresa rs : this.lsRutaEmpresa) { + if (rs.getActivo() == Boolean.TRUE) { + rsList.add(rs); + } + } + + return rsList; + } + + public void setLsRutaEmpresa(List lsRutaEmpresa) { + this.lsRutaEmpresa = lsRutaEmpresa; + } + + public Boolean getVentaOffLine() { + return ventaOffLine; + } + + public void setVentaOffLine(Boolean ventaOffLine) { + this.ventaOffLine = ventaOffLine; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (rutaId != null ? rutaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Ruta)) { + return false; + } + Ruta other = (Ruta) object; + if ((this.rutaId == null && other.rutaId != null) || (this.rutaId != null && !this.rutaId.equals(other.rutaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDescruta() + " - " + this.getRutaId(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RutaCombinacion.java b/src/com/rjconsultores/ventaboletos/entidad/RutaCombinacion.java new file mode 100644 index 000000000..acd91176a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RutaCombinacion.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "RUTA_COMBINACION_SEQ", sequenceName = "RUTA_COMBINACION_SEQ", allocationSize=1) +@Table(name = "RUTA_COMBINACION") +public class RutaCombinacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_COMBINACION_SEQ") + @Column(name = "RUTACOMBINACION_ID") + private Integer rutacombinacionId; + @Column(name = "INDVENTA") + private Boolean indventa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + + public RutaCombinacion() { + } + + public RutaCombinacion(Integer rutacombinacionId) { + this.rutacombinacionId = rutacombinacionId; + } + + public Integer getRutacombinacionId() { + return rutacombinacionId; + } + + public void setRutacombinacionId(Integer rutacombinacionId) { + this.rutacombinacionId = rutacombinacionId; + } + + public Boolean getIndventa() { + return indventa; + } + + public void setIndventa(Boolean indventa) { + this.indventa = indventa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public void setVentaSi(boolean a) { + this.setIndventa(Boolean.TRUE); + } + + public void setVentaNo(boolean a) { + this.setIndventa(Boolean.FALSE); + } + + public boolean isVentaSi() { + if (this.getIndventa() == Boolean.FALSE) { + return false; + } + return true; + } + + public boolean isVentaNo() { + if (this.getIndventa() == Boolean.TRUE) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (rutacombinacionId != null ? rutacombinacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RutaCombinacion)) { + return false; + } + RutaCombinacion other = (RutaCombinacion) object; + if ((this.rutacombinacionId == null && other.rutacombinacionId != null) || (this.rutacombinacionId != null && !this.rutacombinacionId.equals(other.rutacombinacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.RutaCombinacion[rutacombinacionId=" + rutacombinacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RutaEmpresa.java b/src/com/rjconsultores/ventaboletos/entidad/RutaEmpresa.java new file mode 100644 index 000000000..1f38574eb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RutaEmpresa.java @@ -0,0 +1,99 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "RUTA_EMPRESA_SEQ", sequenceName = "RUTA_EMPRESA_SEQ", allocationSize = 1) +@Table(name = "RUTA_EMPRESA") +public class RutaEmpresa { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_EMPRESA_SEQ") + @Column(name = "RUTAEMPRESA_ID") + private Integer rutaEmpresaId; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + + public Integer getRutaEmpresaId() { + return rutaEmpresaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public void setRutaEmpresaId(Integer rutaEmpresaId) { + this.rutaEmpresaId = rutaEmpresaId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public String toString() { + return empresa.getNombempresa(); + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/RutaSecuencia.java b/src/com/rjconsultores/ventaboletos/entidad/RutaSecuencia.java new file mode 100644 index 000000000..a16d99069 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/RutaSecuencia.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "RUTA_SECUENCIA_SEQ", sequenceName = "RUTA_SECUENCIA_SEQ", allocationSize=1) +@Table(name = "RUTA_SECUENCIA") +public class RutaSecuencia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_SECUENCIA_SEQ") + @Column(name = "RUTASECUENCIA_ID") + private Integer rutasecuenciaId; + @Column(name = "NUMSECUENCIA") + private Short numsecuencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + + public RutaSecuencia() { + } + + public RutaSecuencia(Integer rutasecuenciaId) { + this.rutasecuenciaId = rutasecuenciaId; + } + + public Integer getRutasecuenciaId() { + return rutasecuenciaId; + } + + public void setRutasecuenciaId(Integer rutasecuenciaId) { + this.rutasecuenciaId = rutasecuenciaId; + } + + public Short getNumsecuencia() { + return numsecuencia; + } + + public void setNumsecuencia(Short numsecuencia) { + this.numsecuencia = numsecuencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (rutasecuenciaId != null ? rutasecuenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof RutaSecuencia)) { + return false; + } + RutaSecuencia other = (RutaSecuencia) object; + if ((this.rutasecuenciaId == null && other.rutasecuenciaId != null) || (this.rutasecuenciaId != null && !this.rutasecuenciaId.equals(other.rutasecuenciaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.RutaSecuencia[rutasecuenciaId=" + rutasecuenciaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Secretaria.java b/src/com/rjconsultores/ventaboletos/entidad/Secretaria.java new file mode 100644 index 000000000..94f41a7c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Secretaria.java @@ -0,0 +1,175 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "SECRETARIA") +@SequenceGenerator(name = "SECRETARIA_SEQ", sequenceName = "SECRETARIA_SEQ", allocationSize = 1) +public class Secretaria implements Serializable { + + public static final Short PRECIO_TOTAL = 1; + public static final Short PRECIO_MENOS_DESCUENTO = 2; + public static final Short DESCUENTO_COBRAR = 3; + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "SECRETARIA_SEQ") + @Column(name = "SECRETARIA_ID") + private Integer secretariaId; + @Column(name = "DESCSECRETARIA") + private String descsecretaria; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "CVESECRETARIA") + private String cvesecretaria; + @Column(name = "VALIDAFOLIO") + private Boolean validafolio; + @Column(name = "IMPRIMEPRECIO") + private Short imprimeprecio; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "SECRETARIA_ID") + private List lsCuponSecretaria; + + public Secretaria() { + } + + public Secretaria(Integer secretariaId) { + this.secretariaId = secretariaId; + } + + public Integer getSecretariaId() { + return secretariaId; + } + + public void setSecretariaId(Integer secretariaId) { + this.secretariaId = secretariaId; + } + + public String getDescsecretaria() { + return descsecretaria; + } + + public void setDescsecretaria(String descsecretaria) { + this.descsecretaria = descsecretaria; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getCvesecretaria() { + return cvesecretaria; + } + + public void setCvesecretaria(String cvesecretaria) { + this.cvesecretaria = cvesecretaria; + } + + public Boolean getValidafolio() { + return validafolio; + } + + public void setValidafolio(Boolean validafolio) { + this.validafolio = validafolio; + } + + public Short getImprimeprecio() { + return imprimeprecio; + } + + public void setImprimeprecio(Short imprimeprecio) { + this.imprimeprecio = imprimeprecio; + } + + public List getLsCuponSecretaria() { + + List tmp = new ArrayList(); + if (lsCuponSecretaria != null) { + for (CuponSecretaria cp : this.lsCuponSecretaria) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setLsCuponSecretaria(List lsCuponSecretaria) { + this.lsCuponSecretaria = lsCuponSecretaria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (secretariaId != null ? secretariaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Secretaria)) { + return false; + } + Secretaria other = (Secretaria) object; + if ((this.secretariaId == null && other.secretariaId != null) || (this.secretariaId != null && !this.secretariaId.equals(other.secretariaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Secretaria[secretariaId=" + secretariaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Sistema.java b/src/com/rjconsultores/ventaboletos/entidad/Sistema.java new file mode 100644 index 000000000..0a98752ea --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Sistema.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "SISTEMA") +@SequenceGenerator(name = "SISTEMA_SEQ", sequenceName = "SISTEMA_SEQ", allocationSize = 1) +public class Sistema implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "SISTEMA_SEQ") + @Column(name = "SISTEMA_ID") + private Integer sistemaId; + @Column(name = "NOMBSISTEMA") + private String nombsistema; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "sistema") + private List funcionSistemaList; + + public Sistema() { + } + + public Sistema(Integer sistemaId) { + this.sistemaId = sistemaId; + } + + public Integer getSistemaId() { + return sistemaId; + } + + public void setSistemaId(Integer sistemaId) { + this.sistemaId = sistemaId; + } + + public String getNombsistema() { + return nombsistema; + } + + public void setNombsistema(String nombsistema) { + this.nombsistema = nombsistema; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getFuncionSistemaList() { + return funcionSistemaList; + } + + public void setFuncionSistemaList(List funcionSistemaList) { + this.funcionSistemaList = funcionSistemaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (sistemaId != null ? sistemaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Sistema)) { + return false; + } + Sistema other = (Sistema) object; + if ((this.sistemaId == null && other.sistemaId != null) || (this.sistemaId != null && !this.sistemaId.equals(other.sistemaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNombsistema(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Tarifa.java b/src/com/rjconsultores/ventaboletos/entidad/Tarifa.java new file mode 100644 index 000000000..2c1f85a89 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Tarifa.java @@ -0,0 +1,252 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "TARIFA_SEQ", sequenceName = "TARIFA_SEQ", allocationSize = 1) +@Table(name = "TARIFA") +public class Tarifa implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_SEQ") + @Column(name = "TARIFA_ID") + private Integer tarifaId; + @Column(name = "PRECIO") + private BigDecimal precio; + @Column(name = "PRECIOORIGINAL") + private BigDecimal preciooriginal; + @Column(name = "STATUSTARIFA") + private String statustarifa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "TRAMO_ID") + private Tramo tramo; + @OneToOne + @JoinColumn(name = "MARCA_ID") + private Marca marca; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + @OneToOne + @JoinColumn(name = "MONEDA_ID") + private Moneda moneda; + @OneToOne + @JoinColumn(name = "VIGENCIATARIFA_ID") + private VigenciaTarifa vigenciaTarifa; + @Column(name = "PRECIOREDABIERTO") + private BigDecimal precioredabierto; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TARIFA_ID", referencedColumnName = "TARIFA_ID") + private List lsTarifaTipoptovta; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TARIFA_ID", referencedColumnName = "TARIFA_ID") + private List lsTarifaCategoria; + + public Tarifa() { + } + + public Tarifa(Integer tarifaId) { + this.tarifaId = tarifaId; + } + + public Integer getTarifaId() { + return tarifaId; + } + + public void setTarifaId(Integer tarifaId) { + this.tarifaId = tarifaId; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + public BigDecimal getPreciooriginal() { + return preciooriginal; + } + + public void setPreciooriginal(BigDecimal preciooriginal) { + this.preciooriginal = preciooriginal; + } + + public String getStatustarifa() { + return statustarifa; + } + + public void setStatustarifa(String statustarifa) { + this.statustarifa = statustarifa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public VigenciaTarifa getVigenciaTarifa() { + return vigenciaTarifa; + } + + public void setVigenciaTarifa(VigenciaTarifa vigenciaTarifa) { + this.vigenciaTarifa = vigenciaTarifa; + } + + public BigDecimal getPrecioredabierto() { + return precioredabierto; + } + + public void setPrecioredabierto(BigDecimal precioredabierto) { + this.precioredabierto = precioredabierto; + } + + public List getLsTarifaCategoria() { + List tmp = new ArrayList(); + if (lsTarifaCategoria != null) { + for (TarifaCategoria ddab : this.lsTarifaCategoria) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsTarifaCategoria = tmp; + + return tmp; + } + + public void setLsTarifaCategoria(List lsTarifaCategoria) { + this.lsTarifaCategoria = lsTarifaCategoria; + } + + public List getLsTarifaTipoptovta() { + List tmp = new ArrayList(); + if (lsTarifaTipoptovta != null) { + for (TarifaTipoptovta ddab : this.lsTarifaTipoptovta) { + if (ddab.getActivo()) { + tmp.add(ddab); + } + } + } + + this.lsTarifaTipoptovta = tmp; + + return tmp; + } + + public void setLsTarifaTipoptovta(List lsTarifaTipoptovta) { + this.lsTarifaTipoptovta = lsTarifaTipoptovta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarifaId != null ? tarifaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Tarifa)) { + return false; + } + Tarifa other = (Tarifa) object; + if ((this.tarifaId == null && other.tarifaId != null) || (this.tarifaId != null && !this.tarifaId.equals(other.tarifaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Tarifa[tarifaId=" + tarifaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarifaCategoria.java b/src/com/rjconsultores/ventaboletos/entidad/TarifaCategoria.java new file mode 100644 index 000000000..435eae8b7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarifaCategoria.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "TARIFA_CATEGORIA") +@SequenceGenerator(name = "TARIFA_CATEGORIA_SEQ", sequenceName = "TARIFA_CATEGORIA_SEQ", allocationSize = 1) +public class TarifaCategoria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_CATEGORIA_SEQ") + @Column(name = "TARIFACATEGORIA_ID") + private Integer tarifacategoriaId; + @Column(name = "PRECIO") + private BigDecimal precio; + @Column(name = "PRECIOREDABIERTO") + private BigDecimal precioredabierto; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "CATEGORIA_ID") + private Categoria categoria; + + public TarifaCategoria() { + } + + public TarifaCategoria(Integer tarifacategoriaId) { + this.tarifacategoriaId = tarifacategoriaId; + } + + public Integer getTarifacategoriaId() { + return tarifacategoriaId; + } + + public void setTarifacategoriaId(Integer tarifacategoriaId) { + this.tarifacategoriaId = tarifacategoriaId; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + public BigDecimal getPrecioredabierto() { + return precioredabierto; + } + + public void setPrecioredabierto(BigDecimal precioredabierto) { + this.precioredabierto = precioredabierto; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarifacategoriaId != null ? tarifacategoriaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarifaCategoria)) { + return false; + } + TarifaCategoria other = (TarifaCategoria) object; + if ((this.tarifacategoriaId == null && other.tarifacategoriaId != null) || (this.tarifacategoriaId != null && !this.tarifacategoriaId.equals(other.tarifacategoriaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarifaCategoria[tarifacategoriaId=" + tarifacategoriaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarifaHist.java b/src/com/rjconsultores/ventaboletos/entidad/TarifaHist.java new file mode 100644 index 000000000..237d5c101 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarifaHist.java @@ -0,0 +1,183 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "TARIFA_HIST_SEQ", sequenceName = "TARIFA_HIST_SEQ", allocationSize=1) +@Table(name = "TARIFA_HIST") +public class TarifaHist implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_HIST_SEQ") + @Column(name = "TARIFAHIST_ID") + private Long tarifahistId; + @Column(name = "PRECIO") + private BigDecimal precio; + @Column(name = "PRECIOORIGINAL") + private BigDecimal preciooriginal; + @Column(name = "STATUSTARIFA") + private String statustarifa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "VIGENCIATARIFA_ID", referencedColumnName = "VIGENCIATARIFA_ID") + @ManyToOne + private VigenciaTarifa vigenciaTarifa; + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public TarifaHist() { + } + + public TarifaHist(Long tarifahistId) { + this.tarifahistId = tarifahistId; + } + + public Long getTarifahistId() { + return tarifahistId; + } + + public void setTarifahistId(Long tarifahistId) { + this.tarifahistId = tarifahistId; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + public BigDecimal getPreciooriginal() { + return preciooriginal; + } + + public void setPreciooriginal(BigDecimal preciooriginal) { + this.preciooriginal = preciooriginal; + } + + public String getStatustarifa() { + return statustarifa; + } + + public void setStatustarifa(String statustarifa) { + this.statustarifa = statustarifa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public VigenciaTarifa getVigenciaTarifa() { + return vigenciaTarifa; + } + + public void setVigenciaTarifa(VigenciaTarifa vigenciaTarifa) { + this.vigenciaTarifa = vigenciaTarifa; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarifahistId != null ? tarifahistId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarifaHist)) { + return false; + } + TarifaHist other = (TarifaHist) object; + if ((this.tarifahistId == null && other.tarifahistId != null) || (this.tarifahistId != null && !this.tarifahistId.equals(other.tarifahistId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarifaHist[tarifahistId=" + tarifahistId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarifaMinima.java b/src/com/rjconsultores/ventaboletos/entidad/TarifaMinima.java new file mode 100644 index 000000000..faf2e4e1f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarifaMinima.java @@ -0,0 +1,185 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "TARIFA_MINIMA_SEQ", sequenceName = "TARIFA_MINIMA_SEQ", allocationSize = 1) +@Table(name = "TARIFA_MINIMA") +public class TarifaMinima implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_MINIMA_SEQ") + @Column(name = "TARIFAMINIMA_ID") + private Integer tarifaminimaId; + @Column(name = "IMPORTETARIFA") + private BigDecimal importetarifa; + @OneToOne + @JoinColumn(name = "PLAZA_ID") + private Plaza plaza; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + @OneToOne + @JoinColumn(name = "MARCA_ID") + private Marca marca; + @OneToOne + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + private Parada origem; + @OneToOne + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + private Parada destino; + @OneToOne + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + private Moneda moneda; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TarifaMinima() { + } + + public TarifaMinima(Integer tarifaminimaId) { + this.tarifaminimaId = tarifaminimaId; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public Integer getTarifaminimaId() { + return tarifaminimaId; + } + + public void setTarifaminimaId(Integer tarifaminimaId) { + this.tarifaminimaId = tarifaminimaId; + } + + public BigDecimal getImportetarifa() { + return importetarifa; + } + + public void setImportetarifa(BigDecimal importetarifa) { + this.importetarifa = importetarifa; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Plaza getPlaza() { + return plaza; + } + + public void setPlaza(Plaza plaza) { + this.plaza = plaza; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarifaminimaId != null ? tarifaminimaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarifaMinima)) { + return false; + } + TarifaMinima other = (TarifaMinima) object; + if ((this.tarifaminimaId == null && other.tarifaminimaId != null) || (this.tarifaminimaId != null && !this.tarifaminimaId.equals(other.tarifaminimaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarifaMinima[tarifaminimaId=" + tarifaminimaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarifaTipoptovta.java b/src/com/rjconsultores/ventaboletos/entidad/TarifaTipoptovta.java new file mode 100644 index 000000000..deee826d1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarifaTipoptovta.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "TARIFA_TIPOPTOVTA") +@SequenceGenerator(name = "TARIFA_TIPOPTOVTA_SEQ", sequenceName = "TARIFA_TIPOPTOVTA_SEQ", allocationSize = 1) +public class TarifaTipoptovta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_TIPOPTOVTA_SEQ") + @Column(name = "TARIFATIPOPTOVTA_ID") + private Integer tarifatipoptovtaId; + @Column(name = "PRECIO") + private BigDecimal precio; + @Column(name = "PRECIOREDABIERTO") + private BigDecimal precioredabierto; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToOne + @JoinColumn(name = "TIPOPTOVTA_ID") + private TipoPuntoVenta tipoPuntoVenta; + + public TarifaTipoptovta() { + } + + public TarifaTipoptovta(Integer tarifatipoptovtaId) { + this.tarifatipoptovtaId = tarifatipoptovtaId; + } + + public Integer getTarifatipoptovtaId() { + return tarifatipoptovtaId; + } + + public void setTarifatipoptovtaId(Integer tarifatipoptovtaId) { + this.tarifatipoptovtaId = tarifatipoptovtaId; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + public BigDecimal getPrecioredabierto() { + return precioredabierto; + } + + public void setPrecioredabierto(BigDecimal precioredabierto) { + this.precioredabierto = precioredabierto; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public TipoPuntoVenta getTipoPuntoVenta() { + return tipoPuntoVenta; + } + + public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + this.tipoPuntoVenta = tipoPuntoVenta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarifatipoptovtaId != null ? tarifatipoptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarifaTipoptovta)) { + return false; + } + TarifaTipoptovta other = (TarifaTipoptovta) object; + if ((this.tarifatipoptovtaId == null && other.tarifatipoptovtaId != null) || (this.tarifatipoptovtaId != null && !this.tarifatipoptovtaId.equals(other.tarifatipoptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta[tarifatipoptovtaId=" + tarifatipoptovtaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidad.java b/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidad.java new file mode 100644 index 000000000..0d5c173ee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidad.java @@ -0,0 +1,120 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "TARJETA_FIDELIDAD_SEQ", sequenceName = "TARJETA_FIDELIDAD_SEQ", allocationSize = 1) +@Table(name = "TARJETA_FIDELIDAD") +public class TarjetaFidelidad implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARJETA_FIDELIDAD_SEQ") + @Column(name = "TARJETAFIDELIDAD_ID") + private Integer tarjetaFidelidadId; + @Column(name = "NUMTARJETA") + private String numTarjeta; + @Column(name = "DESCGENERACION") + private String descGeneracion; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public String getDescGeneracion() { + return descGeneracion; + } + + public void setDescGeneracion(String descGeneracion) { + this.descGeneracion = descGeneracion; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public String getNumTarjeta() { + return numTarjeta; + } + + public void setNumTarjeta(String numTarjeta) { + this.numTarjeta = numTarjeta; + } + + public Integer getTarjetaFidelidadId() { + return tarjetaFidelidadId; + } + + public void setTarjetaFidelidadId(Integer tarjetaFidelidadId) { + this.tarjetaFidelidadId = tarjetaFidelidadId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarjetaFidelidadId != null ? tarjetaFidelidadId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarjetaFidelidad)) { + return false; + } + TarjetaFidelidad other = (TarjetaFidelidad) object; + if ((this.tarjetaFidelidadId == null && other.tarjetaFidelidadId != null) || (this.tarjetaFidelidadId != null && !this.tarjetaFidelidadId.equals(other.tarjetaFidelidadId))) { + return false; + } + return true; + } + + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad[tarjetaFidelidadId=" + tarjetaFidelidadId + "]"; + return this.getDescGeneracion(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidadCuenta.java b/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidadCuenta.java new file mode 100644 index 000000000..bcf410bc2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarjetaFidelidadCuenta.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +/** + * + * @author Shiro + */ +public class TarjetaFidelidadCuenta { + + private String descGeneracion; + private Integer cantidad; + + public TarjetaFidelidadCuenta(){ + } + public Integer getCantidad() { + return cantidad; + } + + public void setCantidad(Integer cantidad) { + this.cantidad = cantidad; + } + + public String getDescGeneracion() { + return descGeneracion; + } + + public void setDescGeneracion(String descGeneracion) { + this.descGeneracion = descGeneracion; + } + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad[tarjetaFidelidadId=" + tarjetaFidelidadId + "]"; + return this.getDescGeneracion(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacion.java b/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacion.java new file mode 100644 index 000000000..0b7033c07 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacion.java @@ -0,0 +1,222 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "TARJETAS_RECAUDACION") +public class TarjetaRecaudacion implements Serializable { + + private static final long serialVersionUID = 1L; + @EmbeddedId + protected TarjetaRecaudacionPK tarjetasRecaudacionPK; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @Column(name = "INGRESO_CORRIDA") + private Double ingresoCorrida; + @Column(name = "PAGADO") + private Boolean pagado; + @OneToOne + @JoinColumn(name = "RUTA_ID") + private Ruta ruta; + @OneToOne + @JoinColumn(name = "AUTOBUS_ID") + private Autobus autobus; + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + @OneToOne + @JoinColumn(name = "MARCA_ID") + private Marca marca; + @Column(name = "ACTUALIZAR") + private Boolean actualizar; + @Column(name = "OBSERVACIONES") + private String observaciones; + @Column(name = "CONDUCTOR_ID") + private Integer conductorId; + @OneToOne + @JoinColumn(name = "ORIGEN_ID") + private Parada origen; + @OneToOne + @JoinColumn(name = "DESTINO_ID") + private Parada destino; + @Column(name = "ACTIVO") + private Boolean activo; + @OneToOne + @JoinColumns({ + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID"), + @JoinColumn(name = "FECCORRIDA", referencedColumnName = "FECCORRIDA") + }) + private Corrida corrida; + + public TarjetaRecaudacion() { + } + + public TarjetaRecaudacion(TarjetaRecaudacionPK tarjetasRecaudacionPK) { + this.tarjetasRecaudacionPK = tarjetasRecaudacionPK; + } + + public TarjetaRecaudacion(Integer tarjetarecaudacionId, Boolean manual) { + this.tarjetasRecaudacionPK = new TarjetaRecaudacionPK(tarjetarecaudacionId, manual); + } + + public TarjetaRecaudacionPK getTarjetasRecaudacionPK() { + return tarjetasRecaudacionPK; + } + + public void setTarjetasRecaudacionPK(TarjetaRecaudacionPK tarjetasRecaudacionPK) { + this.tarjetasRecaudacionPK = tarjetasRecaudacionPK; + } + + public Double getIngresoCorrida() { + return ingresoCorrida; + } + + public void setIngresoCorrida(Double ingresoCorrida) { + this.ingresoCorrida = ingresoCorrida; + } + + public Boolean getPagado() { + return pagado; + } + + public void setPagado(Boolean pagado) { + this.pagado = pagado; + } + + public Boolean getActualizar() { + return actualizar; + } + + public void setActualizar(Boolean actualizar) { + this.actualizar = actualizar; + } + + public String getObservaciones() { + return observaciones; + } + + public void setObservaciones(String observaciones) { + this.observaciones = observaciones; + } + + public Integer getConductorId() { + return conductorId; + } + + public void setConductorId(Integer conductorId) { + this.conductorId = conductorId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Autobus getAutobus() { + return autobus; + } + + public void setAutobus(Autobus autobus) { + this.autobus = autobus; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Corrida getCorrida() { + return corrida; + } + + public void setCorrida(Corrida corrida) { + this.corrida = corrida; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public Parada getOrigen() { + return origen; + } + + public void setOrigen(Parada origen) { + this.origen = origen; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarjetasRecaudacionPK != null ? tarjetasRecaudacionPK.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarjetaRecaudacion)) { + return false; + } + TarjetaRecaudacion other = (TarjetaRecaudacion) object; + if ((this.tarjetasRecaudacionPK == null && other.tarjetasRecaudacionPK != null) || (this.tarjetasRecaudacionPK != null && !this.tarjetasRecaudacionPK.equals(other.tarjetasRecaudacionPK))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarjetasRecaudacion[ tarjetasRecaudacionPK=" + tarjetasRecaudacionPK + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacionPK.java b/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacionPK.java new file mode 100644 index 000000000..dbb2c73d3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarjetaRecaudacionPK.java @@ -0,0 +1,78 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +/** + * + * @author Administrador + */ +@Embeddable +public class TarjetaRecaudacionPK implements Serializable { + + @Basic(optional = false) + @Column(name = "TARJETARECAUDACION_ID") + private Integer tarjetarecaudacionId; + @Basic(optional = false) + @Column(name = "MANUAL") + private Boolean manual; + + public TarjetaRecaudacionPK() { + } + + public TarjetaRecaudacionPK(Integer tarjetarecaudacionId, Boolean manual) { + this.tarjetarecaudacionId = tarjetarecaudacionId; + this.manual = manual; + } + + public Integer getTarjetarecaudacionId() { + return tarjetarecaudacionId; + } + + public void setTarjetarecaudacionId(Integer tarjetarecaudacionId) { + this.tarjetarecaudacionId = tarjetarecaudacionId; + } + + public Boolean getManual() { + return manual; + } + + public void setManual(Boolean manual) { + this.manual = manual; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarjetarecaudacionId != null ? tarjetarecaudacionId.hashCode() : 0); + hash += (manual != null ? manual.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarjetaRecaudacionPK)) { + return false; + } + TarjetaRecaudacionPK other = (TarjetaRecaudacionPK) object; + if ((this.tarjetarecaudacionId == null && other.tarjetarecaudacionId != null) || (this.tarjetarecaudacionId != null && !this.tarjetarecaudacionId.equals(other.tarjetarecaudacionId))) { + return false; + } + if ((this.manual == null && other.manual != null) || (this.manual != null && !this.manual.equals(other.manual))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TarjetasRecaudacionPK[ tarjetarecaudacionId=" + tarjetarecaudacionId + ", manual=" + manual + " ]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TarjetaViaje.java b/src/com/rjconsultores/ventaboletos/entidad/TarjetaViaje.java new file mode 100644 index 000000000..7c7c99c98 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarjetaViaje.java @@ -0,0 +1,324 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author cassio + */ +@Entity +@Table(name = "TARJETA_VIAJE") +@NamedQueries({ + @NamedQuery(name = "TarjetaViaje.findAll", query = "SELECT t FROM TarjetaViaje t")}) +public class TarjetaViaje implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "TARJETAVIAJE_ID", nullable = false) + private Integer tarjetaviajeId; + @Column(name = "NUMSECUENCIA") + private Integer numsecuencia; + @Column(name = "INDREBOTE") + private Integer indRebote; + @Column(name = "INDSTATUSTARJETA", length = 20) + private String indstatustarjeta; + @Column(name = "FOLIOTARJETAVIAJE", length = 10) + private String foliotarjetaviaje; + @Column(name = "FECENVIONOMINA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecenvionomina; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @JoinColumn(name = "CONDUCTOR1_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor; + @JoinColumn(name = "CONDUCTOR2_ID", referencedColumnName = "CONDUCTOR_ID") + @ManyToOne + private Conductor conductor1; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "AUTOBUS_ID", referencedColumnName = "AUTOBUS_ID") + @ManyToOne + private Autobus autobus; + private transient boolean eCorridaDuplicada; + @Column(name = "CANTKMREAL") + private BigDecimal kmReal; + @Column(name = "CANTKMPAGOCONDUCTOR") + private BigDecimal kmPagoConductor; + @Column(name = "TARJETAVIAJEREF_ID") + private BigDecimal tarjetaViajeRef; + @Column(name = "DESCPARADAORIGEN") + private String origen; + @Column(name = "DESCPARADADESTINO") + private String destino; + @Column(name = "FECCORRIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecInicial; + @Column(name = "FECHORSALIDA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecHorSalida; + @Column(name = "NUMCORRIDA") + private Integer numCorrida; + + public Integer getNumAutobusAux() { + return Integer.parseInt(this.autobus.getNumautobus()); + } + + public Integer getNumCorrida() { + return numCorrida; + } + + public void setNumCorrida(Integer numCorrida) { + this.numCorrida = numCorrida; + } + + public Integer getIndRebote() { + return indRebote; + } + + public void setIndRebote(Integer indRebote) { + this.indRebote = indRebote; + } + + public String getOrigen() { + return origen; + } + + public void setOrigen(String origen) { + this.origen = origen; + } + + public String getDestino() { + return destino; + } + + public void setDestino(String destino) { + this.destino = destino; + } + + public Date getFecInicial() { + return fecInicial; + } + + public void setFecInicial(Date fecInicial) { + this.fecInicial = fecInicial; + } + + public BigDecimal getTarjetaViajeRef() { + return tarjetaViajeRef; + } + + public void setTarjetaViajeRef(BigDecimal tarjetaViajeRef) { + this.tarjetaViajeRef = tarjetaViajeRef; + } + + public BigDecimal getKmReal() { + return kmReal; + } + + public void setKmReal(BigDecimal kmReal) { + this.kmReal = kmReal; + } + + public BigDecimal getKmPagoConductor() { + return kmPagoConductor; + } + + public void setKmPagoConductor(BigDecimal kmPagoConductor) { + this.kmPagoConductor = kmPagoConductor; + } + + public boolean geteCorridaDuplicada() { + return eCorridaDuplicada; + } + + public void seteCorridaDuplicada(boolean eCorridaDuplicada) { + this.eCorridaDuplicada = eCorridaDuplicada; + } + + public TarjetaViaje() { + } + + public TarjetaViaje(Integer tarjetaviajeId) { + this.tarjetaviajeId = tarjetaviajeId; + } + + public Integer getTarjetaviajeId() { + return tarjetaviajeId; + } + + public void setTarjetaviajeId(Integer tarjetaviajeId) { + this.tarjetaviajeId = tarjetaviajeId; + } + + public Integer getNumsecuencia() { + return numsecuencia; + } + + public void setNumsecuencia(Integer numsecuencia) { + this.numsecuencia = numsecuencia; + } + + public String getIndstatustarjeta() { + return indstatustarjeta; + } + + public void setIndstatustarjeta(String indstatustarjeta) { + this.indstatustarjeta = indstatustarjeta; + } + + public String getFoliotarjetaviaje() { + return foliotarjetaviaje; + } + + public void setFoliotarjetaviaje(String foliotarjetaviaje) { + this.foliotarjetaviaje = foliotarjetaviaje; + } + + public Date getFecenvionomina() { + return fecenvionomina; + } + + public void setFecenvionomina(Date fecenvionomina) { + this.fecenvionomina = fecenvionomina; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Conductor getConductor() { + return conductor; + } + + public void setConductor(Conductor conductor) { + this.conductor = conductor; + } + + public Conductor getConductor1() { + return conductor1; + } + + public void setConductor1(Conductor conductor1) { + this.conductor1 = conductor1; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Autobus getAutobus() { + return autobus; + } + + public void setAutobus(Autobus autobus) { + this.autobus = autobus; + } + + public Date getFecHorSalida() { + return fecHorSalida; + } + + public void setFecHorSalida(Date fecHorSalida) { + this.fecHorSalida = fecHorSalida; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tarjetaviajeId != null ? tarjetaviajeId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TarjetaViaje)) { + return false; + } + TarjetaViaje other = (TarjetaViaje) object; + if ((this.tarjetaviajeId == null && other.tarjetaviajeId != null) || (this.tarjetaviajeId != null && !this.tarjetaviajeId.equals(other.tarjetaviajeId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidadeteste.TarjetaViaje[tarjetaviajeId=" + tarjetaviajeId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCiudad.java b/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCiudad.java new file mode 100644 index 000000000..382e47655 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCiudad.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "TIPO_CAMBIO_CIUDAD") +@SequenceGenerator(name = "TIPO_CAMBIO_CIUDAD_SEQ", sequenceName = "TIPO_CAMBIO_CIUDAD_SEQ", allocationSize = 1) +public class TipoCambioCiudad implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CAMBIO_CIUDAD_SEQ") + @Column(name = "TIPOCAMBIOCIUDAD_ID") + private Integer tipocambiociudadId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "CIUDAD_ID", referencedColumnName = "CIUDAD_ID") + @ManyToOne + private Ciudad ciudad; + @JoinColumn(name = "TIPOCAMBIOCTRL_ID", referencedColumnName = "TIPOCAMBIOCTRL_ID") + @ManyToOne + private TipoCambioCtrl tipoCambioCtrl; + + public TipoCambioCiudad() { + } + + public TipoCambioCiudad(Integer tipocambiociudadId) { + this.tipocambiociudadId = tipocambiociudadId; + } + + public Integer getTipocambiociudadId() { + return tipocambiociudadId; + } + + public void setTipocambiociudadId(Integer tipocambiociudadId) { + this.tipocambiociudadId = tipocambiociudadId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Ciudad getCiudad() { + return ciudad; + } + + public void setCiudad(Ciudad ciudad) { + this.ciudad = ciudad; + } + + public TipoCambioCtrl getTipoCambioCtrl() { + return tipoCambioCtrl; + } + + public void setTipoCambioCtrl(TipoCambioCtrl tipoCambioCtrl) { + this.tipoCambioCtrl = tipoCambioCtrl; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipocambiociudadId != null ? tipocambiociudadId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoCambioCiudad)) { + return false; + } + TipoCambioCiudad other = (TipoCambioCiudad) object; + if ((this.tipocambiociudadId == null && other.tipocambiociudadId != null) || (this.tipocambiociudadId != null && !this.tipocambiociudadId.equals(other.tipocambiociudadId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.dao.TipoCambioCiudad[tipocambiociudadId=" + tipocambiociudadId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCtrl.java new file mode 100644 index 000000000..0b5e1daf0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoCambioCtrl.java @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "TIPO_CAMBIO_CTRL") +@SequenceGenerator(name = "TIPO_CAMBIO_CTRL_SEQ", sequenceName = "TIPO_CAMBIO_CTRL_SEQ", allocationSize = 1) +public class TipoCambioCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CAMBIO_CTRL_SEQ") + @Column(name = "TIPOCAMBIOCTRL_ID") + private Integer tipocambioctrlId; + @Column(name = "IMPORTECAMBIO") + private BigDecimal importecambio; + @Column(name = "FECAPLICACION") + @Temporal(TemporalType.TIMESTAMP) + private Date fecaplicacion; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TIPOCAMBIOCTRL_ID", referencedColumnName = "TIPOCAMBIOCTRL_ID") + private List tipoCambioCiudadList; + @JoinColumn(name = "MONEDADESTINO_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda monedaDestino; + @JoinColumn(name = "MONEDAORIGEN_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda monedaOrigen; + + public TipoCambioCtrl() { + } + + public TipoCambioCtrl(Integer tipocambioctrlId) { + this.tipocambioctrlId = tipocambioctrlId; + } + + public Integer getTipocambioctrlId() { + return tipocambioctrlId; + } + + public void setTipocambioctrlId(Integer tipocambioctrlId) { + this.tipocambioctrlId = tipocambioctrlId; + } + + public BigDecimal getImportecambio() { + return importecambio; + } + + public void setImportecambio(BigDecimal importecambio) { + this.importecambio = importecambio; + } + + public Date getFecaplicacion() { + return fecaplicacion; + } + + public void setFecaplicacion(Date fecaplicacion) { + this.fecaplicacion = fecaplicacion; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getTipoCambioCiudadList() { + List pcList = new ArrayList(); + for (TipoCambioCiudad pc : this.tipoCambioCiudadList) { + if (pc.getActivo() == Boolean.TRUE) { + pcList.add(pc); + } + } + return pcList; + } + + public void setTipoCambioCiudadList(List tipoCambioCiudadList) { + this.tipoCambioCiudadList = tipoCambioCiudadList; + } + + public Moneda getMonedaDestino() { + return monedaDestino; + } + + public void setMonedaDestino(Moneda monedaDestino) { + this.monedaDestino = monedaDestino; + } + + public Moneda getMonedaOrigen() { + return monedaOrigen; + } + + public void setMonedaOrigen(Moneda monedaOrigen) { + this.monedaOrigen = monedaOrigen; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipocambioctrlId != null ? tipocambioctrlId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoCambioCtrl)) { + return false; + } + TipoCambioCtrl other = (TipoCambioCtrl) object; + if ((this.tipocambioctrlId == null && other.tipocambioctrlId != null) || (this.tipocambioctrlId != null && !this.tipocambioctrlId.equals(other.tipocambioctrlId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.dao.TipoCambioCtrl[tipocambioctrlId=" + tipocambioctrlId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoConvenio.java b/src/com/rjconsultores/ventaboletos/entidad/TipoConvenio.java new file mode 100644 index 000000000..17bb84c78 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoConvenio.java @@ -0,0 +1,122 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "TIPO_CONVENIO_SEQ", sequenceName = "TIPO_CONVENIO_SEQ", allocationSize = 1) +@Table(name = "TIPO_CONVENIO") +public class TipoConvenio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CONVENIO_SEQ") + @Column(name = "TIPOCONVENIO_ID") + private Integer tipoConvenioID; + @Column(name = "DESCTIPO") + private String descTipo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "tipoConvenio") + private List cuponConvenioList; + + public List getCuponConvenioList() { + return cuponConvenioList; + } + + public void setCuponConvenioList(List cuponConvenioList) { + this.cuponConvenioList = cuponConvenioList; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public String getDescTipo() { + return descTipo; + } + + public void setDescTipo(String descTipo) { + this.descTipo = descTipo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getTipoConvenioID() { + return tipoConvenioID; + } + + public void setTipoConvenioID(Integer tipoConvenioID) { + this.tipoConvenioID = tipoConvenioID; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoConvenioID != null ? tipoConvenioID.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoConvenio)) { + return false; + } + TipoConvenio other = (TipoConvenio) object; + if ((this.tipoConvenioID == null && other.tipoConvenioID != null) || (this.tipoConvenioID != null && !this.tipoConvenioID.equals(other.tipoConvenioID))) { + return false; + } + return true; + } + + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.Cortesia[cortesiaId=" + productoServicioID + "]"; + return this.getDescTipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoCorte.java b/src/com/rjconsultores/ventaboletos/entidad/TipoCorte.java new file mode 100644 index 000000000..6ab2e5ad2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoCorte.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_CORTE_SEQ", sequenceName = "TIPO_CORTE_SEQ", allocationSize = 1) +@Table(name = "TIPO_CORTE") +public class TipoCorte implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CORTE_SEQ") + @Column(name = "TIPOCORTE_ID") + private Short tipocorteId; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "ACTIVO") + private Boolean activo; + + public TipoCorte() { + } + + public TipoCorte(Short tipocorteId) { + this.tipocorteId = tipocorteId; + } + + public Short getTipocorteId() { + return tipocorteId; + } + + public void setTipocorteId(Short tipocorteId) { + this.tipocorteId = tipocorteId; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipocorteId != null ? tipocorteId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoCorte)) { + return false; + } + TipoCorte other = (TipoCorte) object; + if ((this.tipocorteId == null && other.tipocorteId != null) || (this.tipocorteId != null && !this.tipocorteId.equals(other.tipocorteId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoCorte[tipocorteId=" + tipocorteId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoCortesia.java b/src/com/rjconsultores/ventaboletos/entidad/TipoCortesia.java new file mode 100644 index 000000000..a33cb8d57 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoCortesia.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TIPO_CORTESIA_SEQ", sequenceName = "TIPO_CORTESIA_SEQ", allocationSize = 1) +@Table(name = "TIPO_CORTESIA") +public class TipoCortesia implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CORTESIA_SEQ") + @Column(name = "TIPOCORTESIA_ID") + private Short tipocortesiaId; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "tipoCortesia") + private List tipoCortesiaDescuentoList; + @JoinColumn(name = "GRUPOCORTESIA_ID", referencedColumnName = "GRUPOCORTESIA_ID") + @ManyToOne + private GrupoCortesia grupoCortesia; + + public TipoCortesia() { + } + + public TipoCortesia(Short tipocortesiaId) { + this.tipocortesiaId = tipocortesiaId; + } + + public Short getTipocortesiaId() { + return tipocortesiaId; + } + + public void setTipocortesiaId(Short tipocortesiaId) { + this.tipocortesiaId = tipocortesiaId; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getTipoCortesiaDescuentoList() { + return tipoCortesiaDescuentoList; + } + + public void setTipoCortesiaDescuentoList(List tipoCortesiaDescuentoList) { + this.tipoCortesiaDescuentoList = tipoCortesiaDescuentoList; + } + + public GrupoCortesia getGrupoCortesia() { + return grupoCortesia; + } + + public void setGrupoCortesia(GrupoCortesia grupoCortesia) { + this.grupoCortesia = grupoCortesia; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipocortesiaId != null ? tipocortesiaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoCortesia)) { + return false; + } + TipoCortesia other = (TipoCortesia) object; + if ((this.tipocortesiaId == null && other.tipocortesiaId != null) || (this.tipocortesiaId != null && !this.tipocortesiaId.equals(other.tipocortesiaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDesctipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoCortesiaDescuento.java b/src/com/rjconsultores/ventaboletos/entidad/TipoCortesiaDescuento.java new file mode 100644 index 000000000..246bcfd7c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoCortesiaDescuento.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TIPOCORTESIA_DESCUENTO_SEQ", sequenceName = "TIPOCORTESIA_DESCUENTO_SEQ", allocationSize = 1) +@Table(name = "TIPOCORTESIA_DESCUENTO") +public class TipoCortesiaDescuento implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPOCORTESIA_DESCUENTO_SEQ") + @Column(name = "TIPOCORTESIADESCUENTO_ID") + private Integer tipocortesiadescuentoId; + @Column(name = "PORCDESCUENTO") + private BigDecimal porcdescuento; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TIPOCORTESIA_ID", referencedColumnName = "TIPOCORTESIA_ID") + @ManyToOne + private TipoCortesia tipoCortesia; + + public TipoCortesiaDescuento() { + } + + public TipoCortesiaDescuento(Integer tipocortesiadescuentoId) { + this.tipocortesiadescuentoId = tipocortesiadescuentoId; + } + + public Integer getTipocortesiadescuentoId() { + return tipocortesiadescuentoId; + } + + public void setTipocortesiadescuentoId(Integer tipocortesiadescuentoId) { + this.tipocortesiadescuentoId = tipocortesiadescuentoId; + } + + public BigDecimal getPorcdescuento() { + return porcdescuento; + } + + public void setPorcdescuento(BigDecimal porcdescuento) { + this.porcdescuento = porcdescuento; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public TipoCortesia getTipoCortesia() { + return tipoCortesia; + } + + public void setTipoCortesia(TipoCortesia tipoCortesia) { + this.tipoCortesia = tipoCortesia; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipocortesiadescuentoId != null ? tipocortesiadescuentoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoCortesiaDescuento)) { + return false; + } + TipoCortesiaDescuento other = (TipoCortesiaDescuento) object; + if ((this.tipocortesiadescuentoId == null && other.tipocortesiadescuentoId != null) || (this.tipocortesiadescuentoId != null && !this.tipocortesiadescuentoId.equals(other.tipocortesiadescuentoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getPorcdescuento().toString(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoDomicilio.java b/src/com/rjconsultores/ventaboletos/entidad/TipoDomicilio.java new file mode 100644 index 000000000..4585922a3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoDomicilio.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_DOMICILIO_SEQ", sequenceName = "TIPO_DOMICILIO_SEQ", allocationSize = 1) +@Table(name = "TIPO_DOMICILIO") +public class TipoDomicilio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_DOMICILIO_SEQ") + @Column(name = "TIPODOMICILIO_ID") + private Short tipodomicilioId; + @Column(name = "CVETIPODOMICILIO") + private String cvetipodomicilio; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoDomicilio() { + } + + public TipoDomicilio(Short tipodomicilioId) { + this.tipodomicilioId = tipodomicilioId; + } + + public Short getTipodomicilioId() { + return tipodomicilioId; + } + + public void setTipodomicilioId(Short tipodomicilioId) { + this.tipodomicilioId = tipodomicilioId; + } + + public String getCvetipodomicilio() { + return cvetipodomicilio; + } + + public void setCvetipodomicilio(String cvetipodomicilio) { + this.cvetipodomicilio = cvetipodomicilio; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipodomicilioId != null ? tipodomicilioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoDomicilio)) { + return false; + } + TipoDomicilio other = (TipoDomicilio) object; + if ((this.tipodomicilioId == null && other.tipodomicilioId != null) || (this.tipodomicilioId != null && !this.tipodomicilioId.equals(other.tipodomicilioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoDomicilio[tipodomicilioId=" + tipodomicilioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoEmpleado.java b/src/com/rjconsultores/ventaboletos/entidad/TipoEmpleado.java new file mode 100644 index 000000000..f0284fafd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoEmpleado.java @@ -0,0 +1,114 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Shiro + */ +@Entity +@SequenceGenerator(name = "TIPO_EMPLEADO_SEQ", sequenceName = "TIPO_EMPLEADO_SEQ", allocationSize = 1) +@Table(name = "TIPO_EMPLEADO") +public class TipoEmpleado implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EMPLEADO_SEQ") + @Column(name = "TIPOEMPLEADO_ID") + private Integer tipoEmpleadoId; + @Column(name = "DESCTIPO") + private String descTipo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "tipoEmpleado") + private List empleadoList; + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public String getDescTipo() { + return descTipo; + } + + public void setDescTipo(String descTipo) { + this.descTipo = descTipo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getTipoEmpleadoId() { + return tipoEmpleadoId; + } + + public void setTipoEmpleadoId(Integer tipoEmpleadoId) { + this.tipoEmpleadoId = tipoEmpleadoId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoEmpleadoId != null ? tipoEmpleadoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoEmpleado)) { + return false; + } + TipoEmpleado other = (TipoEmpleado) object; + if ((this.tipoEmpleadoId == null && other.tipoEmpleadoId != null) || (this.tipoEmpleadoId != null && !this.tipoEmpleadoId.equals(other.tipoEmpleadoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + //return "com.rjconsultores.ventaboletos.entidad.GrupoCortesias[grupocortesiaId=" + grupocortesiaId + "]"; + return this.getDescTipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java b/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java new file mode 100644 index 000000000..17950652b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java @@ -0,0 +1,307 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@Table(name = "TIPO_EVENTO_EXTRA") +@SequenceGenerator(name = "TIPO_EVENTO_EXTRA_SEQ", sequenceName = "TIPO_EVENTO_EXTRA_SEQ", allocationSize = 1) +public class TipoEventoExtra implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EVENTO_EXTRA_SEQ") + @Column(name = "TIPOEVENTOEXTRA_ID") + private Integer tipoeventoextraId; + //@Column(name = "DESCINGRESO") + //private String descingreso; + @Column(name = "INDTIPO") + private String indtipo; + @Column(name = "IMPMAX") + private BigDecimal impmax; + @Column(name = "INDVALIDACORTE") + private Boolean indvalidacorte; + @Column(name = "INDVALIDADOCUMENTO") + private Boolean indvalidadocumento; + @Column(name = "INDCONTRAPARTIDA") + private Boolean indcontrapartida; + @Column(name = "INDBOLETO") + private Boolean indboleto; +// @Column(name = "INDAJUSTE") +// private Boolean indajuste; + @Column(name = "INDORDENSERVICIO") + private Boolean indordenservicio; + @Column(name = "INDOPERACION") + private Short indoperacion; + @Column(name = "PORCIVA") + private BigDecimal porciva; + + @Column(name = "PROVEEDOR") + private String proveedor; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "ACTIVO") + private Boolean activo; +// @Column(name = "DESCINGRESO2") +// private String descingreso2; + @Column(name = "INDTIPO2") + private String indtipo2; + @Column(name = "DESCTIPOEVENTO") + private String descTipoEvento; + + // @Column(name = "FORMAPAGO_ID") + // private Integer formapagoId; + // @Column(name = "PARAMARTICULO2_ID") + // private Integer paramarticulo2Id; + // @Column(name = "FORMAPAGO2_ID") + // private Integer formapago2Id; + // @Column(name = "PARAMARTICULO_ID") + // private Integer paramarticuloId; + + public String getDescTipoEvento() { + return descTipoEvento; + } + + public void setDescTipoEvento(String descTipoEvento) { + this.descTipoEvento = descTipoEvento; + } + + @JoinColumn(name = "FORMAPAGO_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago; + @JoinColumn(name = "FORMAPAGO2_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago2; + + @JoinColumn(name = "PARAMARTICULO_ID", referencedColumnName = "PARAMARTICULO_ID") + @ManyToOne + private ParamArticulo paramArticulo; + + @JoinColumn(name = "PARAMARTICULO2_ID", referencedColumnName = "PARAMARTICULO_ID") + @ManyToOne + private ParamArticulo paramArticulo2; + + public TipoEventoExtra() { + } + + public TipoEventoExtra(Integer tipoeventoextraId) { + this.tipoeventoextraId = tipoeventoextraId; + } + + public Integer getTipoeventoextraId() { + return tipoeventoextraId; + } + + public void setTipoeventoextraId(Integer tipoeventoextraId) { + this.tipoeventoextraId = tipoeventoextraId; + } + +// public String getDescingreso() { +// return descingreso; +// } +// +// public void setDescingreso(String descingreso) { +// this.descingreso = descingreso; +// } + + public String getIndtipo() { + return indtipo; + } + + public void setIndtipo(String indtipo) { + this.indtipo = indtipo; + } + + public BigDecimal getImpmax() { + return impmax; + } + + public void setImpmax(BigDecimal impmax) { + this.impmax = impmax; + } + + public Boolean getIndvalidacorte() { + return indvalidacorte; + } + + public void setIndvalidacorte(Boolean indvalidacorte) { + this.indvalidacorte = indvalidacorte; + } + + public Boolean getIndvalidadocumento() { + return indvalidadocumento; + } + + public void setIndvalidadocumento(Boolean indvalidadocumento) { + this.indvalidadocumento = indvalidadocumento; + } + + public Boolean getIndcontrapartida() { + return indcontrapartida; + } + + public void setIndcontrapartida(Boolean indcontrapartida) { + this.indcontrapartida = indcontrapartida; + } + + public Boolean getIndboleto() { + return indboleto; + } + + public void setIndboleto(Boolean indboleto) { + this.indboleto = indboleto; + } + + + + public Boolean getIndordenservicio() { + return indordenservicio; + } + + public void setIndordenservicio(Boolean indordenservicio) { + this.indordenservicio = indordenservicio; + } + + public BigDecimal getPorciva() { + return porciva; + } + + public void setPorciva(BigDecimal porciva) { + this.porciva = porciva; + } + + public String getProveedor() { + return proveedor; + } + + public void setProveedor(String proveedor) { + this.proveedor = proveedor; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public String getIndtipo2() { + return indtipo2; + } + + public void setIndtipo2(String indtipo2) { + this.indtipo2 = indtipo2; + } + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + public FormaPago getFormaPago2() { + return formaPago2; + } + + public void setFormaPago2(FormaPago formaPago2) { + this.formaPago2 = formaPago2; + } + + public ParamArticulo getParamArticulo() { + return paramArticulo; + } + + public void setParamArticulo(ParamArticulo paramArticulo) { + this.paramArticulo = paramArticulo; + } + + public ParamArticulo getParamArticulo2() { + return paramArticulo2; + } + + public void setParamArticulo2(ParamArticulo paramArticulo2) { + this.paramArticulo2 = paramArticulo2; + } + + public Short getIndoperacion() { + return indoperacion; + } + + public void setIndoperacion(Short indoperacion) { + this.indoperacion = indoperacion; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoeventoextraId != null ? tipoeventoextraId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are + // not set + if (!(object instanceof TipoEventoExtra)) { + return false; + } + TipoEventoExtra other = (TipoEventoExtra) object; + if ((this.tipoeventoextraId == null && other.tipoeventoextraId != null) + || (this.tipoeventoextraId != null && !this.tipoeventoextraId + .equals(other.tipoeventoextraId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoEventoExtra[tipoeventoextraId=" + + tipoeventoextraId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoMovimiento.java b/src/com/rjconsultores/ventaboletos/entidad/TipoMovimiento.java new file mode 100644 index 000000000..7323cb8bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoMovimiento.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_MOVIMIENTO_SEQ", sequenceName = "TIPO_MOVIMIENTO_SEQ", allocationSize = 1) +@Table(name = "TIPO_MOVIMIENTO") +public class TipoMovimiento implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_MOVIMIENTO_SEQ") + @Column(name = "TIPOMOVIMIENTO_ID") + private Short tipomovimientoId; + @Column(name = "DESCMOVIMIENTO") + private String descmovimiento; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoMovimiento() { + } + + public TipoMovimiento(Short tipomovimientoId) { + this.tipomovimientoId = tipomovimientoId; + } + + public Short getTipomovimientoId() { + return tipomovimientoId; + } + + public void setTipomovimientoId(Short tipomovimientoId) { + this.tipomovimientoId = tipomovimientoId; + } + + public String getDescmovimiento() { + return descmovimiento; + } + + public void setDescmovimiento(String descmovimiento) { + this.descmovimiento = descmovimiento; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipomovimientoId != null ? tipomovimientoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoMovimiento)) { + return false; + } + TipoMovimiento other = (TipoMovimiento) object; + if ((this.tipomovimientoId == null && other.tipomovimientoId != null) || (this.tipomovimientoId != null && !this.tipomovimientoId.equals(other.tipomovimientoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoMovimiento[tipomovimientoId=" + tipomovimientoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoOcupacion.java b/src/com/rjconsultores/ventaboletos/entidad/TipoOcupacion.java new file mode 100644 index 000000000..f35c83711 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoOcupacion.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_OCUPACION_SEQ", sequenceName = "TIPO_OCUPACION_SEQ", allocationSize = 1) +@Table(name = "TIPO_OCUPACION") +public class TipoOcupacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_OCUPACION_SEQ") + @Column(name = "TIPOOCUPACION_ID") + private Short tipoocupacionId; + @Column(name = "CVETIPOOCUPACION") + private String cvetipoocupacion; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoOcupacion() { + } + + public TipoOcupacion(Short tipoocupacionId) { + this.tipoocupacionId = tipoocupacionId; + } + + public Short getTipoocupacionId() { + return tipoocupacionId; + } + + public void setTipoocupacionId(Short tipoocupacionId) { + this.tipoocupacionId = tipoocupacionId; + } + + public String getCvetipoocupacion() { + return cvetipoocupacion; + } + + public void setCvetipoocupacion(String cvetipoocupacion) { + this.cvetipoocupacion = cvetipoocupacion; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoocupacionId != null ? tipoocupacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoOcupacion)) { + return false; + } + TipoOcupacion other = (TipoOcupacion) object; + if ((this.tipoocupacionId == null && other.tipoocupacionId != null) || (this.tipoocupacionId != null && !this.tipoocupacionId.equals(other.tipoocupacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoOcupacion[tipoocupacionId=" + tipoocupacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoParada.java b/src/com/rjconsultores/ventaboletos/entidad/TipoParada.java new file mode 100644 index 000000000..9cf17e548 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoParada.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_PARADA_SEQ", sequenceName = "TIPO_PARADA_SEQ", allocationSize = 1) +@Table(name = "TIPO_PARADA") +public class TipoParada implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_PARADA_SEQ") + @Column(name = "TIPOPARADA_ID") + private Integer tipoparadaId; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoParada() { + } + + public TipoParada(Integer tipoparadaId) { + this.tipoparadaId = tipoparadaId; + } + + public Integer getTipoparadaId() { + return tipoparadaId; + } + + public void setTipoparadaId(Integer tipoparadaId) { + this.tipoparadaId = tipoparadaId; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoparadaId != null ? tipoparadaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoParada)) { + return false; + } + TipoParada other = (TipoParada) object; + if ((this.tipoparadaId == null && other.tipoparadaId != null) || (this.tipoparadaId != null && !this.tipoparadaId.equals(other.tipoparadaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getDesctipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/TipoPuntoVenta.java new file mode 100644 index 000000000..2296c5f4d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoPuntoVenta.java @@ -0,0 +1,153 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TIPO_PTOVTA_SEQ", sequenceName = "TIPO_PTOVTA_SEQ", allocationSize = 1) +@Table(name = "TIPO_PTOVTA") +public class TipoPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_PTOVTA_SEQ") + @Column(name = "TIPOPTOVTA_ID") + private Short tipoptovtaId; + @Column(name = "DESCTIPO") + private String desctipo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "EQUIVALENCIA_ID") + private String equivalenciaId; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TIPOPTOVTA_ID") + private List lsCategoriaTipoPtoVta; + + public TipoPuntoVenta() { + } + + public TipoPuntoVenta(Short tipoptovtaId) { + this.tipoptovtaId = tipoptovtaId; + } + + public Short getTipoptovtaId() { + return tipoptovtaId; + } + + public void setTipoptovtaId(Short tipoptovtaId) { + this.tipoptovtaId = tipoptovtaId; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getEquivalenciaId() { + return equivalenciaId; + } + + public void setEquivalenciaId(String equivalenciaId) { + this.equivalenciaId = equivalenciaId; + } + + public List getLsCategoriaTipoPtoVta() { + List tmp = new ArrayList(); + if (lsCategoriaTipoPtoVta != null) { + for (CategoriaTipoPtoVta cp : this.lsCategoriaTipoPtoVta) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setLsCategoriaTipoPtoVta(List lsCategoriaTipoPtoVta) { + this.lsCategoriaTipoPtoVta = lsCategoriaTipoPtoVta; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoptovtaId != null ? tipoptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are + // not set + if (!(object instanceof TipoPuntoVenta)) { + return false; + } + TipoPuntoVenta other = (TipoPuntoVenta) object; + if ((this.tipoptovtaId == null && other.tipoptovtaId != null) || (this.tipoptovtaId != null && !this.tipoptovtaId.equals(other.tipoptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.getDesctipo(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java new file mode 100644 index 000000000..9485bcc59 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TIPO_SERVICIO_SEQ", sequenceName = "TIPO_SERVICIO_SEQ", allocationSize = 1) +@Table(name = "TIPO_SERVICIO") +public class TipoServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_SERVICIO_SEQ") + @Column(name = "TIPOSERVICIO_ID") + private Integer tiposervicioId; + @Column(name = "DESCSERVICIO") + private String descservicio; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoServicio() { + } + + public Integer getTiposervicioId() { + return tiposervicioId; + } + + public void setTiposervicioId(Integer tiposervicioId) { + this.tiposervicioId = tiposervicioId; + } + + public String getDescservicio() { + return descservicio; + } + + public void setDescservicio(String descservicio) { + this.descservicio = descservicio; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tiposervicioId != null ? tiposervicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoServicio)) { + return false; + } + TipoServicio other = (TipoServicio) object; + if ((this.tiposervicioId == null && other.tiposervicioId != null) || (this.tiposervicioId != null && !this.tiposervicioId.equals(other.tiposervicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return this.descservicio; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/TipoVenta.java new file mode 100644 index 000000000..de819c0b8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoVenta.java @@ -0,0 +1,117 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TIPO_VENTA_SEQ", sequenceName = "TIPO_VENTA_SEQ", allocationSize=1) +@Table(name = "TIPO_VENTA") +public class TipoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_VENTA_SEQ") + @Column(name = "TIPOVENTA_ID") + private Short tipoventaId; + @Column(name = "DESCTIPOVENTA") + private String desctipoventa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TipoVenta() { + } + + public TipoVenta(Short tipoventaId) { + this.tipoventaId = tipoventaId; + } + + public Short getTipoventaId() { + return tipoventaId; + } + + public void setTipoventaId(Short tipoventaId) { + this.tipoventaId = tipoventaId; + } + + public String getDesctipoventa() { + return desctipoventa; + } + + public void setDesctipoventa(String desctipoventa) { + this.desctipoventa = desctipoventa; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tipoventaId != null ? tipoventaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TipoVenta)) { + return false; + } + TipoVenta other = (TipoVenta) object; + if ((this.tipoventaId == null && other.tipoventaId != null) || (this.tipoventaId != null && !this.tipoventaId.equals(other.tipoventaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TipoVenta[tipoventaId=" + tipoventaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Tramo.java b/src/com/rjconsultores/ventaboletos/entidad/Tramo.java new file mode 100644 index 000000000..64eb911d4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Tramo.java @@ -0,0 +1,270 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TRAMO_SEQ", sequenceName = "TRAMO_SEQ", allocationSize = 1) +@Table(name = "TRAMO") +public class Tramo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_SEQ") + @Column(name = "TRAMO_ID") + private Integer tramoId; + @Column(name = "DESCTRAMO") + private String desctramo; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "VIA_ID", referencedColumnName = "VIA_ID") + @ManyToOne + private Via via; + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origem; + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + @OneToMany(mappedBy = "tramo") + private List rutaSecuenciaList; + @OneToMany(mappedBy = "tramo") + private List rutaCombinacionList; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + private List lsTramoTiempo; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + private List tramoServicioList; + @Column(name = "CANTKMPAGOCONDUCTOR") + private BigDecimal kmPagoConductor; + @Column(name = "CANTKMREAL") + private BigDecimal kmReal; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + private List tramoKms; + + public Tramo() { + } + + public Tramo(Integer tramoId) { + this.tramoId = tramoId; + } + + public Integer getTramoId() { + return tramoId; + } + + public void setTramoId(Integer tramoId) { + this.tramoId = tramoId; + } + + public String getDesctramo() { + return desctramo; + } + + public void setDesctramo(String desctramo) { + this.desctramo = desctramo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Via getVia() { + return via; + } + + public void setVia(Via via) { + this.via = via; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public List getRutaSecuenciaList() { + List lsRutaSecuencia = new ArrayList(); + for (RutaSecuencia rSecuencia : this.rutaSecuenciaList) { + if (rSecuencia.getActivo()) { + lsRutaSecuencia.add(rSecuencia); + } + } + + this.rutaSecuenciaList = lsRutaSecuencia; + + return lsRutaSecuencia; + } + + public void setRutaSecuenciaList(List rutaSecuenciaList) { + this.rutaSecuenciaList = rutaSecuenciaList; + } + + public List getRutaCombinacionList() { + List lsRutaCombinacion = new ArrayList(); + for (RutaCombinacion rCombinacion : this.rutaCombinacionList) { + if (rCombinacion.getActivo()) { + lsRutaCombinacion.add(rCombinacion); + } + } + + this.rutaCombinacionList = lsRutaCombinacion; + + return lsRutaCombinacion; + } + + public void setRutaCombinacionList(List rutaCombinacionList) { + this.rutaCombinacionList = rutaCombinacionList; + } + + public List getTramoServicioList() { + List lsTramoServicio = new ArrayList(); + for (TramoServicio tramoServicio : this.tramoServicioList) { + if (tramoServicio.getActivo()) { + lsTramoServicio.add(tramoServicio); + } + } + + this.tramoServicioList = lsTramoServicio; + + return lsTramoServicio; + } + + public void setTramoServicioList(List tramoServicioList) { + this.tramoServicioList = tramoServicioList; + } + + public List getLsTramoTiempo() { + List lsTmp = new ArrayList(); + for (TramoTiempo tramoAtributo : this.lsTramoTiempo) { + if (tramoAtributo.getActivo()) { + lsTmp.add(tramoAtributo); + } + } + + this.lsTramoTiempo = lsTmp; + + return lsTmp; + } + + public void setLsTramoTiempo(List lsTramoTiempo) { + this.lsTramoTiempo = lsTramoTiempo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tramoId != null ? tramoId.hashCode() : 0); + return hash; + } + + public BigDecimal getKmPagoConductor() { + return kmPagoConductor; + } + + public void setKmPagoConductor(BigDecimal kmPagoConductor) { + this.kmPagoConductor = kmPagoConductor; + } + + public BigDecimal getKmReal() { + return kmReal; + } + + public void setKmReal(BigDecimal kmReal) { + this.kmReal = kmReal; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Tramo)) { + return false; + } + Tramo other = (Tramo) object; + if ((this.tramoId == null && other.tramoId != null) || (this.tramoId != null && !this.tramoId.equals(other.tramoId))) { + return false; + } + return true; + } + + public List getTramoKms() { + return tramoKms; + } + + public void setTramoKms(List tramoKms) { + this.tramoKms = tramoKms; + } + +// @Override +// public String toString() { +// return getDesctramo(); +// } + @Override + public String toString() { + return getDesctramo().concat(" - ").concat(this.getVia().getNombvia()); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TramoKm.java b/src/com/rjconsultores/ventaboletos/entidad/TramoKm.java new file mode 100644 index 000000000..7a19b4427 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TramoKm.java @@ -0,0 +1,112 @@ +package com.rjconsultores.ventaboletos.entidad; + +// Generated 10/01/2012 11:38:41 by Hibernate Tools 3.4.0.CR1 + +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * TramoKm generated by hbm2java + */ +@Entity +@SequenceGenerator(name = "TRAMO_KM_SEQ", sequenceName = "TRAMO_KM_SEQ", allocationSize = 1) +@Table(name = "TRAMO_KM") +public class TramoKm implements java.io.Serializable { + + @Id + @Column(name = "TRAMOKM_ID") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_KM_SEQ") + @Basic(optional = false) + private int tramokmId; + @ManyToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @ManyToOne + @JoinColumn(name = "TRAMO_ID") + private Tramo tramo; + @Column(name = "CANTKMPAGOCONDUCTOR") + private Integer cantkmpagoconductor; + @Column(name = "ACTIVO") + private Boolean activo; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "FECMODIF") + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public TramoKm() { + } + + public TramoKm(int tramokmId) { + this.tramokmId = tramokmId; + } + + public int getTramokmId() { + return this.tramokmId; + } + + public void setTramokmId(int tramokmId) { + this.tramokmId = tramokmId; + } + + public Integer getCantkmpagoconductor() { + return this.cantkmpagoconductor; + } + + public void setCantkmpagoconductor(Integer cantkmpagoconductor) { + this.cantkmpagoconductor = cantkmpagoconductor; + } + + public Boolean getActivo() { + return this.activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return this.fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return this.usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TramoKmServicio.java b/src/com/rjconsultores/ventaboletos/entidad/TramoKmServicio.java new file mode 100644 index 000000000..3e829b571 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TramoKmServicio.java @@ -0,0 +1,165 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Desenvolvimento + */ +@Entity +@SequenceGenerator(name = "TRAMO_SERVICIO_SEQ", sequenceName = "TRAMO_SERVICIO_SEQ", allocationSize = 1) +@Table(name = "TRAMO_KM_SERVICIO") +public class TramoKmServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_SERVICIO_SEQ") + @Column(name = "TRAMOKMSERVICIO") + private Integer tramokmservicioId; + @Basic(optional = false) + @Column(name = "CANTKMPAGOCONDUCTOR") + private BigDecimal cantkmpagoconductor; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + + public TramoKmServicio() { + } + + public TramoKmServicio(Integer tramokmservicio) { + this.tramokmservicioId = tramokmservicio; + } + + public TramoKmServicio(Integer tramokmservicio, BigDecimal cantkmpagoconductor, Boolean activo) { + this.tramokmservicioId = tramokmservicio; + this.cantkmpagoconductor = cantkmpagoconductor; + this.activo = activo; + } + + public Integer getTramokmservicioId() { + return tramokmservicioId; + } + + public void setTramokmservicioId(Integer tramokmservicioId) { + this.tramokmservicioId = tramokmservicioId; + } + + + + public BigDecimal getCantkmpagoconductor() { + return cantkmpagoconductor; + } + + public void setCantkmpagoconductor(BigDecimal cantkmpagoconductor) { + this.cantkmpagoconductor = cantkmpagoconductor; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (tramokmservicioId != null ? tramokmservicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TramoKmServicio)) { + return false; + } + TramoKmServicio other = (TramoKmServicio) object; + if ((this.tramokmservicioId == null && other.tramokmservicioId != null) || (this.tramokmservicioId != null && !this.tramokmservicioId.equals(other.tramokmservicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TramoKmServicio[tramokmservicio=" + tramokmservicioId + "]"; + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TramoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/TramoServicio.java new file mode 100644 index 000000000..81fd01d02 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TramoServicio.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TRAMO_SERVICIO_SEQ", sequenceName = "TRAMO_SERVICIO_SEQ", allocationSize = 1) +@Table(name = "TRAMO_SERVICIO") +public class TramoServicio implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_SERVICIO_SEQ") + @Column(name = "TRAMOSERVICIO_ID") + private Integer tramoservicioId; + @Column(name = "TIEMPORECORRIDO") + @Temporal(TemporalType.TIMESTAMP) + private Date tiemporecorrido; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public TramoServicio() { + } + + public TramoServicio(Integer tramoservicioId) { + this.tramoservicioId = tramoservicioId; + } + + public Integer getTramoservicioId() { + return tramoservicioId; + } + + public void setTramoservicioId(Integer tramoservicioId) { + this.tramoservicioId = tramoservicioId; + } + + public Date getTiemporecorrido() { + return tiemporecorrido; + } + + public void setTiemporecorrido(Date tiemporecorrido) { + this.tiemporecorrido = tiemporecorrido; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TramoServicio other = (TramoServicio) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.tramo != other.tramo && (this.tramo == null || !this.tramo.equals(other.tramo))) { + return false; + } + if (this.claseServicio != other.claseServicio && (this.claseServicio == null || !this.claseServicio.equals(other.claseServicio))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + return hash; + } + + @Override + public String toString() { + return "teste.TramoServicio[tramoservicioId=" + tramoservicioId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/TramoTiempo.java b/src/com/rjconsultores/ventaboletos/entidad/TramoTiempo.java new file mode 100644 index 000000000..0687b3392 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TramoTiempo.java @@ -0,0 +1,236 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "TRAMO_TIEMPO_SEQ", sequenceName = "TRAMO_TIEMPO_SEQ", allocationSize = 1) +@Table(name = "TRAMO_TIEMPO") +public class TramoTiempo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_TIEMPO_SEQ") + @Column(name = "TRAMOTIEMPO_ID") + private Integer tramotiempoId; + @Column(name = "TIEMPORECORRIDO") + @Temporal(TemporalType.TIMESTAMP) + private Date tiemporecorrido; + @Column(name = "HORAINICIO") + @Temporal(TemporalType.TIMESTAMP) + private Date horainicio; + @Column(name = "HORAFIN") + @Temporal(TemporalType.TIMESTAMP) + private Date horafin; + @Column(name = "INDAPLICLUN") + private Boolean indapliclun; + @Column(name = "INDAPLICMAR") + private Boolean indaplicmar; + @Column(name = "INDAPLICMIE") + private Boolean indaplicmie; + @Column(name = "INDAPLICJUE") + private Boolean indaplicjue; + @Column(name = "INDAPLICVIE") + private Boolean indaplicvie; + @Column(name = "INDAPLICSAB") + private Boolean indaplicsab; + @Column(name = "INDAPLICDOM") + private Boolean indaplicdom; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID") + @ManyToOne + private Tramo tramo; + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public TramoTiempo() { + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Date getHorafin() { + return horafin; + } + + public void setHorafin(Date horafin) { + this.horafin = horafin; + } + + public Date getHorainicio() { + return horainicio; + } + + public void setHorainicio(Date horainicio) { + this.horainicio = horainicio; + } + + public Boolean getIndaplicdom() { + return indaplicdom; + } + + public void setIndaplicdom(Boolean indaplicdom) { + this.indaplicdom = indaplicdom; + } + + public Boolean getIndaplicjue() { + return indaplicjue; + } + + public void setIndaplicjue(Boolean indaplicjue) { + this.indaplicjue = indaplicjue; + } + + public Boolean getIndapliclun() { + return indapliclun; + } + + public void setIndapliclun(Boolean indapliclun) { + this.indapliclun = indapliclun; + } + + public Boolean getIndaplicmar() { + return indaplicmar; + } + + public void setIndaplicmar(Boolean indaplicmar) { + this.indaplicmar = indaplicmar; + } + + public Boolean getIndaplicmie() { + return indaplicmie; + } + + public void setIndaplicmie(Boolean indaplicmie) { + this.indaplicmie = indaplicmie; + } + + public Boolean getIndaplicsab() { + return indaplicsab; + } + + public void setIndaplicsab(Boolean indaplicsab) { + this.indaplicsab = indaplicsab; + } + + public Boolean getIndaplicvie() { + return indaplicvie; + } + + public void setIndaplicvie(Boolean indaplicvie) { + this.indaplicvie = indaplicvie; + } + + public Date getTiemporecorrido() { + return tiemporecorrido; + } + + public void setTiemporecorrido(Date tiemporecorrido) { + this.tiemporecorrido = tiemporecorrido; + } + + public Tramo getTramo() { + return tramo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public Integer getTramotiempoId() { + return tramotiempoId; + } + + public void setTramotiempoId(Integer tramotiempoId) { + this.tramotiempoId = tramotiempoId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TramoTiempo other = (TramoTiempo) obj; + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + if (this.tramo != other.tramo && (this.tramo == null || !this.tramo.equals(other.tramo))) { + return false; + } + if (this.claseServicio != other.claseServicio && (this.claseServicio == null || !this.claseServicio.equals(other.claseServicio))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + return hash; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.TramoTiempo[tramotiempoId=" + tramotiempoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Turno.java b/src/com/rjconsultores/ventaboletos/entidad/Turno.java new file mode 100644 index 000000000..cbbdf6522 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Turno.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "TURNO_SEQ", sequenceName = "TURNO_SEQ", allocationSize = 1) +@Table(name = "TURNO") +public class Turno implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "TURNO_SEQ") + @Column(name = "TURNO_ID") + private Short turnoId; + @Column(name = "DESCTURNO") + private String descturno; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "ACTIVO") + private Boolean activo; + + public Turno() { + } + + public Turno(Short turnoId) { + this.turnoId = turnoId; + } + + public Short getTurnoId() { + return turnoId; + } + + public void setTurnoId(Short turnoId) { + this.turnoId = turnoId; + } + + public String getDescturno() { + return descturno; + } + + public void setDescturno(String descturno) { + this.descturno = descturno; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (turnoId != null ? turnoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Turno)) { + return false; + } + Turno other = (Turno) object; + if ((this.turnoId == null && other.turnoId != null) || (this.turnoId != null && !this.turnoId.equals(other.turnoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Turno[turnoId=" + turnoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Usuario.java b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java new file mode 100644 index 000000000..3fc0e3cbc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java @@ -0,0 +1,258 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import com.rjconsultores.ventaboletos.dao.UsuarioPerfilDAO; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "USUARIO_SEQ", sequenceName = "USUARIO_SEQ", allocationSize = 1) +@Table(name = "USUARIO") +public class Usuario implements Serializable, Authentication, UserDetails { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "USUARIO_SEQ") + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "NOMBUSUARIO") + private String nombusuario; + @Column(name = "NOMBPATERNO") + private String nombpaterno; + @Column(name = "NOMBMATERNO") + private String nombmaterno; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIOMODIF_ID") + private Integer usuariomodifId; + @Column(name = "DESCCONTRASENA") + private String senha; + @Column(name = "CVEUSUARIO") + private String claveUsuario; + @Column(name = "DESCCORREO") + private String descCorreo; + @OneToMany(mappedBy = "usuario", cascade = CascadeType.ALL) + private List usuarioPerfilList; + @OneToOne + @JoinColumn(name = "EMPLEADO_ID") + private Empleado empleado; + + public String getClaveUsuario() { + return claveUsuario; + } + + public void setClaveUsuario(String claveUsuario) { + this.claveUsuario = claveUsuario; + } + + public Usuario() { + } + + public Usuario(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public String getNombusuario() { + return nombusuario; + } + + public void setNombusuario(String nombusuario) { + this.nombusuario = nombusuario; + } + + public String getNombpaterno() { + return nombpaterno; + } + + public void setNombpaterno(String nombpaterno) { + this.nombpaterno = nombpaterno; + } + + public String getNombmaterno() { + return nombmaterno; + } + + public void setNombmaterno(String nombmaterno) { + this.nombmaterno = nombmaterno; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuariomodifId() { + return usuariomodifId; + } + + public void setUsuariomodifId(Integer usuariomodifId) { + this.usuariomodifId = usuariomodifId; + } + + public String getSenha() { + return senha; + } + + public void setSenha(String senha) { + this.senha = senha; + } + + public List getUsuarioPerfilList() { + List tmp = new ArrayList(); + if (usuarioPerfilList != null) { + for (UsuarioPerfil cp : this.usuarioPerfilList) { + if (cp.getActivo()) { + tmp.add(cp); + } + } + } + + return tmp; + } + + public void setUsuarioPerfilList(List usuarioPerfilList) { + this.usuarioPerfilList = usuarioPerfilList; + } + + public Empleado getEmpleado() { + return empleado; + } + + public void setEmpleado(Empleado empleado) { + this.empleado = empleado; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (usuarioId != null ? usuarioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Usuario)) { + return false; + } + Usuario other = (Usuario) object; + if ((this.usuarioId == null && other.usuarioId != null) || (this.usuarioId != null && !this.usuarioId.equals(other.usuarioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Usuario[usuarioId=" + usuarioId + "]"; + } + + public Collection getAuthorities() { + return new ArrayList(); + } + + public String getPassword() { + return this.senha; + } + + public String getUsername() { + return this.nombusuario; + } + + public boolean isAccountNonExpired() { + return true; + } + + public boolean isAccountNonLocked() { + return true; + } + + public boolean isCredentialsNonExpired() { + return true; + } + + public boolean isEnabled() { + return true; + } + + public Object getCredentials() { + return new Object(); + } + + public Object getDetails() { + return new Object(); + } + + public Object getPrincipal() { + return this; + } + + public boolean isAuthenticated() { + return Boolean.TRUE; + } + + public void setAuthenticated(boolean bln) throws IllegalArgumentException { + } + + public String getName() { + return this.getNombusuario(); + } + + public String getDescCorreo() { + return descCorreo; + } + + public void setDescCorreo(String descCorreo) { + this.descCorreo = descCorreo; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/UsuarioBancario.java b/src/com/rjconsultores/ventaboletos/entidad/UsuarioBancario.java new file mode 100644 index 000000000..f176eedbc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/UsuarioBancario.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "USUARIO_BANCARIO_SEQ", sequenceName = "USUARIO_BANCARIO_SEQ", allocationSize = 1) +@Table(name = "USUARIO_BANCARIO") +public class UsuarioBancario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "USUARIO_BANCARIO_SEQ") + @Column(name = "USUARIOBANCARIO_ID") + private Integer usuariobancarioId; + @Column(name = "CVEUSUARIO") + private String cveusuario; + @Column(name = "PASSWORD") + private String password; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @JoinColumn(name = "COMPANIABANCARIA_ID", referencedColumnName = "COMPANIABANCARIA_ID") + @ManyToOne(optional = false) + private CompaniaBancaria companiaBancaria; + + public UsuarioBancario() { + } + + public UsuarioBancario(Integer usuariobancarioId) { + this.usuariobancarioId = usuariobancarioId; + } + + public UsuarioBancario(Integer usuariobancarioId, Boolean activo) { + this.usuariobancarioId = usuariobancarioId; + this.activo = activo; + } + + public Integer getUsuariobancarioId() { + return usuariobancarioId; + } + + public void setUsuariobancarioId(Integer usuariobancarioId) { + this.usuariobancarioId = usuariobancarioId; + } + + public String getCveusuario() { + return cveusuario; + } + + public void setCveusuario(String cveusuario) { + this.cveusuario = cveusuario; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public CompaniaBancaria getCompaniaBancaria() { + return companiaBancaria; + } + + public void setCompaniaBancaria(CompaniaBancaria companiaBancaria) { + this.companiaBancaria = companiaBancaria; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UsuarioBancario other = (UsuarioBancario) obj; + if ((this.cveusuario == null) ? (other.cveusuario != null) : !this.cveusuario.equals(other.cveusuario)) { + return false; + } + if ((this.password == null) ? (other.password != null) : !this.password.equals(other.password)) { + return false; + } + if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 67 * hash + (this.cveusuario != null ? this.cveusuario.hashCode() : 0); + hash = 67 * hash + (this.password != null ? this.password.hashCode() : 0); + hash = 67 * hash + (this.activo != null ? this.activo.hashCode() : 0); + return hash; + } + + + + @Override + public String toString() { + return getCveusuario(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/UsuarioPerfil.java b/src/com/rjconsultores/ventaboletos/entidad/UsuarioPerfil.java new file mode 100644 index 000000000..25ee80afc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/UsuarioPerfil.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "USUARIO_PERFIL_SEQ", sequenceName = "USUARIO_PERFIL_SEQ", allocationSize = 1) +@Table(name = "USUARIO_PERFIL") +public class UsuarioPerfil implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "USUARIO_PERFIL_SEQ") + @Column(name = "USUARIOPERFIL_ID") + private Integer usuarioperfilId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIOMODIF_ID") + private Integer usuariomodifId; + @JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID") + @ManyToOne + private Usuario usuario; + @JoinColumn(name = "PERFIL_ID", referencedColumnName = "PERFIL_ID") + @ManyToOne + private Perfil perfil; + + public UsuarioPerfil() { + } + + public UsuarioPerfil(Integer usuarioperfilId) { + this.usuarioperfilId = usuarioperfilId; + } + + public Integer getUsuarioperfilId() { + return usuarioperfilId; + } + + public void setUsuarioperfilId(Integer usuarioperfilId) { + this.usuarioperfilId = usuarioperfilId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuariomodifId() { + return usuariomodifId; + } + + public void setUsuariomodifId(Integer usuariomodifId) { + this.usuariomodifId = usuariomodifId; + } + + public Usuario getUsuario() { + return usuario; + } + + public void setUsuario(Usuario usuario) { + this.usuario = usuario; + } + + public Perfil getPerfil() { + return perfil; + } + + public void setPerfil(Perfil perfil) { + this.perfil = perfil; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (usuarioperfilId != null ? usuarioperfilId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof UsuarioPerfil)) { + return false; + } + UsuarioPerfil other = (UsuarioPerfil) object; + if ((this.usuarioperfilId == null && other.usuarioperfilId != null) || (this.usuarioperfilId != null && !this.usuarioperfilId.equals(other.usuarioperfilId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.dao.hibernate.UsuarioPerfil[usuarioperfilId=" + usuarioperfilId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/UsuarioUbicacion.java b/src/com/rjconsultores/ventaboletos/entidad/UsuarioUbicacion.java new file mode 100644 index 000000000..aeffb5bdb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/UsuarioUbicacion.java @@ -0,0 +1,141 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@Table(name = "USUARIO_UBICACION") +@SequenceGenerator(name = "USUARIO_UBICACION_SEQ", sequenceName = "USUARIO_UBICACION_SEQ", allocationSize = 1) +public class UsuarioUbicacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "USUARIO_UBICACION_SEQ") + @Column(name = "USUARIOUBICACION_ID") + private Integer usuarioubicacionId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIOMODIF_ID") + private Integer usuariomodifId; + @OneToOne + @JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID") + private Usuario usuario; + @OneToOne + @JoinColumn(name = "PARADA_ID", referencedColumnName = "PARADA_ID") + private Parada parada; + @OneToOne + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + private PuntoVenta puntoVenta; + + public UsuarioUbicacion() { + } + + public UsuarioUbicacion(Integer usuarioubicacionId) { + this.usuarioubicacionId = usuarioubicacionId; + } + + public Integer getUsuarioubicacionId() { + return usuarioubicacionId; + } + + public void setUsuarioubicacionId(Integer usuarioubicacionId) { + this.usuarioubicacionId = usuarioubicacionId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuariomodifId() { + return usuariomodifId; + } + + public void setUsuariomodifId(Integer usuariomodifId) { + this.usuariomodifId = usuariomodifId; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public Usuario getUsuario() { + return usuario; + } + + public void setUsuario(Usuario usuario) { + this.usuario = usuario; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (usuarioubicacionId != null ? usuarioubicacionId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof UsuarioUbicacion)) { + return false; + } + UsuarioUbicacion other = (UsuarioUbicacion) object; + if ((this.usuarioubicacionId == null && other.usuarioubicacionId != null) || (this.usuarioubicacionId != null && !this.usuarioubicacionId.equals(other.usuarioubicacionId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion[usuarioubicacionId=" + usuarioubicacionId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Via.java b/src/com/rjconsultores/ventaboletos/entidad/Via.java new file mode 100644 index 000000000..735e7c394 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Via.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.SequenceGenerator; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "VIA_SEQ", sequenceName = "VIA_SEQ", allocationSize = 1) +@Table(name = "VIA") +public class Via implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "VIA_SEQ") + @Basic(optional = false) + @Column(name = "VIA_ID") + private Integer viaId; + @Column(name = "NOMBVIA") + private String nombvia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "via") + private List tramoList; + + public Via() { + } + + public Via(Integer viaId) { + this.viaId = viaId; + } + + public Integer getViaId() { + return viaId; + } + + public void setViaId(Integer viaId) { + this.viaId = viaId; + } + + public String getNombvia() { + return nombvia; + } + + public void setNombvia(String nombvia) { + this.nombvia = nombvia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getTramoList() { + return tramoList; + } + + public void setTramoList(List tramoList) { + this.tramoList = tramoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (viaId != null ? viaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Via)) { + return false; + } + Via other = (Via) object; + if ((this.viaId == null && other.viaId != null) || (this.viaId != null && !this.viaId.equals(other.viaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return getNombvia(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/VigenciaTarifa.java b/src/com/rjconsultores/ventaboletos/entidad/VigenciaTarifa.java new file mode 100644 index 000000000..805641ffe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/VigenciaTarifa.java @@ -0,0 +1,154 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author rodrigo + */ +@Entity +@SequenceGenerator(name = "VIGENCIA_TARIFA_SEQ", sequenceName = "VIGENCIA_TARIFA_SEQ", allocationSize = 1) +@Table(name = "VIGENCIA_TARIFA") +public class VigenciaTarifa implements Serializable { + + @OneToMany(mappedBy = "vigenciaTarifa") + private List tarifaHistList; + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "VIGENCIA_TARIFA_SEQ") + @Basic(optional = false) + @Column(name = "VIGENCIATARIFA_ID") + private Integer vigenciatarifaId; + @Column(name = "FECINICIOVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private java.util.Date feciniciovigencia; + @Column(name = "FECFINVIGENCIA") + @Temporal(TemporalType.TIMESTAMP) + private java.util.Date fecfinvigencia; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "FECHABILITACIONVENTA") + @Temporal(TemporalType.TIMESTAMP) + private java.util.Date fechabilitacionventa; + + public VigenciaTarifa() { + } + + public VigenciaTarifa(Integer vigenciatarifaId) { + this.vigenciatarifaId = vigenciatarifaId; + } + + public Integer getVigenciatarifaId() { + return vigenciatarifaId; + } + + public void setVigenciatarifaId(Integer vigenciatarifaId) { + this.vigenciatarifaId = vigenciatarifaId; + } + + public Date getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Date fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public Date getFeciniciovigencia() { + return feciniciovigencia; + } + + public void setFeciniciovigencia(Date feciniciovigencia) { + this.feciniciovigencia = feciniciovigencia; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public java.util.Date getFechabilitacionventa() { + return fechabilitacionventa; + } + + public void setFechabilitacionventa(java.util.Date fechabilitacionventa) { + this.fechabilitacionventa = fechabilitacionventa; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (vigenciatarifaId != null ? vigenciatarifaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof VigenciaTarifa)) { + return false; + } + VigenciaTarifa other = (VigenciaTarifa) object; + if ((this.vigenciatarifaId == null && other.vigenciatarifaId != null) || (this.vigenciatarifaId != null && !this.vigenciatarifaId.equals(other.vigenciatarifaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + + return f.format(feciniciovigencia) + " - " + f.format(fecfinvigencia); + } + + public List getTarifaHistList() { + return tarifaHistList; + } + + public void setTarifaHistList(List tarifaHistList) { + this.tarifaHistList = tarifaHistList; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Zona.java b/src/com/rjconsultores/ventaboletos/entidad/Zona.java new file mode 100644 index 000000000..a9c59a26a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/Zona.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Administrador + */ +@Entity +@SequenceGenerator(name = "ZONA_SEQ", sequenceName = "ZONA_SEQ", allocationSize=1) +@Table(name = "ZONA") +public class Zona implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ZONA_SEQ") + @Column(name = "ZONA_ID") + private Integer zonaId; + @Column(name = "DESCZONA") + private String desczona; + @Column(name = "ACTIVO") + private Short activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @OneToMany(mappedBy = "zona") + private List corridaList; + + public Zona() { + } + + public Zona(Integer zonaId) { + this.zonaId = zonaId; + } + + public Integer getZonaId() { + return zonaId; + } + + public void setZonaId(Integer zonaId) { + this.zonaId = zonaId; + } + + public String getDesczona() { + return desczona; + } + + public void setDesczona(String desczona) { + this.desczona = desczona; + } + + public Short getActivo() { + return activo; + } + + public void setActivo(Short activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public List getCorridaList() { + return corridaList; + } + + public void setCorridaList(List corridaList) { + this.corridaList = corridaList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (zonaId != null ? zonaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Zona)) { + return false; + } + Zona other = (Zona) object; + if ((this.zonaId == null && other.zonaId != null) || (this.zonaId != null && !this.zonaId.equals(other.zonaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Zona[zonaId=" + zonaId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/exception/BusinessException.java b/src/com/rjconsultores/ventaboletos/exception/BusinessException.java new file mode 100644 index 000000000..72ee06334 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/exception/BusinessException.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.exception; + +import java.text.MessageFormat; + +import org.zkoss.util.resource.Labels; + +public class BusinessException extends Exception { + + /** + * + * @param message + * - La clave del archivo de traducción + */ + public BusinessException(String message) { + super(Labels.getLabel(message)); + } + /** + * + * @param message- La clave del archivo de traducción + * @param oMsg - Los parametros de la mensage + */ + public BusinessException(String message,Object oMsg) { + super(new MessageFormat(Labels.getLabel(message)).format(oMsg)); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/AjusteEventoExtraService.java b/src/com/rjconsultores/ventaboletos/service/AjusteEventoExtraService.java new file mode 100644 index 000000000..44c132a1f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AjusteEventoExtraService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra; + +public interface AjusteEventoExtraService extends + GenericService { + +} diff --git a/src/com/rjconsultores/ventaboletos/service/AlertaCtrlService.java b/src/com/rjconsultores/ventaboletos/service/AlertaCtrlService.java new file mode 100644 index 000000000..d907fe2e6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AlertaCtrlService.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AlertaCtrlService { + + public List obtenerTodos(); + + public AlertaCtrl obtenerID(Integer id); + + public AlertaCtrl suscribirActualizar(AlertaCtrl entidad) throws BusinessException; + + public void borrar(AlertaCtrl entidad); + + public List buscar(Parada origem, Parada destino, Ruta ruta, ClaseServicio claseServicio, Integer tiempoAlta, Integer tiempoBaja, BigDecimal percAlta, + BigDecimal percBaja); + + public List buscarCorrida(Corrida corrida); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ArticuloService.java b/src/com/rjconsultores/ventaboletos/service/ArticuloService.java new file mode 100644 index 000000000..cb40d4ad4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ArticuloService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ArticuloService extends GenericService { + + public List buscar(String descarticulo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/AsientoExclusivoService.java b/src/com/rjconsultores/ventaboletos/service/AsientoExclusivoService.java new file mode 100644 index 000000000..e932896fa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AsientoExclusivoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.AsientoExclusivo; + +/** + * + * @author rodrigo + */ +public interface AsientoExclusivoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/AutobusService.java b/src/com/rjconsultores/ventaboletos/service/AutobusService.java new file mode 100644 index 000000000..e625abace --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AutobusService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutobusService extends GenericService { + + public List buscar(String numautobus, DiagramaAutobus diagramaAutobus); +} diff --git a/src/com/rjconsultores/ventaboletos/service/AutorizacionPerfilService.java b/src/com/rjconsultores/ventaboletos/service/AutorizacionPerfilService.java new file mode 100644 index 000000000..f0af6782b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AutorizacionPerfilService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutorizacionPerfilService extends GenericService { + + public List buscar(Autorizacion autorizacion, Perfil perfil); +} diff --git a/src/com/rjconsultores/ventaboletos/service/AutorizacionService.java b/src/com/rjconsultores/ventaboletos/service/AutorizacionService.java new file mode 100644 index 000000000..792bc420f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AutorizacionService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface AutorizacionService extends GenericService { + + public List buscar(String nombautorizacion, String descautorizacion); +} diff --git a/src/com/rjconsultores/ventaboletos/service/BancoService.java b/src/com/rjconsultores/ventaboletos/service/BancoService.java new file mode 100644 index 000000000..de2ff14c2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/BancoService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Banco; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface BancoService extends GenericService{ + + public List buscar(Banco banco); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CancelacionCargoService.java b/src/com/rjconsultores/ventaboletos/service/CancelacionCargoService.java new file mode 100644 index 000000000..419919929 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CancelacionCargoService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; + +/** + * + * @author Rafius + */ +public interface CancelacionCargoService extends GenericService{ + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CancelacionCtrlService.java b/src/com/rjconsultores/ventaboletos/service/CancelacionCtrlService.java new file mode 100644 index 000000000..8e629fcc8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CancelacionCtrlService.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface CancelacionCtrlService extends GenericService{ + + public List buscar(Date tiempoprevsalida, PuntoVenta puntoVenta, Parada paradaOrigem, Parada paradaDestino, Marca marca); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaClaseService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaClaseService.java new file mode 100644 index 000000000..f0562a709 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaClaseService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaClaseService extends GenericService { + + public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaCorridaService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaCorridaService.java new file mode 100644 index 000000000..e2c9fd2fb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaCorridaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaCorridaService extends GenericService { + + public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java new file mode 100644 index 000000000..8d3b6023b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; + +/** + * + * @author Administrador + */ +public interface CategoriaCtrlService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaDescuentoService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaDescuentoService.java new file mode 100644 index 000000000..3095b0ea0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaDescuentoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; + +/** + * + * @author Administrador + */ +public interface CategoriaDescuentoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaMarcaService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaMarcaService.java new file mode 100644 index 000000000..83c028568 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaMarcaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; + +/** + * + * @author Administrador + */ +public interface CategoriaMarcaService extends GenericService { + + public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaMercadoService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaMercadoService.java new file mode 100644 index 000000000..5cc312922 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaMercadoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; + +/** + * + * @author Administrador + */ +public interface CategoriaMercadoService extends GenericService { + + public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaPeriodoService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaPeriodoService.java new file mode 100644 index 000000000..5f7c32179 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaPeriodoService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface CategoriaPeriodoService extends GenericService { + + public List buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo); + + public List obtenerPorCategoriaDescuento(CategoriaDescuento categoriaDescuento); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaService.java new file mode 100644 index 000000000..c2be7a5c9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaService.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface CategoriaService extends GenericService { + + public List buscar(String desccategoria); + /** + * Hance una búsqueda de todas las categorias que son visibles al usuario + * Ejemplo de categorias que no son vis + * @return + */ + public List obtenerTodasCategoriasVisibles(); + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaTipoPtoVtaService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaTipoPtoVtaService.java new file mode 100644 index 000000000..18b8a3917 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaTipoPtoVtaService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface CategoriaTipoPtoVtaService extends + GenericService { + + public List buscarPorPuntoVenta(TipoPuntoVenta tipoPuntoVenta); + + public void borrarFisico(CategoriaTipoPtoVta cd); + } diff --git a/src/com/rjconsultores/ventaboletos/service/CiudadService.java b/src/com/rjconsultores/ventaboletos/service/CiudadService.java new file mode 100644 index 000000000..81dd89044 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CiudadService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; + +/** + * + * @author MCosso + */ +public interface CiudadService extends GenericService { + + public List buscar(String nombciudad, Estado estado, Plaza plaza); + + public List buscaLike(String strCiudad); +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/ClaseServicioService.java b/src/com/rjconsultores/ventaboletos/service/ClaseServicioService.java new file mode 100644 index 000000000..0f1980077 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ClaseServicioService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ClaseServicioService extends GenericService { + + public List buscarPorNome(String nomeClaseServicio); + + public List buscarTodosExceto(Integer ... idClase); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ClaseservicioEquivalenciaService.java b/src/com/rjconsultores/ventaboletos/service/ClaseservicioEquivalenciaService.java new file mode 100644 index 000000000..e2c1748a1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ClaseservicioEquivalenciaService.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ClaseservicioEquivalenciaService + extends GenericService { + + public List buscar(ClaseServicio parada, ComisionistaExterno comisionistaExterno); + + public List buscarEquivalencia(ClaseservicioEquivalencia claseServicioEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ColoniaService.java b/src/com/rjconsultores/ventaboletos/service/ColoniaService.java new file mode 100644 index 000000000..d24d53231 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ColoniaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ColoniaService extends GenericService { + + public List buscar(String desccolonia); + public List buscarPorCiudad(Ciudad ciudad); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ComisionistaExternoService.java b/src/com/rjconsultores/ventaboletos/service/ComisionistaExternoService.java new file mode 100644 index 000000000..d7cd83b2e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ComisionistaExternoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ComisionistaExternoService extends GenericService { + + public List buscar(String desccomisionista); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CompaniaBancariaService.java b/src/com/rjconsultores/ventaboletos/service/CompaniaBancariaService.java new file mode 100644 index 000000000..4d5576ab2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CompaniaBancariaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface CompaniaBancariaService extends GenericService { + + public List buscar(CompaniaBancaria companiaBancaria); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConductorService.java b/src/com/rjconsultores/ventaboletos/service/ConductorService.java new file mode 100644 index 000000000..5b2022ab5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ConductorService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Conductor; + +/** + * + * @author Administrador + */ +public interface ConductorService extends GenericService { + + public Conductor buscar(String claveConductor, String contraSenha); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConfigRestriccionPagoService.java b/src/com/rjconsultores/ventaboletos/service/ConfigRestriccionPagoService.java new file mode 100644 index 000000000..55c899544 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ConfigRestriccionPagoService.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ConfigRestriccionPagoService + extends GenericService { + + public List buscar(FormaPago formaPago, + RestriccionPago restriccionPago); + + /** + * Verifica se puede dar de alta en el registro. + * Ej.:Para una forma de pago que ya esta configurada para "Cancelable", no se puede permitr da de alta en la misma forma de pago con + * restriccion de "No Cancelable" + * @param configRestriccionPago + * @return + */ + public boolean puedoDarDeAlta(ConfigRestriccionPago configRestriccionPago); + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConstanteService.java b/src/com/rjconsultores/ventaboletos/service/ConstanteService.java new file mode 100644 index 000000000..3b42519c0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ConstanteService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ConstanteService extends GenericService { + + public Constante buscarPorNomeConstante(String nomeConstante); + + public List buscar(String nombconstante); + + String buscarNombreAmbiente(); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConvenioDetService.java b/src/com/rjconsultores/ventaboletos/service/ConvenioDetService.java new file mode 100644 index 000000000..74f0bb549 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ConvenioDetService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; + +/** + * + * @author Administrador + */ +public interface ConvenioDetService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConvenioService.java b/src/com/rjconsultores/ventaboletos/service/ConvenioService.java new file mode 100644 index 000000000..68ab7dc4d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ConvenioService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Convenio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ConvenioService extends GenericService { + + public List buscar(String descconvenio, String cveconvenio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CorridaCtrlService.java b/src/com/rjconsultores/ventaboletos/service/CorridaCtrlService.java new file mode 100644 index 000000000..d418ccab1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CorridaCtrlService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.util.Date; + +/** + * + * @author Administrador + */ +public interface CorridaCtrlService extends GenericService { + + public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, Date horario, boolean pisoExtra); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CorridaService.java b/src/com/rjconsultores/ventaboletos/service/CorridaService.java new file mode 100644 index 000000000..0a4f79c52 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CorridaService.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.Parada; + +/** + * + * @author rodrigo + */ +public interface CorridaService extends GenericService { + + public void generarCorrida(Date dataGeracao, List lsEsquemaCorrida); + + /** + * Genera las corridas de acuerdo con el parametro de cant dias. + * + * + * @return - Si fue generado exitosamente o no + */ + public boolean generarCorridaAutomatica(); + + public List buscarPorAutobusCorridasFuturas(DiagramaAutobus diagramaAutobus); + + public List buscarPorRolOperativoCorridasFuturas(DiagramaAutobus diagramaAutobus); + + public List buscarPorFecCorrida(Date value); + + public List buscarPorId(Integer idCorrida); + + public List buscarFiltro(Parada ori, Parada des, Date hora, ClaseServicio cs); + + /** + * Regresa la fecha final para el período de generación automatica de corridas. + * + * + * @return + */ + public Date calcularDataFinalGeneracionCorrida(); + + public boolean generarCorridaAutomatica(Date dataDe, Date dataAte); + + public List buscarDistinct(Parada ori, Parada des, Date horaSalidaInicio, Date horaSalidaFin, ClaseServicio cs, Integer corridaId); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CorridaTramoService.java b/src/com/rjconsultores/ventaboletos/service/CorridaTramoService.java new file mode 100644 index 000000000..fa5de7e5d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CorridaTramoService.java @@ -0,0 +1,10 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; + +public interface CorridaTramoService extends GenericService { + + public List obtenerTramoTarjetaEmitida(); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CortesiaBeneficiarioService.java b/src/com/rjconsultores/ventaboletos/service/CortesiaBeneficiarioService.java new file mode 100644 index 000000000..980554421 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CortesiaBeneficiarioService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; + +/** + * + * @author Shiro + */ +public interface CortesiaBeneficiarioService extends GenericService{ + + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CortesiaDireccionService.java b/src/com/rjconsultores/ventaboletos/service/CortesiaDireccionService.java new file mode 100644 index 000000000..28c1f9a74 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CortesiaDireccionService.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.util.Date; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CortesiaDireccionService extends GenericService { + + public List pesquisar(Marca marca, ClaseServicio claseServicio, Date fecInicio, Date fecFinal); + + public List buscar(CortesiaDireccion cortesiaDireccion); + + public List buscarFolio(CortesiaDireccion cortesiaDireccion); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CortesiaService.java b/src/com/rjconsultores/ventaboletos/service/CortesiaService.java new file mode 100644 index 000000000..9da186c6f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CortesiaService.java @@ -0,0 +1,28 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CortesiaService extends GenericService { + + public List pesquisar(String empleadoClave); + + public Cortesia buscar(Integer cortesiaId); + + public List buscarDplicidad(Cortesia cortesia); + + /** + * Indica se la cortesia ya fue utilizada + * @param cortesia + * @return + */ + public boolean cortesiaUtilizada(Cortesia cortesia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/CuponConvenioService.java b/src/com/rjconsultores/ventaboletos/service/CuponConvenioService.java new file mode 100644 index 000000000..171cdc6f2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CuponConvenioService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface CuponConvenioService extends GenericService{ + + public List pesquisar(TipoConvenio tipoConvenio); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/CuponSecretariaService.java b/src/com/rjconsultores/ventaboletos/service/CuponSecretariaService.java new file mode 100644 index 000000000..55f1f8f6b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/CuponSecretariaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; + +/** + * + * @author Administrador + */ +public interface CuponSecretariaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/DepositoBancarioService.java b/src/com/rjconsultores/ventaboletos/service/DepositoBancarioService.java new file mode 100644 index 000000000..41c544abb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/DepositoBancarioService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.DepositoBancario; + +/** + * + * @author Rafius + */ +public interface DepositoBancarioService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/DetDiagramaAutobusService.java b/src/com/rjconsultores/ventaboletos/service/DetDiagramaAutobusService.java new file mode 100644 index 000000000..f83703675 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/DetDiagramaAutobusService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; + +/** + * + * @author Administrador + */ +public interface DetDiagramaAutobusService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/DiagramaAutobusService.java b/src/com/rjconsultores/ventaboletos/service/DiagramaAutobusService.java new file mode 100644 index 000000000..feda5f371 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/DiagramaAutobusService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface DiagramaAutobusService extends GenericService { + + public List buscar(String descDiagrama, Short maxparados, + Short cantasientos); + + public List buscar(String descDiagrama); +} diff --git a/src/com/rjconsultores/ventaboletos/service/DivisionService.java b/src/com/rjconsultores/ventaboletos/service/DivisionService.java new file mode 100644 index 000000000..2d9c9da8f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/DivisionService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Division; + +public interface DivisionService extends GenericService{ + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/EmpleadoService.java b/src/com/rjconsultores/ventaboletos/service/EmpleadoService.java new file mode 100644 index 000000000..678cbab80 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EmpleadoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface EmpleadoService extends GenericService { + + public List pesquisaClave(String empleadoClave); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EmpresaEquivalenciaService.java b/src/com/rjconsultores/ventaboletos/service/EmpresaEquivalenciaService.java new file mode 100644 index 000000000..37e9625ac --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EmpresaEquivalenciaService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface EmpresaEquivalenciaService extends GenericService { + + public List buscar(Empresa parada, ComisionistaExterno comisionistaExterno); + + public List buscarEquivalencia(EmpresaEquivalencia empresaEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EmpresaService.java b/src/com/rjconsultores/ventaboletos/service/EmpresaService.java new file mode 100644 index 000000000..44904c1a3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EmpresaService.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface EmpresaService extends GenericService { + + public List buscar(String nombempresa, Boolean indExterna, Short indTipo); + + public List buscarTodosExceto(Integer... idEmpresa); + + public List obtenerIndExternoFalse(); + + public List obtenerIndTipo1(); + + public List obtenerIndTipo2(); + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java b/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java new file mode 100644 index 000000000..f7d6e6689 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaAsientoService extends GenericService { + + public List obtenerPorCorrida(EsquemaCorrida esquemaCorrida); + + public EsquemaAsiento obtenerPorCorridaeAsiento(EsquemaCorrida esquemaCorrida, String asiento); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EsquemaCorridaService.java b/src/com/rjconsultores/ventaboletos/service/EsquemaCorridaService.java new file mode 100644 index 000000000..8a8f0acc5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EsquemaCorridaService.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ParadaEsquema; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; + +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaCorridaService extends GenericService { + + public List buscarPorEsquemaOperacional(EsquemaOperacional eo); + + public List buscar(Marca marca, RolOperativo rolOperativo, + Ruta ruta, ClaseServicio claseServicio); + + public List buscar(EsquemaCorrida ec); + + public void actualizaEsquemaTramo(List listParadaEsquema,EsquemaCorrida ec); + + public List buscaDentroVigencia(Date dataGeracao); + + public boolean buscarEsquemaCorridaExisteTramo(Tramo tramo); + + /** + * See {@link EsquemaCorridaDAO#existe(Ruta, Integer)} + * @param ruta + * @param paradaId + * @return + */ + public List existe(Ruta ruta, Integer paradaId) ; +} diff --git a/src/com/rjconsultores/ventaboletos/service/EsquemaOperacionalService.java b/src/com/rjconsultores/ventaboletos/service/EsquemaOperacionalService.java new file mode 100644 index 000000000..77489d02b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EsquemaOperacionalService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaOperacionalService + extends GenericService { + + public List dentroVigenciaEsquemaOperacional(Date dataGeracao); + + public List dentroVigenciaEsquemaOperacional(Date dataDe, Date dataAte); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EsquemaTramoService.java b/src/com/rjconsultores/ventaboletos/service/EsquemaTramoService.java new file mode 100644 index 000000000..25d346a8d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EsquemaTramoService.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface EsquemaTramoService extends GenericService { + + public List obtenerPorEsquemaCorrida(EsquemaCorrida ec); + + public List obtenerPorEsquemaCorridaOrderNumSec(EsquemaCorrida ec); + + public List obtenerAtivosDesativosPorEsquemaCorrida(EsquemaCorrida esquemaCorrida); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EstacionService.java b/src/com/rjconsultores/ventaboletos/service/EstacionService.java new file mode 100644 index 000000000..67762aa2f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EstacionService.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +/** + * + * @author Administrador + */ +public interface EstacionService { + + public List obtenerTodos(); + + public Estacion obtenerID(Integer id); + + /** + * Suscribe/Actualiza la entidad informada. + * + * @param entidad + * @return + * @throws BusinessException - Cuando la estacion es duplicada + */ + public Estacion suscribirActualizar(Estacion entidad) throws BusinessException; + + public void borrar(Estacion entidad); + + public List buscar(String descEstacion, String descMac, Long nunCaja, PuntoVenta pv); + + public List buscar(String descMac); + + public Long getDecimalMAC(String mac); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EstadoService.java b/src/com/rjconsultores/ventaboletos/service/EstadoService.java new file mode 100644 index 000000000..81665effd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EstadoService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; + +/** + * + * @author MCosso + */ +public interface EstadoService extends GenericService { + + public List buscar(String nombestado, Pais pais); +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/EventoExtraService.java b/src/com/rjconsultores/ventaboletos/service/EventoExtraService.java new file mode 100644 index 000000000..fa34f608d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EventoExtraService.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.EventoExtra; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +public interface EventoExtraService extends + GenericService { + + public List obtenerPorTipo(TipoEventoExtra tipoEventoExtra); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/ExcepcionRedondoService.java b/src/com/rjconsultores/ventaboletos/service/ExcepcionRedondoService.java new file mode 100644 index 000000000..de2a15542 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ExcepcionRedondoService.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ExcepcionRedondoService{ + + public List obtenerTodos(); + + public ExcepcionRedondo obtenerID(Integer id); + + /** + * Suscribe o actualiza la exception + * @param entidad + * @return + * @throws BusinessException - Si genera una exception si hay un error de validación + */ + public ExcepcionRedondo suscribirActualizar(ExcepcionRedondo entidad) throws BusinessException; + + public void borrar(ExcepcionRedondo entidad); + + public List buscar(String indTipo, Parada origem, Parada destino); +} diff --git a/src/com/rjconsultores/ventaboletos/service/FormaPagoDetService.java b/src/com/rjconsultores/ventaboletos/service/FormaPagoDetService.java new file mode 100644 index 000000000..ba5fcfad8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/FormaPagoDetService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; + +/** + * + * @author Administrador + */ +public interface FormaPagoDetService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java b/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java new file mode 100644 index 000000000..7370f8790 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface FormaPagoService extends GenericService { + + public List buscarPorDescricao(String descpago); + + + /** + * Hace las búsqueda de todas las formas de pagos, excepto las formas de pagos especiales. + * La formar de pago especiales son definidas de forma fija. No hay un campo que identifique eso. + * @return + */ + public List buscarFormasPagoExceptoEspeciales(); +} diff --git a/src/com/rjconsultores/ventaboletos/service/FuncionSistemaService.java b/src/com/rjconsultores/ventaboletos/service/FuncionSistemaService.java new file mode 100644 index 000000000..b689ada6d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/FuncionSistemaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; + +/** + * + * @author rodrigo + */ +public interface FuncionSistemaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/GenericService.java b/src/com/rjconsultores/ventaboletos/service/GenericService.java new file mode 100644 index 000000000..400236974 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GenericService.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +/** + * + * @author Administrador + */ +public interface GenericService { + + public List obtenerTodos(); + + public T obtenerID(ID id); + + public T suscribir(T entidad); + + public T actualizacion(T entidad); + + public void borrar(T entidad); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GenericServiceInforme.java b/src/com/rjconsultores/ventaboletos/service/GenericServiceInforme.java new file mode 100644 index 000000000..e6dfa249c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GenericServiceInforme.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.io.InputStream; +import java.util.Map; + +import org.zkoss.util.media.AMedia; + +import com.rjconsultores.ventaboletos.exception.BusinessException; + + +/** + * + * @author Administrador + */ +public interface GenericServiceInforme { + + public AMedia gerarInforme(InputStream informe, Map parameters) throws BusinessException; +} diff --git a/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java b/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java new file mode 100644 index 000000000..4747d06a9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface GrupoCortesiasService extends GenericService { + + public List buscar(String descgrupo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/InformeCategoriaVentaService.java b/src/com/rjconsultores/ventaboletos/service/InformeCategoriaVentaService.java new file mode 100644 index 000000000..b15cc88aa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/InformeCategoriaVentaService.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +/** + * + * @author Administrador + */ +public interface InformeCategoriaVentaService extends GenericServiceInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/service/InformePasajeroServicioService.java b/src/com/rjconsultores/ventaboletos/service/InformePasajeroServicioService.java new file mode 100644 index 000000000..9016f83d9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/InformePasajeroServicioService.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +/** + * + * @author Administrador + */ +public interface InformePasajeroServicioService extends GenericServiceInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/service/InformeServicioDiarioService.java b/src/com/rjconsultores/ventaboletos/service/InformeServicioDiarioService.java new file mode 100644 index 000000000..17b90d65c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/InformeServicioDiarioService.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +/** + * + * @author Administrador + */ +public interface InformeServicioDiarioService extends GenericServiceInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/service/InformeVentasPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/InformeVentasPuntoVentaService.java new file mode 100644 index 000000000..117d64ca4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/InformeVentasPuntoVentaService.java @@ -0,0 +1,12 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +/** + * + * @author Administrador + */ +public interface InformeVentasPuntoVentaService extends GenericServiceInforme { +} diff --git a/src/com/rjconsultores/ventaboletos/service/MarcaClaseServicioService.java b/src/com/rjconsultores/ventaboletos/service/MarcaClaseServicioService.java new file mode 100644 index 000000000..a510f2003 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MarcaClaseServicioService.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicioPK; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MarcaClaseServicioService + extends GenericService { + + public List buscar(ClaseServicio clase); + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/MarcaService.java b/src/com/rjconsultores/ventaboletos/service/MarcaService.java new file mode 100644 index 000000000..b2f58ea80 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MarcaService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MarcaService extends GenericService { + + public List buscarPorNome(String nomeMarca); + + public List buscarTodosExceto(Integer ... idMarca); + + public List buscarDescricaoIdMarca(); +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/MercadoCompetidoService.java b/src/com/rjconsultores/ventaboletos/service/MercadoCompetidoService.java new file mode 100644 index 000000000..112c5df8d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MercadoCompetidoService.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface MercadoCompetidoService extends GenericService { + + public boolean existe(ClaseServicio claseServicio, + Parada origem, Parada destino); + + public List buscar(Parada origem, Parada destino); +} diff --git a/src/com/rjconsultores/ventaboletos/service/MerchantBancarioService.java b/src/com/rjconsultores/ventaboletos/service/MerchantBancarioService.java new file mode 100644 index 000000000..5b87810f6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MerchantBancarioService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; + +/** + * + * @author Rafius + */ +public interface MerchantBancarioService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/MonedaService.java b/src/com/rjconsultores/ventaboletos/service/MonedaService.java new file mode 100644 index 000000000..d917e5da7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MonedaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MonedaService extends GenericService { + + public List buscar(String descmoneda); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/MotivoCancelacionService.java b/src/com/rjconsultores/ventaboletos/service/MotivoCancelacionService.java new file mode 100644 index 000000000..b9d0679da --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MotivoCancelacionService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MotivoCancelacionService extends GenericService { + + public List buscar(String descmotivo, String tipomotivo); + + public List obtenerTodosTipoMotivoB(); + + public List obtenerTodosEspecificos(Integer[] motivos); +} diff --git a/src/com/rjconsultores/ventaboletos/service/MotivoReimpresionService.java b/src/com/rjconsultores/ventaboletos/service/MotivoReimpresionService.java new file mode 100644 index 000000000..0a9f2deb0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MotivoReimpresionService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface MotivoReimpresionService extends GenericService { + + public List buscar(String descmotivo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/MotivoViajeService.java b/src/com/rjconsultores/ventaboletos/service/MotivoViajeService.java new file mode 100644 index 000000000..5fae57531 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MotivoViajeService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; + +/** + * + * @author Shiro + */ +public interface MotivoViajeService extends GenericService { + +} diff --git a/src/com/rjconsultores/ventaboletos/service/MotivocancelacionEquivalenciaService.java b/src/com/rjconsultores/ventaboletos/service/MotivocancelacionEquivalenciaService.java new file mode 100644 index 000000000..b6f9cc932 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/MotivocancelacionEquivalenciaService.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface MotivocancelacionEquivalenciaService + extends GenericService { + + public List buscar(ComisionistaExterno comisionistaExterno, + MotivoCancelacion motivoCancelacion); + + public List buscarEquivalencia(MotivocancelacionEquivalencia motivoCancelacionEquivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/NodoService.java b/src/com/rjconsultores/ventaboletos/service/NodoService.java new file mode 100644 index 000000000..de633d9ed --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/NodoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Nodo; + +/** + * + * @author Administrador + */ +public interface NodoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/PaisService.java b/src/com/rjconsultores/ventaboletos/service/PaisService.java new file mode 100644 index 000000000..e1a25c29d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PaisService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pais; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PaisService extends GenericService { + + public List buscar(String nombpais); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParadaEquivalenciaService.java b/src/com/rjconsultores/ventaboletos/service/ParadaEquivalenciaService.java new file mode 100644 index 000000000..3faddb60a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParadaEquivalenciaService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ParadaEquivalenciaService extends GenericService { + + public List buscar(Parada parada, ComisionistaExterno comisionistaExterno, String equivalencia); + + public List buscarEquivalencia(String equivalencia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParadaService.java b/src/com/rjconsultores/ventaboletos/service/ParadaService.java new file mode 100644 index 000000000..044315f82 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParadaService.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ParadaService extends GenericService { + + public List buscar(String descparada, String cveparada, Ciudad ciudad, + TipoParada tipoParada, Nodo nodo); + + public List buscarCVE(String cveparada); + + public List buscar(String descparada); + + public List buscaLike(String descparada); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamAcumulaMasivoService.java b/src/com/rjconsultores/ventaboletos/service/ParamAcumulaMasivoService.java new file mode 100644 index 000000000..aa8707207 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamAcumulaMasivoService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamAcumulaMasivoService extends GenericService { + + public List buscar(Empresa emp, Integer min, Integer max, Date fecIni, Date fecFim); + + public List buscar(ParamAcumulaMasivo paramAcumulaMasivo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamAcumulaPuntoService.java b/src/com/rjconsultores/ventaboletos/service/ParamAcumulaPuntoService.java new file mode 100644 index 000000000..15c940a51 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamAcumulaPuntoService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamAcumulaPuntoService extends GenericService { + + public List buscar(Parada origem, Parada destino, Date ini, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamArticuloService.java b/src/com/rjconsultores/ventaboletos/service/ParamArticuloService.java new file mode 100644 index 000000000..9eb141bc3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamArticuloService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ParamArticulo; + +public interface ParamArticuloService extends + GenericService { + +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamCanjePuntoService.java b/src/com/rjconsultores/ventaboletos/service/ParamCanjePuntoService.java new file mode 100644 index 000000000..ceb96f63b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamCanjePuntoService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCanjePuntoService extends GenericService { + + public List buscar(Parada origem, Parada destino, Date ini, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamCompraPuntoService.java b/src/com/rjconsultores/ventaboletos/service/ParamCompraPuntoService.java new file mode 100644 index 000000000..60de1ac96 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamCompraPuntoService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCompraPuntoService extends GenericService { + + public List buscar(Date ini, Date fim); + + public List buscar(Date ini, Date fim, Integer cantPuntos, BigDecimal costoPunto); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamCostoTarjetaService.java b/src/com/rjconsultores/ventaboletos/service/ParamCostoTarjetaService.java new file mode 100644 index 000000000..89e7ef132 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamCostoTarjetaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ParamCostoTarjetaService extends GenericService { + + public List buscar(ParamCostoTarjeta paramCostoTarjeta); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ParamRecoleccionService.java b/src/com/rjconsultores/ventaboletos/service/ParamRecoleccionService.java new file mode 100644 index 000000000..22db5dfe9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ParamRecoleccionService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; + +/** + * + * @author Desenvolvimento + */ +public interface ParamRecoleccionService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/PerfilFuncionService.java b/src/com/rjconsultores/ventaboletos/service/PerfilFuncionService.java new file mode 100644 index 000000000..efc691bb9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PerfilFuncionService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; + +/** + * + * @author rodrigo + */ +public interface PerfilFuncionService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/PerfilService.java b/src/com/rjconsultores/ventaboletos/service/PerfilService.java new file mode 100644 index 000000000..eadba8485 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PerfilService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface PerfilService extends GenericService { + + public List buscar(String dscPerfil); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PeriodoVacacionalService.java b/src/com/rjconsultores/ventaboletos/service/PeriodoVacacionalService.java new file mode 100644 index 000000000..af0481d58 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PeriodoVacacionalService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PeriodoVacacionalService extends GenericService { + + public List buscar(Date dataInicio, Date dataFim); + + public List buscarFechaTraslapa(PeriodoVacacional periodoVacacional); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PlazaService.java b/src/com/rjconsultores/ventaboletos/service/PlazaService.java new file mode 100644 index 000000000..4f72de132 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PlazaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface PlazaService extends GenericService { + + public List buscar(String nombplaza); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingAnticipacionService.java b/src/com/rjconsultores/ventaboletos/service/PricingAnticipacionService.java new file mode 100644 index 000000000..dafd39b19 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingAnticipacionService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface PricingAnticipacionService extends GenericService { + + public List obtenerPorPricing(Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java new file mode 100644 index 000000000..9d4a456ab --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingAsientoService extends GenericService { + + public List obtenerPricingCategoria(Pricing pricing, Integer value); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java new file mode 100644 index 000000000..f30eecc96 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; + +/** + * + * @author Rafius + */ +public interface PricingCategoriaService extends GenericService { + + public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java b/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java new file mode 100644 index 000000000..b905a66ad --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingClase; + +/** + * + * @author Rafius + */ +public interface PricingClaseService extends GenericService { + + public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java b/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java new file mode 100644 index 000000000..9140371bf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; + +/** + * + * @author Rafius + */ +public interface PricingCorridaService extends GenericService { + + public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java b/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java new file mode 100644 index 000000000..0db7c052b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingDiaService extends GenericService { + + public List buscarTraslapa(PricingDia pricingDia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingEspecificoService.java b/src/com/rjconsultores/ventaboletos/service/PricingEspecificoService.java new file mode 100644 index 000000000..b32edfc99 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingEspecificoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingEspecificoService extends GenericService { + + public List buscarPorNome(PricingEspecifico pricingEspecifico); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingImporteService.java b/src/com/rjconsultores/ventaboletos/service/PricingImporteService.java new file mode 100644 index 000000000..a675f621c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingImporteService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingImporteService extends GenericService { + + public List buscarMoneda(PricingImporte pricingImporte, Moneda moneda); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java b/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java new file mode 100644 index 000000000..e5e5b6545 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; + +/** + * + * @author Rafius + */ +public interface PricingMarcaService extends GenericService { + + public Boolean obtenerPricingMarca(Pricing pricing, Marca marca); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java b/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java new file mode 100644 index 000000000..9a6051f81 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; + +/** + * + * @author Rafius + */ +public interface PricingMercadoService extends GenericService { + + public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingOcupacionService.java b/src/com/rjconsultores/ventaboletos/service/PricingOcupacionService.java new file mode 100644 index 000000000..33a8b38e0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingOcupacionService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingOcupacionService extends GenericService { + + public Boolean podeSalvar(Pricing pricing, BigDecimal min, BigDecimal max); + + public List obtenerPorPricing(Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java new file mode 100644 index 000000000..21692527d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +/** + * + * @author Rafius + */ +public interface PricingPuntoVentaService extends GenericService { + + public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java b/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java new file mode 100644 index 000000000..22dc6ff16 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +/** + * + * @author Rafius + */ +public interface PricingRutaService extends GenericService { + + public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingService.java b/src/com/rjconsultores/ventaboletos/service/PricingService.java new file mode 100644 index 000000000..d14d038b6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingService.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingService extends GenericService { + + public void borrarFisico(Pricing pricing); + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo); + + public List buscarPorNombre(String nombPricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java b/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java new file mode 100644 index 000000000..3539b593e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; + +/** + * + * @author Rafius + */ +public interface PricingTipoPtoVtaService extends GenericService { + + public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java b/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java new file mode 100644 index 000000000..ef8618860 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; + +/** + * + * @author Desenvolvimento + */ +public interface PricingTipoServicioService extends GenericService { + + public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java b/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java new file mode 100644 index 000000000..f280ec2ee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface PricingVigenciaService extends GenericService { + + public List buscarPorVigencias(PricingVigencia pv); + + public Boolean podeSalvar(Pricing pricing, PricingVigencia pricingVigencia, + Date inicio, Date fim); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdClaseServicioService.java b/src/com/rjconsultores/ventaboletos/service/ProdClaseServicioService.java new file mode 100644 index 000000000..56d03df84 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdClaseServicioService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; + +/** + * + * @author Rafius + */ +public interface ProdClaseServicioService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdFormaPagoService.java b/src/com/rjconsultores/ventaboletos/service/ProdFormaPagoService.java new file mode 100644 index 000000000..4db91a45f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdFormaPagoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; + +/** + * + * @author Rafius + */ +public interface ProdFormaPagoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdMarcaService.java b/src/com/rjconsultores/ventaboletos/service/ProdMarcaService.java new file mode 100644 index 000000000..1f7f176ef --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdMarcaService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ProdMarcaService extends GenericService { + + public ProdMarca actualizacion(ProdMarca entidad,List listPrecios); + public ProdMarca suscribir(ProdMarca entidad,List listPrecios); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdMercadoService.java b/src/com/rjconsultores/ventaboletos/service/ProdMercadoService.java new file mode 100644 index 000000000..39bc9024c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdMercadoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdMercado; + +/** + * + * @author Rafius + */ +public interface ProdMercadoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdPrecioService.java b/src/com/rjconsultores/ventaboletos/service/ProdPrecioService.java new file mode 100644 index 000000000..b3c7b12c6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdPrecioService.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ProdPrecioService extends GenericService { + + /** + * Hace una busqueda en los prodPrecio que estan ativos y con los filtros indicados + * @param marca + * @param productoservicio + * @return + */ + public List buscar(Marca marca, ProductoServicio productoservicio); + + public void borrar(Marca marca); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/ProdPuntoVentaService.java new file mode 100644 index 000000000..d3652cd6a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdPuntoVentaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; + +/** + * + * @author Rafius + */ +public interface ProdPuntoVentaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdRutaService.java b/src/com/rjconsultores/ventaboletos/service/ProdRutaService.java new file mode 100644 index 000000000..a3fa379e0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdRutaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdRuta; + +/** + * + * @author Rafius + */ +public interface ProdRutaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdTipoptovtaService.java b/src/com/rjconsultores/ventaboletos/service/ProdTipoptovtaService.java new file mode 100644 index 000000000..cd130e42b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdTipoptovtaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; + +/** + * + * @author Rafius + */ +public interface ProdTipoptovtaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProdVigenciaService.java b/src/com/rjconsultores/ventaboletos/service/ProdVigenciaService.java new file mode 100644 index 000000000..d82572df6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProdVigenciaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ProdVigenciaService extends GenericService { + + public List buscarTraslapa(ProdVigencia prodVigencia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ProductoServicioService.java b/src/com/rjconsultores/ventaboletos/service/ProductoServicioService.java new file mode 100644 index 000000000..5f41a0649 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ProductoServicioService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface ProductoServicioService extends GenericService { + + public void borrarFisico(ProductoServicio productoServicio); + + public List obtener(ProductoServicio ps); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PtoVtaUsuarioBancarioService.java b/src/com/rjconsultores/ventaboletos/service/PtoVtaUsuarioBancarioService.java new file mode 100644 index 000000000..9ddfbc912 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PtoVtaUsuarioBancarioService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; + +/** + * + * @author Desenvolvimento + */ +public interface PtoVtaUsuarioBancarioService extends GenericService { + + public void borrarFisico(PtoVtaUsuarioBancario pto2); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PtovtaEmpresaService.java b/src/com/rjconsultores/ventaboletos/service/PtovtaEmpresaService.java new file mode 100644 index 000000000..f43857c89 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PtovtaEmpresaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface PtovtaEmpresaService extends GenericService { + + public List buscar(PtovtaEmpresa ptovtaEmpresa); + + public void borrarFisico(PtovtaEmpresa pto); +} diff --git a/src/com/rjconsultores/ventaboletos/service/PuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/PuntoVentaService.java new file mode 100644 index 000000000..77f23773d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PuntoVentaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface PuntoVentaService extends GenericService { + + public List buscaLike(String strEstacion); + + public List buscar(PuntoVenta puntoVenta); +} diff --git a/src/com/rjconsultores/ventaboletos/service/RedondeoCtrlService.java b/src/com/rjconsultores/ventaboletos/service/RedondeoCtrlService.java new file mode 100644 index 000000000..ccbb24269 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RedondeoCtrlService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoCtrlService extends GenericService { + + public List buscar(RedondeoCtrl redondeoCtrl); + + public List buscarTraslapa(Short[] iDMarcas, BigDecimal valorinicial, BigDecimal valorfinal, Boolean indaplicadescuento, Boolean indaplicapricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/RedondeoMarcaService.java b/src/com/rjconsultores/ventaboletos/service/RedondeoMarcaService.java new file mode 100644 index 000000000..d51a037a3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RedondeoMarcaService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoMarcaService extends GenericService { + + public List buscar(Marca marca); + + public List obtenerTodasMarcas(Short[] iDMarcas); +} diff --git a/src/com/rjconsultores/ventaboletos/service/RedondeoService.java b/src/com/rjconsultores/ventaboletos/service/RedondeoService.java new file mode 100644 index 000000000..fe24eeebb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RedondeoService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface RedondeoService extends GenericService { + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal, + BigDecimal valorRedondeo); + + public List buscarVlrIniVlrFin(BigDecimal valorinicial, BigDecimal valorfinal); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionCategoriaService.java new file mode 100644 index 000000000..b0ca3150d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionCategoriaService.java @@ -0,0 +1,15 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; + +/** + * + * @author Administrador + */ +public interface ReservacionCategoriaService + extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionClaseService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionClaseService.java new file mode 100644 index 000000000..e2706a5c3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionClaseService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; + +/** + * + * @author Administrador + */ +public interface ReservacionClaseService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionCtrlService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionCtrlService.java new file mode 100644 index 000000000..0afb7d90c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionCtrlService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ReservacionCtrlService extends GenericService { + + public List buscar(ReservacionCtrl reservacionCtrl); + + public List buscarFechaTraslapa(ReservacionCtrl reservacionCtrl); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionMarcaService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionMarcaService.java new file mode 100644 index 000000000..d9b71dbe1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionMarcaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; + +/** + * + * @author Administrador + */ +public interface ReservacionMarcaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionMercadoService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionMercadoService.java new file mode 100644 index 000000000..435364b4c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionMercadoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; + +/** + * + * @author Administrador + */ +public interface ReservacionMercadoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/ReservacionPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/ReservacionPuntoVentaService.java new file mode 100644 index 000000000..687502d38 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ReservacionPuntoVentaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; + +/** + * + * @author Rafius + */ +public interface ReservacionPuntoVentaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/RestriccionPagoService.java b/src/com/rjconsultores/ventaboletos/service/RestriccionPagoService.java new file mode 100644 index 000000000..0c598ba11 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RestriccionPagoService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; + +/** + * + * @author Administrador + */ +public interface RestriccionPagoService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/RhPagoConductorService.java b/src/com/rjconsultores/ventaboletos/service/RhPagoConductorService.java new file mode 100644 index 000000000..b0b0d377c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RhPagoConductorService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.RhPagoConductor; + +/** + * + * @author Desenvolvimento + */ +public interface RhPagoConductorService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/RolOperativoService.java b/src/com/rjconsultores/ventaboletos/service/RolOperativoService.java new file mode 100644 index 000000000..f71cdee51 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RolOperativoService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RolOperativoService extends GenericService { + + public List pesquisar(DiagramaAutobus diagrama,String rol); + + public List buscar(String descroloperativo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/RutaCombinacionService.java b/src/com/rjconsultores/ventaboletos/service/RutaCombinacionService.java new file mode 100644 index 000000000..431c79aa5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RutaCombinacionService.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaCombinacionService extends GenericService { + + public void ativar(RutaCombinacion rcExiste); + + public boolean busquedaRutaTramo(Ruta ruta, Tramo trBuscaOrigemDestino, Boolean b); + + public RutaCombinacion busquedaTramoRutaTramo(Ruta ruta, Tramo trBuscaOrigemDestino); + + public RutaCombinacion busquedaTramoRutaOrigemDestino(Ruta ruta, Parada origem, Parada destino); + + /** + * Regreso el tramo de la entidade RutaCobinacion donde el tramo tines el origen-destino igual y la Rua sea la misma de RutaCombinacion + * + * @param ruta + * @param origen + * @param destino + * @return + */ + public Tramo busqueda(Ruta ruta, Parada origen, Parada destino); + + public List obtenerPorRuta(Ruta ruta); + + public boolean buscarRutaCombinacionExisteTramo(Tramo tramo); + public int borrarCombinaciones(Ruta ruta); + public void activar(Ruta ruta, Tramo trBuscaOrigemDestino); +} diff --git a/src/com/rjconsultores/ventaboletos/service/RutaEmpresaService.java b/src/com/rjconsultores/ventaboletos/service/RutaEmpresaService.java new file mode 100644 index 000000000..6bcc32ed5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RutaEmpresaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; + +/** + * + * @author Administrador + */ +public interface RutaEmpresaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/RutaSecuenciaService.java b/src/com/rjconsultores/ventaboletos/service/RutaSecuenciaService.java new file mode 100644 index 000000000..ee87da0ff --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RutaSecuenciaService.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaSecuenciaService extends GenericService { + + public List buscarSecuenciaOrdenado(Ruta ruta); + + public int borrarSecuencias(Ruta ruta); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/RutaService.java b/src/com/rjconsultores/ventaboletos/service/RutaService.java new file mode 100644 index 000000000..c12d0bcfa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/RutaService.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface RutaService{ + + /** + * Regresa el destino de la ruta + * + * @param ruta + * @return + */ + public Parada getDestino(Ruta ruta); + + /** + * Regresa la origen de la ruta + * + * @param ruta + * @return + */ + public Parada getOrigem(Ruta ruta); + + public List buscarPorRutaPorEmpresa(Ruta ruta, Empresa empresa); + + public List buscarPorClaseServicio(ClaseServicio claseServicio); + + public List buscar(String nomeRuta, ClaseServicio claseServicio, Boolean nomeObrigatorio); + + public List obtenerPorEmpresa(Empresa empresa); + + public List buscarTodosExceto(Integer... idRuta); + + public void borrar(Ruta entidad) throws RegistroConDependenciaException; + + /** + * Verifica se la parada informadad existe en la ruta informada + * + * @param parada + * @param ruta + * @return + */ + public boolean paradaExisteEnLaRuta(Parada parada, Ruta ruta); + + /** + * Hace la actualización de la ruta. + * + * Si el parametro lsParadasSequencia, quieres decir que hube cambio en la secuencia y la nueva secuencia es la que esta en lsParadasSequencia. + * + * Si el parametro lsParadasSequencia es null, no va a cambiar ni la secuencia ni las combinaciones + * @param ruta + * @param lsParadasSequencia + * @return + * @throws BusinessException + */ + public Ruta actualizacion(Ruta ruta, List lsParadasSequencia) throws BusinessException; + + public List obtenerTodos(); + + public Ruta obtenerID(Integer id); + + public Ruta suscribir(Ruta entidad, List lsParadasSequencia) throws BusinessException; + + public void generarCombinacion(Ruta ruta) throws BusinessException ; +} diff --git a/src/com/rjconsultores/ventaboletos/service/SecretariaService.java b/src/com/rjconsultores/ventaboletos/service/SecretariaService.java new file mode 100644 index 000000000..bc39156ef --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/SecretariaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface SecretariaService extends GenericService { + + public List buscar(String descsecretaria, String cvesecretaria); + + public List buscar(String descsecretaria); +} diff --git a/src/com/rjconsultores/ventaboletos/service/SistemaService.java b/src/com/rjconsultores/ventaboletos/service/SistemaService.java new file mode 100644 index 000000000..14f1fa372 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/SistemaService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Sistema; + +/** + * + * @author rodrigo + */ +public interface SistemaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarifaCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/TarifaCategoriaService.java new file mode 100644 index 000000000..94f2f2350 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarifaCategoriaService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaCategoriaService extends GenericService { + + public List buscar(Categoria categoria); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarifaHistService.java b/src/com/rjconsultores/ventaboletos/service/TarifaHistService.java new file mode 100644 index 000000000..d3bae2964 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarifaHistService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TarifaHist; + +/** + * + * @author rodrigo + */ +public interface TarifaHistService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarifaMinimaService.java b/src/com/rjconsultores/ventaboletos/service/TarifaMinimaService.java new file mode 100644 index 000000000..96d8909c3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarifaMinimaService.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaMinimaService extends GenericService { + + public List pesquisarEspecifico(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Moneda moneda); + + public List pesquisar(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Moneda moneda); + + public List buscarPorPlaza(Plaza plaza); + + public List buscarPorPlazaMoneda(Plaza plaza, Moneda moneda); + + public List pesquisar(BigDecimal valor, Moneda moneda, Plaza plaza, + Marca marca, Parada origem, Parada destino, ClaseServicio claseServicio); + + public List pesquisarOrigemDestinoTodos(Marca marca,Parada origem, Parada destino,ClaseServicio claseServicio, Moneda moneda); + + public List buscarPorMarca(Marca marca, Moneda moneda); + + public List buscarPorClaseServico(ClaseServicio claseServicio, Moneda moneda); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarifaService.java b/src/com/rjconsultores/ventaboletos/service/TarifaService.java new file mode 100644 index 000000000..edc51ec42 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarifaService.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface TarifaService extends GenericService { + + public List pesquisar(Marca marca, Parada origem, Parada destino, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, + Categoria categoria, TipoPuntoVenta tipoPuntoVenta); + + public List pesquisar(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa); + + public boolean existe(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa); + + public Tarifa buscar(Tramo tramo, Marca marca, ClaseServicio claseServicio, + VigenciaTarifa vigenciaTarifa, Moneda moneda); + + public List buscarPorVigencia(VigenciaTarifa vigencia); + + public List pesquisar(List lsMoneda, List lsMarca, + List lsClaseServicio, List lsCategoria, + List lsEmpresa, List lsRuta, + List lsTipoPuntoVenta, List lsVigenciaTarifa); + + public Boolean podeAlterarTarifaMinima(Tarifa tarifa, Marca marca, Parada origem, + Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda); + + public List buscarExisteVigencia(VigenciaTarifa vigenciaTarifa); + + public Boolean generarTarifas(VigenciaTarifa vigencia, Marca marca); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarifaTipoptovtaService.java b/src/com/rjconsultores/ventaboletos/service/TarifaTipoptovtaService.java new file mode 100644 index 000000000..8d6b28213 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarifaTipoptovtaService.java @@ -0,0 +1,15 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; + +/** + * + * @author rodrigo + */ +public interface TarifaTipoptovtaService + extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarjetaFidelidadService.java b/src/com/rjconsultores/ventaboletos/service/TarjetaFidelidadService.java new file mode 100644 index 000000000..a7362d1bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarjetaFidelidadService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidadCuenta; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TarjetaFidelidadService extends GenericService{ + + public List obtenerCantDesc(); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarjetaRecaudacionService.java b/src/com/rjconsultores/ventaboletos/service/TarjetaRecaudacionService.java new file mode 100644 index 000000000..c634eb91e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarjetaRecaudacionService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacionPK; + +/** + * + * @author Administrador + */ +public interface TarjetaRecaudacionService + extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TarjetaViajeService.java b/src/com/rjconsultores/ventaboletos/service/TarjetaViajeService.java new file mode 100644 index 000000000..1e41f9c65 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TarjetaViajeService.java @@ -0,0 +1,22 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.Date; +import java.util.List; + +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; + +public interface TarjetaViajeService extends GenericService { + + public void grabarTarjetaViaje(List lsCorridaTramo); + + public void verificaCorridaDuplicada(List lsTarjetaViaje, boolean todasTarjetas); + + public List buscarTarjetaPorFiltros(Integer autoIni, Integer autoFin, Date dataIni, Date dataFin, Comboitem empresa); + + public List generarArchivoNomina(Date fecIni, Date fecFin); + + public void actulizarTarjetasEnviadas(List lsTarjetas); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoCambioCiudadService.java b/src/com/rjconsultores/ventaboletos/service/TipoCambioCiudadService.java new file mode 100644 index 000000000..eddbfe023 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoCambioCiudadService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; + +/** + * + * @author Administrador + */ +public interface TipoCambioCiudadService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoCambioCtrlService.java b/src/com/rjconsultores/ventaboletos/service/TipoCambioCtrlService.java new file mode 100644 index 000000000..9fcb5867f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoCambioCtrlService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; + +/** + * + * @author Administrador + */ +public interface TipoCambioCtrlService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoConvenioService.java b/src/com/rjconsultores/ventaboletos/service/TipoConvenioService.java new file mode 100644 index 000000000..d88521326 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoConvenioService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; + +/** + * + * @author Shiro + */ +public interface TipoConvenioService extends GenericService{ + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoCorteService.java b/src/com/rjconsultores/ventaboletos/service/TipoCorteService.java new file mode 100644 index 000000000..3afd5ddde --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoCorteService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoCorteService extends GenericService { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoCortesiaDescuentoService.java b/src/com/rjconsultores/ventaboletos/service/TipoCortesiaDescuentoService.java new file mode 100644 index 000000000..0d548a4c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoCortesiaDescuentoService.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import java.math.BigDecimal; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TipoCortesiaDescuentoService extends + GenericService { + + public List pesquisar(TipoCortesia tipoCortesia); + + public List Onchangue(TipoCortesia tp); + + public List buscar(BigDecimal porcentaje, + TipoCortesia tipoCortesia); + + public List obtenerTipoCortesia(int i); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoCortesiaService.java b/src/com/rjconsultores/ventaboletos/service/TipoCortesiaService.java new file mode 100644 index 000000000..a0fbe7acc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoCortesiaService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import java.util.List; + +/** + * + * @author Shiro + */ +public interface TipoCortesiaService extends GenericService { + + public List buscar(String descTipo); + + public List obtenerGrupoCortesia(int i); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoDomicilioService.java b/src/com/rjconsultores/ventaboletos/service/TipoDomicilioService.java new file mode 100644 index 000000000..46834d8b7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoDomicilioService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoDomicilioService extends GenericService { + + public List buscar(String desctipo, String cvetipodomicilio); + + public List buscarClave(String cvetipodomicilio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoEmpleadoService.java b/src/com/rjconsultores/ventaboletos/service/TipoEmpleadoService.java new file mode 100644 index 000000000..001dbf4df --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoEmpleadoService.java @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoEmpleado; + +/** + * + * @author Shiro + */ +public interface TipoEmpleadoService extends GenericService{ + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java b/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java new file mode 100644 index 000000000..08e4984a3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java @@ -0,0 +1,22 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +public interface TipoEventoExtraService { + + List buscar(String descingreso); + + public List obtenerTodos(); + + public TipoEventoExtra obtenerID(Integer id); + + public TipoEventoExtra suscribir(TipoEventoExtra entidad); + + public TipoEventoExtra actualizacion(TipoEventoExtra entidad); + + public void borrar(TipoEventoExtra entidad) throws BusinessException; + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoMovimientoService.java b/src/com/rjconsultores/ventaboletos/service/TipoMovimientoService.java new file mode 100644 index 000000000..b232d3238 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoMovimientoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoMovimientoService extends GenericService { + + public List buscar(String descmovimiento); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoOcupacionService.java b/src/com/rjconsultores/ventaboletos/service/TipoOcupacionService.java new file mode 100644 index 000000000..62392e7b9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoOcupacionService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoOcupacionService extends GenericService { + + public List buscar(String desctipo, String cvetipoocupacion); + + public List buscarClave(String cvetipoocupacion); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoParadaService.java b/src/com/rjconsultores/ventaboletos/service/TipoParadaService.java new file mode 100644 index 000000000..3852bf574 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoParadaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoParadaService extends GenericService { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/TipoPuntoVentaService.java new file mode 100644 index 000000000..e55d5dafa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoPuntoVentaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TipoPuntoVentaService extends GenericService { + + public List buscar(String desctipo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoServicioService.java b/src/com/rjconsultores/ventaboletos/service/TipoServicioService.java new file mode 100644 index 000000000..eea312b61 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoServicioService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TipoServicioService extends GenericService { + + public List buscar(String descservicio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoVentaService.java b/src/com/rjconsultores/ventaboletos/service/TipoVentaService.java new file mode 100644 index 000000000..1ca70ba1a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoVentaService.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TipoVentaService extends GenericService{ + + public List buscar(String desctipoventa); + + public TipoVenta obtenerID(Short tipoventaId); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TramoKmServicioService.java b/src/com/rjconsultores/ventaboletos/service/TramoKmServicioService.java new file mode 100644 index 000000000..7494b3776 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TramoKmServicioService.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import java.util.List; + +/** + * + * @author Desenvolvimento + */ +public interface TramoKmServicioService extends GenericService { + + public List buscar(TramoKmServicio tramoKmServicio); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TramoRutaService.java b/src/com/rjconsultores/ventaboletos/service/TramoRutaService.java new file mode 100644 index 000000000..ad7cce83f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TramoRutaService.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO; + + +/** + * + * @author Administrador + */ +public interface TramoRutaService { + /** + * Grava la nueva configuración de la ruta con los tramos. + * + * Si no existen los tramos, ellos son generados. + * + * + * @param rutaTramoVO + * @throws BusinessException - Si hay algun valor no valido; Si la ruta ya existe + */ + public Ruta generarTramosRutas(RutaTramoVO rutaTramoVO) throws BusinessException; + + /** + * Genera la combinacion de la ruta. + * + * @param rutaTramoVO + * @return + */ + public List generarCombinacion(RutaTramoVO rutaTramoVO); + + /** + * Renera los datos de regreso para la ruta informada + * @param rutaTramoVO + * @return + */ + public RutaTramoVO generarRutaRegreso(RutaTramoVO rutaTramoVO); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TramoService.java b/src/com/rjconsultores/ventaboletos/service/TramoService.java new file mode 100644 index 000000000..070816ad9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TramoService.java @@ -0,0 +1,56 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TramoService extends GenericService { + + public Tramo obtenerPorOrigemDestino(Parada origem, Parada destino); + + public List obtenerListPorOrigemDestino(Parada origem, Parada destino); + + public Tramo obtenerTramotPorOrigemDestinoVia(Parada origem, Parada destino, Via v); + + /** + * Hace la búsqueda del tramo que tiene origen - destino - via - clase servicio. + * + * @param origem + * @param destino + * @param via + * @param claseServicio + * @return + */ + public Tramo obtenerTramoUnicoRuta(Parada origem, Parada destino, Via via, ClaseServicio claseServicio); + + public Tramo buscar(Parada origem, Parada destino, Via via); + + /** + * Regreso los tramos con las paradas en secuencia. Ej.: Paradas A,B,C. Tramos A-B; B-C + */ + public List buscar(List lsParadas, Via via); + + public List buscarCveParada(String origen, String destino, String via); + + /** + * Grava los tramos en la lista con los km real y km del conductor en la via especificada. + * + * Se el tramo ya existie, cambia los valores, sino, graba un nuebo + * @param lsTramos + * @param via + */ + public void guardarTramosKm(List lsTramos,Via via); + + public List obtenerViasOrigemDestino(Parada origem, Parada destino); + public List obtenerPorOrigemDestinoFetchLazy(Parada origem, Parada destino) ; +} diff --git a/src/com/rjconsultores/ventaboletos/service/TramoServicioService.java b/src/com/rjconsultores/ventaboletos/service/TramoServicioService.java new file mode 100644 index 000000000..db86b650d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TramoServicioService.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface TramoServicioService extends GenericService { + + public List buscarPorTramo(Tramo tramo); + + public List buscarPorTramoServico(Tramo tramo, ClaseServicio clase); + + /** + * Hace la búsqueda del tramo servicio activo de acuerdo los parametros. + * + * @param origen + * @param destino + * @param via + * @param clase + * @return + */ + public TramoServicio buscar(Parada origen,Parada destino,Via via,ClaseServicio clase); + + /** + * Genera un nuevo registro de tramo y tramo servicio sino ya existen. + * + * Si el tramo y tramo tiempo existen, el es retornado. + * + * @param origen + * @param destino + * @param via + * @param kmsReal + * @param kmsConductor + * @param tiempoRecorrido + * @param claseServicio TODO + * @return - Si el tramo existe, return FALSE. Sino, retorna TRUE + */ + public boolean generarTramoTiempo(Parada origen,Parada destino,Via via,BigDecimal kmsReal,BigDecimal kmsConductor,Date tiempoRecorrido, ClaseServicio claseServicio); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TramoTiempoService.java b/src/com/rjconsultores/ventaboletos/service/TramoTiempoService.java new file mode 100644 index 000000000..6a0142b5f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TramoTiempoService.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; + +/** + * + * @author Administrador + */ +public interface TramoTiempoService extends GenericService { + + public List buscarPorTramo(Tramo tramo); + + public List buscarPorTramo(Tramo tramo,ClaseServicio clase); + + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TurnoService.java b/src/com/rjconsultores/ventaboletos/service/TurnoService.java new file mode 100644 index 000000000..43d37a581 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TurnoService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Turno; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface TurnoService extends GenericService { + + public List buscar(String descturno); +} diff --git a/src/com/rjconsultores/ventaboletos/service/UsuarioBancarioService.java b/src/com/rjconsultores/ventaboletos/service/UsuarioBancarioService.java new file mode 100644 index 000000000..c1e7cb9b9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/UsuarioBancarioService.java @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; + +/** + * + * @author Rafius + */ +public interface UsuarioBancarioService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/UsuarioPerfilService.java b/src/com/rjconsultores/ventaboletos/service/UsuarioPerfilService.java new file mode 100644 index 000000000..9b91a737b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/UsuarioPerfilService.java @@ -0,0 +1,20 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import java.util.List; + +/** + * + * @author Rafius + */ +public interface UsuarioPerfilService extends GenericService { + + public List obtenerPorUsuario(Usuario usuario); + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/UsuarioService.java b/src/com/rjconsultores/ventaboletos/service/UsuarioService.java new file mode 100644 index 000000000..66f36a4bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/UsuarioService.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import java.util.List; + +/** + * + * @author gleimar + */ +public interface UsuarioService extends GenericService { + + public List buscarPeloNome(String nome); + + public String encriptarSenha(String salt, String senha); + + public Usuario buscarPeloNomeSenha(String stUsuario, String senha); + + public List buscarPorEmpleado(Empleado get); + + public List buscarPelaCveUsuario(String claveUsuario); +} diff --git a/src/com/rjconsultores/ventaboletos/service/UsuarioUbicacionService.java b/src/com/rjconsultores/ventaboletos/service/UsuarioUbicacionService.java new file mode 100644 index 000000000..f70ec436c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/UsuarioUbicacionService.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface UsuarioUbicacionService extends GenericService { + + public List buscarPorUsuario(Usuario usuario); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ViaService.java b/src/com/rjconsultores/ventaboletos/service/ViaService.java new file mode 100644 index 000000000..9a73c7e8d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ViaService.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Via; +import java.util.List; + +/** + * + * @author Administrador + */ +public interface ViaService extends GenericService { + + public List buscar(String nombvia); +} diff --git a/src/com/rjconsultores/ventaboletos/service/VigenciaTarifaService.java b/src/com/rjconsultores/ventaboletos/service/VigenciaTarifaService.java new file mode 100644 index 000000000..082f32590 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/VigenciaTarifaService.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.util.Date; +import java.util.List; + +/** + * + * @author rodrigo + */ +public interface VigenciaTarifaService extends GenericService { + + public List pesquisar(Date inicio, Date fim); + + /** + * Regresa las vigencia que traslapa + * @param vigenciaTarifa + * @return + */ + public List buscarVigenciasIntervalo(VigenciaTarifa vigenciaTarifa); +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AjusteEventoExtraServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AjusteEventoExtraServiceImpl.java new file mode 100644 index 000000000..8159e3318 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AjusteEventoExtraServiceImpl.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.AjusteEventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra; +import com.rjconsultores.ventaboletos.service.AjusteEventoExtraService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("ajusteEventoExtraService") +public class AjusteEventoExtraServiceImpl implements AjusteEventoExtraService { + + @Autowired + private AjusteEventoExtraDAO ajusteEventoExtraDAO; + + public List obtenerTodos() { + return ajusteEventoExtraDAO.obtenerTodos(); + } + + public AjusteEventoExtra obtenerID(Integer id) { + return ajusteEventoExtraDAO.obtenerID(id); + } + + @Transactional + public AjusteEventoExtra suscribir(AjusteEventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ajusteEventoExtraDAO.suscribir(entidad); + } + + @Transactional + public AjusteEventoExtra actualizacion(AjusteEventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ajusteEventoExtraDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(AjusteEventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + ajusteEventoExtraDAO.actualizacion(entidad); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AlertaCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AlertaCtrlServiceImpl.java new file mode 100644 index 000000000..3e6fe8cb0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AlertaCtrlServiceImpl.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.AlertaCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.AlertaCtrlService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Administrador + */ +@Service("alertaCtrlService") +public class AlertaCtrlServiceImpl implements AlertaCtrlService { + + @Autowired + private AlertaCtrlDAO alertaCtrlDAO; + + @Autowired + private RutaService rutaService; + + public List obtenerTodos() { + return alertaCtrlDAO.obtenerTodos(); + } + + public AlertaCtrl obtenerID(Integer id) { + return alertaCtrlDAO.obtenerID(id); + } + + @Transactional(rollbackFor=BusinessException.class) + public AlertaCtrl suscribirActualizar(AlertaCtrl entidad) throws BusinessException { + if (entidad.getRuta() != null) { + if (!rutaService.paradaExisteEnLaRuta(entidad.getOrigem(), entidad.getRuta())) { + throw new BusinessException("editarAlertaCtrlController.MSG.origenNoExisteRuta"); + } + if (!rutaService.paradaExisteEnLaRuta(entidad.getDestino(), entidad.getRuta())) { + throw new BusinessException("editarAlertaCtrlController.MSG.destinoNoExisteRuta"); + } + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + if (entidad.getAlertactrlId() == null) { + return alertaCtrlDAO.suscribir(entidad); + } else { + return alertaCtrlDAO.actualizacion(entidad); + } + } + @Transactional + public void borrar(AlertaCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + alertaCtrlDAO.actualizacion(entidad); + } + + public List buscar(Parada origem, Parada destino, Ruta ruta, ClaseServicio claseServicio, Integer tiempoAlta, Integer tiempoBaja, BigDecimal percAlta, + BigDecimal percBaja) { + return alertaCtrlDAO.buscar(origem, destino, ruta, claseServicio, tiempoAlta, tiempoBaja, percAlta, percBaja); + } + + public List buscarCorrida(Corrida corrida) { + return alertaCtrlDAO.buscarCorrida(corrida); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ArticuloServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ArticuloServiceImpl.java new file mode 100644 index 000000000..8826ce63c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ArticuloServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ArticuloDAO; +import com.rjconsultores.ventaboletos.entidad.Articulo; +import com.rjconsultores.ventaboletos.service.ArticuloService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("articuloervice") +public class ArticuloServiceImpl implements ArticuloService { + + @Autowired + private ArticuloDAO articuloDAO; + + public List obtenerTodos() { + return articuloDAO.obtenerTodos(); + } + + public Articulo obtenerID(Integer id) { + return articuloDAO.obtenerID(id); + } + + @Transactional + public Articulo suscribir(Articulo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return articuloDAO.suscribir(entidad); + } + + @Transactional + public Articulo actualizacion(Articulo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return articuloDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Articulo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + articuloDAO.actualizacion(entidad); + } + + public List buscar(String descarticulo) { + return articuloDAO.buscar(descarticulo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AsientoExclusivoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AsientoExclusivoServiceImpl.java new file mode 100644 index 000000000..08fb0e71b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AsientoExclusivoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.AsientoExclusivoDAO; +import com.rjconsultores.ventaboletos.entidad.AsientoExclusivo; +import com.rjconsultores.ventaboletos.service.AsientoExclusivoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("asientoExclusivoService") +public class AsientoExclusivoServiceImpl implements AsientoExclusivoService { + + @Autowired + private AsientoExclusivoDAO asientoExclusivoDAO; + + public List obtenerTodos() { + return asientoExclusivoDAO.obtenerTodos(); + } + + public AsientoExclusivo obtenerID(Integer id) { + return asientoExclusivoDAO.obtenerID(id); + } + + @Transactional + public AsientoExclusivo suscribir(AsientoExclusivo entidad) { + Integer usuarioId = 1; + if (UsuarioLogado.getUsuarioLogado() != null){ + usuarioId = UsuarioLogado.getUsuarioLogado().getUsuarioId(); + } + entidad.setUsuarioId(usuarioId); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return asientoExclusivoDAO.suscribir(entidad); + } + + @Transactional + public AsientoExclusivo actualizacion(AsientoExclusivo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return asientoExclusivoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(AsientoExclusivo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + asientoExclusivoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AutobusServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AutobusServiceImpl.java new file mode 100644 index 000000000..d8b066fdc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AutobusServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.AutobusDAO; +import com.rjconsultores.ventaboletos.dao.DiagramaAutobusDAO; +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.AutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("autobusService") +public class AutobusServiceImpl implements AutobusService { + + @Autowired + private AutobusDAO autobusDAO; + @Autowired + private DiagramaAutobusDAO diagramaAutobusDAO; + + public List obtenerTodos() { + return autobusDAO.obtenerTodos(); + } + + public Autobus obtenerID(Integer id) { + return autobusDAO.obtenerID(id); + } + + @Transactional + public Autobus suscribir(Autobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autobusDAO.suscribir(entidad); + } + + @Transactional + public Autobus actualizacion(Autobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autobusDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Autobus entidad) { + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + autobusDAO.actualizacion(entidad); + } + + public List buscar(String numautobus, DiagramaAutobus diagramaAutobus) { + return autobusDAO.buscar(numautobus, diagramaAutobus); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionPerfilServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionPerfilServiceImpl.java new file mode 100644 index 000000000..3cf2b3431 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionPerfilServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.AutorizacionPerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.service.AutorizacionPerfilService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("autorizacionPerfilService") +public class AutorizacionPerfilServiceImpl implements AutorizacionPerfilService { + + @Autowired + private AutorizacionPerfilDAO autorizacionPerfilDAO; + + public List obtenerTodos() { + return autorizacionPerfilDAO.obtenerTodos(); + } + + public AutorizacionPerfil obtenerID(Integer id) { + return autorizacionPerfilDAO.obtenerID(id); + } + + @Transactional + public AutorizacionPerfil suscribir(AutorizacionPerfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autorizacionPerfilDAO.suscribir(entidad); + } + + @Transactional + public AutorizacionPerfil actualizacion(AutorizacionPerfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autorizacionPerfilDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(AutorizacionPerfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + autorizacionPerfilDAO.actualizacion(entidad); + } + + public List buscar(Autorizacion autorizacion, Perfil perfil) { + return autorizacionPerfilDAO.buscar(autorizacion, perfil); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionServiceImpl.java new file mode 100644 index 000000000..feed90bdb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AutorizacionServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.AutorizacionDAO; +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.service.AutorizacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("autorizacionService") +public class AutorizacionServiceImpl implements AutorizacionService { + + @Autowired + private AutorizacionDAO autorizacionDAO; + + public List obtenerTodos() { + return autorizacionDAO.obtenerTodos(); + } + + public Autorizacion obtenerID(Integer id) { + return autorizacionDAO.obtenerID(id); + } + + @Transactional + public Autorizacion suscribir(Autorizacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autorizacionDAO.suscribir(entidad); + } + + @Transactional + public Autorizacion actualizacion(Autorizacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return autorizacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Autorizacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + autorizacionDAO.actualizacion(entidad); + } + + public List buscar(String nombautorizacion, String descautorizacion) { + return autorizacionDAO.buscar(nombautorizacion, descautorizacion); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/BancoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/BancoServiceImpl.java new file mode 100644 index 000000000..cc972dd03 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/BancoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.BancoDAO; +import com.rjconsultores.ventaboletos.entidad.Banco; +import com.rjconsultores.ventaboletos.service.BancoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("bancoService") +public class BancoServiceImpl implements BancoService { + + @Autowired + private BancoDAO bancoDAO; + + public List obtenerTodos() { + return bancoDAO.obtenerTodos(); + } + + public Banco obtenerID(Integer id) { + return bancoDAO.obtenerID(id); + } + + @Transactional + public Banco suscribir(Banco entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return bancoDAO.suscribir(entidad); + } + + @Transactional + public Banco actualizacion(Banco entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return bancoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Banco entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + bancoDAO.actualizacion(entidad); + } + + public List buscar(Banco banco) { + return bancoDAO.buscar(banco); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCargoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCargoServiceImpl.java new file mode 100644 index 000000000..661c644c9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCargoServiceImpl.java @@ -0,0 +1,57 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CancelacionCargoDAO; +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; +import com.rjconsultores.ventaboletos.service.CancelacionCargoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * @author Rafius + */ +@Service("cancelacionCargoService") +public class CancelacionCargoServiceImpl implements CancelacionCargoService { + + @Autowired + private CancelacionCargoDAO cancelacionCargoDAO; + + public List obtenerTodos() { + return cancelacionCargoDAO.obtenerTodos(); + } + + public CancelacionCargo obtenerID(Integer id) { + return cancelacionCargoDAO.obtenerID(id); + } + + public CancelacionCargo suscribir(CancelacionCargo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cancelacionCargoDAO.suscribir(entidad); + } + + public CancelacionCargo actualizacion(CancelacionCargo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cancelacionCargoDAO.actualizacion(entidad); + } + + public void borrar(CancelacionCargo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cancelacionCargoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCtrlServiceImpl.java new file mode 100644 index 000000000..ebac25784 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CancelacionCtrlServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CancelacionCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.CancelacionCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("cancelacionCtrlService") +public class CancelacionCtrlServiceImpl implements CancelacionCtrlService { + + @Autowired + private CancelacionCtrlDAO cancelacionCtrlDAO; + + public List obtenerTodos() { + return cancelacionCtrlDAO.obtenerTodos(); + } + + public CancelacionCtrl obtenerID(Integer id) { + return cancelacionCtrlDAO.obtenerID(id); + } + + @Transactional + public CancelacionCtrl suscribir(CancelacionCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cancelacionCtrlDAO.suscribir(entidad); + } + + @Transactional + public CancelacionCtrl actualizacion(CancelacionCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cancelacionCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CancelacionCtrl entidad) { + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cancelacionCtrlDAO.actualizacion(entidad); + } + + public List buscar(Date tiempoprevsalida, PuntoVenta puntoVenta, Parada paradaOrigem, Parada paradaDestino, Marca marca) { + return cancelacionCtrlDAO.buscar(tiempoprevsalida,puntoVenta,paradaOrigem,paradaDestino,marca); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaClaseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaClaseServiceImpl.java new file mode 100644 index 000000000..58f8a6f8a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaClaseServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaClaseDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.service.CategoriaClaseService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaClaseService") +public class CategoriaClaseServiceImpl implements CategoriaClaseService { + + @Autowired + private CategoriaClaseDAO categoriaClaseDAO; + + public List obtenerTodos() { + return categoriaClaseDAO.obtenerTodos(); + } + + public CategoriaClase obtenerID(Integer id) { + return categoriaClaseDAO.obtenerID(id); + } + + @Transactional + public CategoriaClase suscribir(CategoriaClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaClaseDAO.suscribir(entidad); + } + + @Transactional + public CategoriaClase actualizacion(CategoriaClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaClaseDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + + categoriaClaseDAO.actualizacion(entidad); + } + + public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + return categoriaClaseDAO.busquedaPoCategoriaCtrl(categoriaCtrl); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCorridaServiceImpl.java new file mode 100644 index 000000000..d9f5e822c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCorridaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.service.CategoriaCorridaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaCorridaService") +public class CategoriaCorridaServiceImpl implements CategoriaCorridaService { + + @Autowired + private CategoriaCorridaDAO categoriaCorridaDAO; + + public List obtenerTodos() { + return categoriaCorridaDAO.obtenerTodos(); + } + + public CategoriaCorrida obtenerID(Integer id) { + return categoriaCorridaDAO.obtenerID(id); + } + + @Transactional + public CategoriaCorrida suscribir(CategoriaCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaCorridaDAO.suscribir(entidad); + } + + @Transactional + public CategoriaCorrida actualizacion(CategoriaCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaCorridaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + + categoriaCorridaDAO.actualizacion(entidad); + } + + public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + return categoriaCorridaDAO.busquedaPoCategoriaCtrl(categoriaCtrl); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java new file mode 100644 index 000000000..bf70fece4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java @@ -0,0 +1,160 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaCtrlDAO; +import com.rjconsultores.ventaboletos.dao.CategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import com.rjconsultores.ventaboletos.service.CategoriaCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaCtrlService") +public class CategoriaCtrlServiceImpl implements CategoriaCtrlService { + + public static final int CATEGORIA_ADULTO = 1; + @Autowired + private CategoriaCtrlDAO categoriaCtrlDAO; + @Autowired + private CategoriaDAO categoriaDAO; + + public List obtenerTodos() { + return categoriaCtrlDAO.obtenerTodos(); + } + + public CategoriaCtrl obtenerID(Integer id) { + return categoriaCtrlDAO.obtenerID(id); + } + + @Transactional + public CategoriaCtrl suscribir(CategoriaCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + checarCategoriaAdulto(entidad); + + return categoriaCtrlDAO.suscribir(entidad); + } + + /** + * Verifica se existe la categoria adulto. Sino existe, la adicciona. + * @param categoriaCtrl + */ + private void checarCategoriaAdulto(CategoriaCtrl categoriaCtrl) { + boolean existeAdulto = false; + List lsCategorias = new ArrayList(); + lsCategorias.addAll(categoriaCtrl.getCategoriaDescuentoList()); + + for (CategoriaDescuento cd : categoriaCtrl.getCategoriaDescuentoList()) { + if (cd.getCategoria().getCategoriaId().equals(CATEGORIA_ADULTO)) { + existeAdulto = true; + } + } + if (!existeAdulto) { + CategoriaDescuento categoriaDescuentoAdulto = this.getCategoriaDescuentoAdulto(categoriaCtrl); + lsCategorias.add(categoriaDescuentoAdulto); + } + categoriaCtrl.setCategoriaDescuentoList(lsCategorias); + } + + @Transactional + public CategoriaCtrl actualizacion(CategoriaCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaCtrl entidad) { + + for (CategoriaClase cc : entidad.getCategoriaClaseList()) { + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setActivo(Boolean.FALSE); + } + for (CategoriaCorrida cc : entidad.getCategoriaCorridaList()) { + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setActivo(Boolean.FALSE); + } + for (CategoriaDescuento cc : entidad.getCategoriaDescuentoList()) { + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setActivo(Boolean.FALSE); + } + for (CategoriaMarca cc : entidad.getCategoriaMarcaList()) { + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setActivo(Boolean.FALSE); + } + for (CategoriaMercado cc : entidad.getCategoriaMercadoList()) { + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + + categoriaCtrlDAO.actualizacion(entidad); + } + + private CategoriaDescuento getCategoriaDescuentoAdulto(CategoriaCtrl categoriaCtrl) { + CategoriaDescuento cd = new CategoriaDescuento(); + cd.setActivo(Boolean.TRUE); + cd.setCantautorizada(50); + cd.setCategoria(categoriaDAO.obtenerID(CATEGORIA_ADULTO)); + cd.setDescuentoimporte(BigDecimal.ZERO); + cd.setDescuentoporc(BigDecimal.ZERO); + + CategoriaPeriodo cp = new CategoriaPeriodo(); + cp.setActivo(Boolean.TRUE); + cp.setCategoriaDescuento(cd); + + Calendar datFin = Calendar.getInstance(); + datFin.set(2300, 11, 31); + + Calendar datInicio = Calendar.getInstance(); + datInicio.set(2000, 11, 31); + + cp.setFecfin(datFin.getTime()); + cp.setFecinicio(datInicio.getTime()); + + cp.setFecmodif(new java.util.Date()); + cp.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsCatPeriodo = new ArrayList(); + lsCatPeriodo.add(cp); + + cd.setCategoriaPeriodoList(lsCatPeriodo); + cd.setCategoriaCtrl(categoriaCtrl); + cd.setFecmodif(new java.util.Date()); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + + return cd; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaDescuentoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaDescuentoServiceImpl.java new file mode 100644 index 000000000..2fba5f7f1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaDescuentoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaDescuentoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.service.CategoriaDescuentoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaDescuentoService") +public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService { + + @Autowired + private CategoriaDescuentoDAO categoriaDescuentoDAO; + + public List obtenerTodos() { + return categoriaDescuentoDAO.obtenerTodos(); + } + + public CategoriaDescuento obtenerID(Integer id) { + return categoriaDescuentoDAO.obtenerID(id); + } + + @Transactional + public CategoriaDescuento suscribir(CategoriaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaDescuentoDAO.suscribir(entidad); + } + + @Transactional + public CategoriaDescuento actualizacion(CategoriaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaDescuentoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaDescuentoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMarcaServiceImpl.java new file mode 100644 index 000000000..9831bc3cf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMarcaServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import com.rjconsultores.ventaboletos.service.CategoriaMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaMarcaService") +public class CategoriaMarcaServiceImpl implements CategoriaMarcaService { + + @Autowired + private CategoriaMarcaDAO categoriaMarcaDAO; + + public List obtenerTodos() { + return categoriaMarcaDAO.obtenerTodos(); + } + + public CategoriaMarca obtenerID(Integer id) { + return categoriaMarcaDAO.obtenerID(id); + } + + @Transactional + public CategoriaMarca suscribir(CategoriaMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaMarcaDAO.suscribir(entidad); + } + + @Transactional + public CategoriaMarca actualizacion(CategoriaMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaMarcaDAO.actualizacion(entidad); + } + + public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + return categoriaMarcaDAO.busquedaPoCategoriaCtrl(categoriaCtrl); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMercadoServiceImpl.java new file mode 100644 index 000000000..b25b42bbc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaMercadoServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; +import com.rjconsultores.ventaboletos.service.CategoriaMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaMercadoService") +public class CategoriaMercadoServiceImpl implements CategoriaMercadoService { + + @Autowired + private CategoriaMercadoDAO categoriaMercadoDAO; + + public List obtenerTodos() { + return categoriaMercadoDAO.obtenerTodos(); + } + + public CategoriaMercado obtenerID(Integer id) { + return categoriaMercadoDAO.obtenerID(id); + } + + @Transactional + public CategoriaMercado suscribir(CategoriaMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaMercadoDAO.suscribir(entidad); + } + + @Transactional + public CategoriaMercado actualizacion(CategoriaMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaMercadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaMercadoDAO.actualizacion(entidad); + } + + public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + return categoriaMercadoDAO.busquedaPoCategoriaCtrl(categoriaCtrl); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaPeriodoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaPeriodoServiceImpl.java new file mode 100644 index 000000000..a788fa353 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaPeriodoServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaPeriodoDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaPeriodoService") +public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService { + + @Autowired + private CategoriaPeriodoDAO categoriaPeriodoDAO; + + public List obtenerTodos() { + return categoriaPeriodoDAO.obtenerTodos(); + } + + public CategoriaPeriodo obtenerID(Integer id) { + return categoriaPeriodoDAO.obtenerID(id); + } + + @Transactional + public CategoriaPeriodo suscribir(CategoriaPeriodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaPeriodoDAO.suscribir(entidad); + } + + @Transactional + public CategoriaPeriodo actualizacion(CategoriaPeriodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaPeriodoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaPeriodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaPeriodoDAO.actualizacion(entidad); + } + + public List buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo) { + return categoriaPeriodoDAO.buscarPeriodoIntervalo(cPeriodo); + } + + public List obtenerPorCategoriaDescuento(CategoriaDescuento categoriaDescuento) { + return categoriaPeriodoDAO.obtenerPorCategoriaDescuento(categoriaDescuento); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaServiceImpl.java new file mode 100644 index 000000000..e293e1da9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaServiceImpl.java @@ -0,0 +1,86 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("categoriaService") +public class CategoriaServiceImpl implements CategoriaService { + + @Autowired + private CategoriaDAO categoriaDAO; + + public List obtenerTodos() { + return categoriaDAO.obtenerTodos(); + } + + public Categoria obtenerID(Integer id) { + return categoriaDAO.obtenerID(id); + } + + @Transactional + public Categoria suscribir(Categoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaDAO.suscribir(entidad); + } + + @Transactional + public Categoria actualizacion(Categoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Categoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaDAO.actualizacion(entidad); + } + + public List buscar(String desccategoria) { + return categoriaDAO.buscar(desccategoria); + } + + public List obtenerTodasCategoriasVisibles() { + List listCategoriasVisibles = new ArrayList(); + List lsCategorias = obtenerTodos(); + + for (Categoria c : lsCategorias) { + boolean esVisible = true; + for (Integer id : CategoriaCtrl.idsCategoriasNoVisible) { + if (id.equals(c.getCategoriaId())) { + esVisible = false; + } + } + if (esVisible) { + listCategoriasVisibles.add(c); + } + + } + return listCategoriasVisibles; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaTipoPtoVtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaTipoPtoVtaServiceImpl.java new file mode 100644 index 000000000..f7369c555 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaTipoPtoVtaServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CategoriaTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.CategoriaTipoPtoVtaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("categoriaTipoPtoVtaService") +public class CategoriaTipoPtoVtaServiceImpl implements CategoriaTipoPtoVtaService { + + @Autowired + private CategoriaTipoPtoVtaDAO categoriaTipoPtoVtaDAO; + + public List obtenerTodos() { + return categoriaTipoPtoVtaDAO.obtenerTodos(); + } + + public CategoriaTipoPtoVta obtenerID(Integer id) { + return categoriaTipoPtoVtaDAO.obtenerID(id); + } + + @Transactional + public CategoriaTipoPtoVta suscribir(CategoriaTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaTipoPtoVtaDAO.suscribir(entidad); + } + + @Transactional + public CategoriaTipoPtoVta actualizacion(CategoriaTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return categoriaTipoPtoVtaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CategoriaTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + categoriaTipoPtoVtaDAO.actualizacion(entidad); + } + + public List buscarPorPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + return categoriaTipoPtoVtaDAO.buscarPorPuntoVenta(tipoPuntoVenta); + } + + public void borrarFisico(CategoriaTipoPtoVta cd) { + categoriaTipoPtoVtaDAO.borrarFisico(cd); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CiudadServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CiudadServiceImpl.java new file mode 100644 index 000000000..889e930c1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CiudadServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CiudadDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author MCosso + */ +@Service("ciudadService") +public class CiudadServiceImpl implements CiudadService { + + @Autowired + private CiudadDAO ciudadDAO; + + public List obtenerTodos() { + return ciudadDAO.obtenerTodos(); + } + + public Ciudad obtenerID(Integer id) { + return ciudadDAO.obtenerID(id); + } + + @Transactional + public Ciudad suscribir(Ciudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ciudadDAO.suscribir(entidad); + } + + @Transactional + public Ciudad actualizacion(Ciudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ciudadDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Ciudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + ciudadDAO.actualizacion(entidad); + } + + public List buscar(String nombciudad, Estado estado, Plaza plaza) { + return ciudadDAO.buscar(nombciudad, estado, plaza); + } + + public List buscaLike(String strCiudad){ + return ciudadDAO.buscaLike(strCiudad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ClaseServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ClaseServicioServiceImpl.java new file mode 100644 index 000000000..350728000 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ClaseServicioServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ClasseServicoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("claseServicioService") +public class ClaseServicioServiceImpl implements ClaseServicioService { + + @Autowired + private ClasseServicoDAO claseServicoDAO; + + public List obtenerTodos() { + return claseServicoDAO.obtenerTodos(); + } + + public ClaseServicio obtenerID(Short id) { + return claseServicoDAO.obtenerID(id); + } + + @Transactional + public ClaseServicio suscribir(ClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return claseServicoDAO.suscribir(entidad); + } + + @Transactional + public ClaseServicio actualizacion(ClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return claseServicoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + claseServicoDAO.actualizacion(entidad); + } + + public List buscarPorNome(String nomeClaseServicio) { + return claseServicoDAO.buscarPorNome(nomeClaseServicio); + } + public List buscarTodosExceto(Integer ... idClase){ + return claseServicoDAO.buscarTodosExceto(idClase); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ClaseservicioEquivalenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ClaseservicioEquivalenciaServiceImpl.java new file mode 100644 index 000000000..f048a6e28 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ClaseservicioEquivalenciaServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ClaseservicioEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.service.ClaseservicioEquivalenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("claseservicioEquivalenciaService") +public class ClaseservicioEquivalenciaServiceImpl + implements ClaseservicioEquivalenciaService { + + @Autowired + private ClaseservicioEquivalenciaDAO claseservicioEquivalenciaDAO; + + public List obtenerTodos() { + return claseservicioEquivalenciaDAO.obtenerTodos(); + } + + public ClaseservicioEquivalencia obtenerID(Integer id) { + return claseservicioEquivalenciaDAO.obtenerID(id); + } + + @Transactional + public ClaseservicioEquivalencia suscribir(ClaseservicioEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return claseservicioEquivalenciaDAO.suscribir(entidad); + } + + @Transactional + public ClaseservicioEquivalencia actualizacion(ClaseservicioEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return claseservicioEquivalenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ClaseservicioEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + claseservicioEquivalenciaDAO.actualizacion(entidad); + } + + public List buscar(ClaseServicio claseServicio, ComisionistaExterno comisionistaExterno) { + return claseservicioEquivalenciaDAO.buscar(claseServicio, comisionistaExterno); + } + + public List buscarEquivalencia(ClaseservicioEquivalencia claseServicioEquivalencia) { + return claseservicioEquivalenciaDAO.buscarEquivalencia(claseServicioEquivalencia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ColoniaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ColoniaServiceImpl.java new file mode 100644 index 000000000..febcb2c77 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ColoniaServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ColoniaDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import com.rjconsultores.ventaboletos.service.ColoniaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import org.springframework.stereotype.Service; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("coloniaService") +public class ColoniaServiceImpl implements ColoniaService { + + @Autowired + private ColoniaDAO coloniaDAO; + + public List obtenerTodos() { + return coloniaDAO.obtenerTodos(); + } + + public Colonia obtenerID(Integer id) { + return coloniaDAO.obtenerID(id); + } + + @Transactional + public Colonia suscribir(Colonia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return coloniaDAO.suscribir(entidad); + } + + @Transactional + public Colonia actualizacion(Colonia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return coloniaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Colonia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + coloniaDAO.actualizacion(entidad); + } + + public List buscar(String desccolonia) { + return coloniaDAO.buscar(desccolonia); + } + + public List buscarPorCiudad(Ciudad ciudad) { + return coloniaDAO.buscarPorCiudad(ciudad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ComisionistaExternoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ComisionistaExternoServiceImpl.java new file mode 100644 index 000000000..c35b29986 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ComisionistaExternoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ComisionistaExternoDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("comisionistaExternoService") +public class ComisionistaExternoServiceImpl implements ComisionistaExternoService { + + @Autowired + private ComisionistaExternoDAO comisionistaExternoDAO; + + public List obtenerTodos() { + return comisionistaExternoDAO.obtenerTodos(); + } + + public ComisionistaExterno obtenerID(Integer id) { + return comisionistaExternoDAO.obtenerID(id); + } + + @Transactional + public ComisionistaExterno suscribir(ComisionistaExterno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return comisionistaExternoDAO.suscribir(entidad); + } + + @Transactional + public ComisionistaExterno actualizacion(ComisionistaExterno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return comisionistaExternoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ComisionistaExterno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + comisionistaExternoDAO.actualizacion(entidad); + } + + public List buscar(String desccomisionista) { + return comisionistaExternoDAO.buscar(desccomisionista); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CompaniaBancariaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CompaniaBancariaServiceImpl.java new file mode 100644 index 000000000..9858e6d6e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CompaniaBancariaServiceImpl.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CompaniaBancariaDAO; +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.service.CompaniaBancariaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("companiaBancariaService") +public class CompaniaBancariaServiceImpl implements CompaniaBancariaService { + + @Autowired + private CompaniaBancariaDAO companiaBancariaDAO; + + public List obtenerTodos() { + return companiaBancariaDAO.obtenerTodos(); + } + + public CompaniaBancaria obtenerID(Integer id) { + return companiaBancariaDAO.obtenerID(id); + } + + @Transactional + public CompaniaBancaria suscribir(CompaniaBancaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return companiaBancariaDAO.suscribir(entidad); + } + + @Transactional + public CompaniaBancaria actualizacion(CompaniaBancaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return companiaBancariaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CompaniaBancaria entidad) { + entidad = this.obtenerID(entidad.getCompaniabancariaId()); + + for (UsuarioBancario u : entidad.getUsuarioBancarioList()) { + u.setActivo(Boolean.FALSE); + u.setFecmodif(Calendar.getInstance().getTime()); + u.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + } + + for (MerchantBancario m : entidad.getMerchantBancarioList()) { + m.setActivo(Boolean.FALSE); + m.setFecmodif(Calendar.getInstance().getTime()); + m.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + companiaBancariaDAO.actualizacion(entidad); + } + + public List buscar(CompaniaBancaria companiaBancaria) { + return companiaBancariaDAO.buscar(companiaBancaria); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConductorServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConductorServiceImpl.java new file mode 100644 index 000000000..2f1555055 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConductorServiceImpl.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ConductorDAO; +import com.rjconsultores.ventaboletos.entidad.Conductor; +import com.rjconsultores.ventaboletos.service.ConductorService; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("conductorService") +public class ConductorServiceImpl implements ConductorService { + + @Autowired + private ConductorDAO conductorDAO; + + public List obtenerTodos() { + return conductorDAO.obtenerTodos(); + } + + public Conductor obtenerID(Integer id) { + return conductorDAO.obtenerID(id); + } + + @Transactional + public Conductor suscribir(Conductor entidad) { + return conductorDAO.suscribir(entidad); + } + + @Transactional + public Conductor actualizacion(Conductor entidad) { + return conductorDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Conductor entidad) { + conductorDAO.borrar(entidad); + } + + public Conductor buscar(String claveConductor, String contraSenha) { + return conductorDAO.buscar(claveConductor, contraSenha); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConfigRestriccionPagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConfigRestriccionPagoServiceImpl.java new file mode 100644 index 000000000..cc480a7fc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConfigRestriccionPagoServiceImpl.java @@ -0,0 +1,144 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ConfigRestriccionPagoDAO; +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import com.rjconsultores.ventaboletos.service.ConfigRestriccionPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("configRestriccionPagoService") +public class ConfigRestriccionPagoServiceImpl implements ConfigRestriccionPagoService { + + public static final Integer RESTRICCION_CANCELABLE = 1; + public static final Integer RESTRICCION_TRANSFERIBLE = 2; + public static final Integer RESTRICCION_RESERVABLE = 3; + public static final Integer RESTRICCION_NO_CANCELABLE = 4; + public static final Integer RESTRICCION_NO_TRANSFERIBLE = 5; + public static final Integer RESTRICCION_NO_RESERVABLE = 6; + @Autowired + private ConfigRestriccionPagoDAO configRestriccionPagoDAO; + + public List obtenerTodos() { + return configRestriccionPagoDAO.obtenerTodos(); + } + + public ConfigRestriccionPago obtenerID(Integer id) { + return configRestriccionPagoDAO.obtenerID(id); + } + + @Transactional + public ConfigRestriccionPago suscribir(ConfigRestriccionPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return configRestriccionPagoDAO.suscribir(entidad); + } + + @Transactional + public ConfigRestriccionPago actualizacion(ConfigRestriccionPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return configRestriccionPagoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ConfigRestriccionPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + configRestriccionPagoDAO.actualizacion(entidad); + } + + public List buscar(FormaPago formaPago, + RestriccionPago restriccionPago) { + return configRestriccionPagoDAO.buscar(formaPago, restriccionPago); + } + + public boolean puedoDarDeAlta(ConfigRestriccionPago configRestriccionPago) { + if (configRestriccionPago == null) { + throw new IllegalArgumentException("Debe de informar la configuracion de restricción"); + } + if ((configRestriccionPago.getFormaPago() == null) || (configRestriccionPago.getRestriccion() == null)) { + throw new IllegalArgumentException("Debe de informar los atributos formaPago y Restriccion"); + } + Map mapConsulta = configRestriccionPagoDAO.buscar(configRestriccionPago.getFormaPago()); + + if (!mapConsulta.isEmpty()) { + + if (configRestriccionPago.getConfigrestriccionId() != null) { + Collection values = mapConsulta.values(); + Integer restriccionId = null; + for (ConfigRestriccionPago c : values) { + if ((c.equals(configRestriccionPago)) && (!c.getRestriccion().getRestriccionId().equals(configRestriccionPago.getRestriccion().getRestriccionId()))) { + restriccionId = c.getRestriccion().getRestriccionId().intValue(); + } + } + if (restriccionId != null) { + mapConsulta.remove(restriccionId); + } + } + + if ((configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_CANCELABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_NO_CANCELABLE) != null)) + || (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_NO_CANCELABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_CANCELABLE) != null))) { + + return false; + } + + if ((configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_TRANSFERIBLE.shortValue()) + && (mapConsulta.get(RESTRICCION_NO_TRANSFERIBLE) != null)) + || (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_NO_TRANSFERIBLE.shortValue()) + && (mapConsulta.get(RESTRICCION_TRANSFERIBLE) != null))) { + return false; + } + + if ((configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_RESERVABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_NO_RESERVABLE) != null)) + || (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_NO_RESERVABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_RESERVABLE) != null))) { + return false; + } + + + + if (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_RESERVABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_RESERVABLE) != null)) { + return false; + } + if (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_TRANSFERIBLE.shortValue()) + && (mapConsulta.get(RESTRICCION_TRANSFERIBLE) != null)) { + return false; + } + if (configRestriccionPago.getRestriccion().getRestriccionId().equals(RESTRICCION_CANCELABLE.shortValue()) + && (mapConsulta.get(RESTRICCION_CANCELABLE) != null)) { + return false; + } + + } + + return true; + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java new file mode 100644 index 000000000..522da688c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ConstanteDAO; +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("constanteService") +public class ConstanteServiceImpl implements ConstanteService { + + @Autowired + private ConstanteDAO constanteDAO; + + public List obtenerTodos() { + return constanteDAO.obtenerTodos(); + } + + public Constante obtenerID(Integer id) { + return constanteDAO.obtenerID(id); + } + + @Transactional + public Constante suscribir(Constante entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return constanteDAO.suscribir(entidad); + } + + @Transactional + public Constante actualizacion(Constante entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return constanteDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Constante entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + constanteDAO.actualizacion(entidad); + } + + public Constante buscarPorNomeConstante(String nomeConstante) { + return constanteDAO.buscarPorNomeConstante(nomeConstante); + } + + public List buscar(String nombconstante) { + return constanteDAO.buscar(nombconstante); + } + + @Override + public String buscarNombreAmbiente(){ + Constante constante = constanteDAO.buscarPorNomeConstante("NOMBRE_AMBIENTE"); + if (constante == null){ + return ""; + } + + return constante.getValorconstante(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConvenioDetServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConvenioDetServiceImpl.java new file mode 100644 index 000000000..14ad2d573 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConvenioDetServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ConvenioDetDAO; +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; +import com.rjconsultores.ventaboletos.service.ConvenioDetService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("convenioDetService") +public class ConvenioDetServiceImpl implements ConvenioDetService { + + @Autowired + private ConvenioDetDAO convenioDetDAO; + + public List obtenerTodos() { + return convenioDetDAO.obtenerTodos(); + } + + public ConvenioDet obtenerID(Integer id) { + return convenioDetDAO.obtenerID(id); + } + + @Transactional + public ConvenioDet suscribir(ConvenioDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return convenioDetDAO.suscribir(entidad); + } + + @Transactional + public ConvenioDet actualizacion(ConvenioDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return convenioDetDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ConvenioDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + convenioDetDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConvenioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConvenioServiceImpl.java new file mode 100644 index 000000000..76ef9881e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConvenioServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.Convenio; +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; +import com.rjconsultores.ventaboletos.service.ConvenioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("convenioService") +public class ConvenioServiceImpl implements ConvenioService { + + @Autowired + private ConvenioDAO convenioDAO; + + public List obtenerTodos() { + return convenioDAO.obtenerTodos(); + } + + public Convenio obtenerID(Integer id) { + return convenioDAO.obtenerID(id); + } + + @Transactional + public Convenio suscribir(Convenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return convenioDAO.suscribir(entidad); + } + + @Transactional + public Convenio actualizacion(Convenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return convenioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Convenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + for (ConvenioDet cd : entidad.getConvenioDetList()) { + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setActivo(Boolean.FALSE); + } + + convenioDAO.actualizacion(entidad); + } + + public List buscar(String descconvenio, String cveconvenio) { + return convenioDAO.buscar(descconvenio, cveconvenio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CorridaCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CorridaCtrlServiceImpl.java new file mode 100644 index 000000000..8f8750627 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CorridaCtrlServiceImpl.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CorridaCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.CorridaCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("corridaCtrlService") +public class CorridaCtrlServiceImpl implements CorridaCtrlService { + + @Autowired + private CorridaCtrlDAO corridaCtrlDAO; + private static Logger log = Logger.getLogger(CorridaCtrlServiceImpl.class); + + public List obtenerTodos() { + return corridaCtrlDAO.obtenerTodos(); + } + + public CorridaCtrl obtenerID(Integer id) { + return corridaCtrlDAO.obtenerID(id); + } + + @Transactional + public CorridaCtrl suscribir(CorridaCtrl entidad) { + Integer usuarioId = 1; + if (UsuarioLogado.getUsuarioLogado()!=null){ + usuarioId = UsuarioLogado.getUsuarioLogado().getUsuarioId(); + } + entidad.setUsuarioId(usuarioId); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return corridaCtrlDAO.suscribir(entidad); + } + + @Transactional + public CorridaCtrl actualizacion(CorridaCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return corridaCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CorridaCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + corridaCtrlDAO.actualizacion(entidad); + } + + public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, Date horario, boolean pisoExtra) { + return corridaCtrlDAO.buscar(ruta, claseServicio, marca, horario, pisoExtra); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java new file mode 100644 index 000000000..7954f9471 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java @@ -0,0 +1,795 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.List; + +import javax.persistence.Transient; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionStatus; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.support.DefaultTransactionDefinition; + +import com.rjconsultores.ventaboletos.dao.CorridaDAO; +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.dao.TramoTiempoDAO; +import com.rjconsultores.ventaboletos.entidad.AsientoExclusivo; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.service.AsientoExclusivoService; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.CorridaCtrlService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.EsquemaAsientoService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.EsquemaTramoService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TramoServicioService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author rodrigo + */ +@Service("corridaService") +public class CorridaServiceImpl implements CorridaService { + + @Autowired + private CorridaDAO corridaDAO; + @Autowired + private EsquemaAsientoService esquemaAsientoService; + @Autowired + private CorridaCtrlService corridaCtrlService; + @Autowired + private RutaService rutaService; + @Autowired + private TramoServicioService tramoServicioService; + @Autowired + private TramoTiempoDAO tramoTiempoDAO; + @Autowired + private AsientoExclusivoService asientoExclusivoService; + @Autowired + private EsquemaTramoService esquemaTramoService; + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private EsquemaCorridaDAO esquemaCorridaDAO; + @Autowired + private ConstanteService constanteService; + private static Logger log = Logger.getLogger(CorridaServiceImpl.class); + private PlatformTransactionManager transactionManager; + @Transient + private int cantCorridaGenerada; + @Transient + private int cantCorridaCommit; + + @Autowired + public CorridaServiceImpl(@Qualifier("transactionManager") PlatformTransactionManager transactionManager) { + this.transactionManager = transactionManager; + } + + public List obtenerTodos() { + return corridaDAO.obtenerTodos(); + } + + public Corrida obtenerID(Corrida.Id id) { + return corridaDAO.obtenerID(id); + } + + @Transactional + public Corrida suscribir(Corrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return corridaDAO.suscribir(entidad); + } + + @Transactional + public Corrida actualizacion(Corrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return corridaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Corrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + corridaDAO.actualizacion(entidad); + } + + public List buscarPorAutobusCorridasFuturas(DiagramaAutobus diagramaAutobus) { + return corridaDAO.buscarPorAutobusCorridasFuturas(diagramaAutobus); + } + + public List buscarPorRolOperativoCorridasFuturas(DiagramaAutobus diagramaAutobus) { + return corridaDAO.buscarPorRolOperativoCorridasFuturas(diagramaAutobus); + } + + public List buscarFiltro(Parada ori, Parada des, Date hora, ClaseServicio cs) { + return corridaDAO.buscarFiltro(ori, des, hora, cs); + } + + private boolean temCorridaDiaSemana(Integer diaSemana, EsquemaCorrida esquemaCorrida) { + Boolean retorno = Boolean.FALSE; + + switch (diaSemana) { + case 1: { + // diaSemana = "Domingo"; + if (esquemaCorrida.getInddomingo() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getInddomingo()) { + retorno = Boolean.TRUE; + } + break; + } + case 2: { + // diaSemana = "Segunda"; + if (esquemaCorrida.getIndlunes() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndlunes()) { + retorno = Boolean.TRUE; + } + break; + } + case 3: { + // diaSemana = "Terca"; + if (esquemaCorrida.getIndmartes() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndmartes()) { + retorno = Boolean.TRUE; + } + break; + } + case 4: { + // diaSemana = "Quarta"; + if (esquemaCorrida.getIndmiercoles() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndmiercoles()) { + retorno = Boolean.TRUE; + } + break; + } + case 5: { + // diaSemana = "Quinta"; + if (esquemaCorrida.getIndjueves() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndjueves()) { + retorno = Boolean.TRUE; + } + break; + } + case 6: { + // diaSemana = "Sexta"; + if (esquemaCorrida.getIndviernes() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndviernes()) { + retorno = Boolean.TRUE; + } + break; + } + case 7: { + // diaSemana = "Sabado"; + if (esquemaCorrida.getIndsabado() == null) { + retorno = Boolean.FALSE; + } else if (esquemaCorrida.getIndsabado()) { + retorno = Boolean.TRUE; + } + break; + } + } + + return retorno; + + } + + private Date calcularFechorllegada(EsquemaTramo esquemaTramo, ClaseServicio clase, Date dataGeracao, Date horaChegada) { + Tramo tramo = esquemaTramo.getTramo(); + List lsTramoServicio = tramoServicioService.buscarPorTramoServico(tramo, clase); + + GregorianCalendar gHoraChegada = new GregorianCalendar(); + gHoraChegada.setTime(horaChegada); + + for (TramoServicio ts : lsTramoServicio) { + + GregorianCalendar gTiemporecorrido = new GregorianCalendar(); + gTiemporecorrido.setTime(ts.getTiemporecorrido()); + + gHoraChegada.set(Calendar.HOUR_OF_DAY, gHoraChegada.get(Calendar.HOUR_OF_DAY) + gTiemporecorrido.get(Calendar.HOUR_OF_DAY)); + + gHoraChegada.set(Calendar.MINUTE, gHoraChegada.get(Calendar.MINUTE) + gTiemporecorrido.get(Calendar.MINUTE)); + } + + return gHoraChegada.getTime(); + } + + private Date calcularFechorsalida(EsquemaTramo esquemaTramo, Date dataGeracao, Date horaChegadaAnterior, java.util.Date tiempoEstanciaAnterior) { + Date horaSaida; + if (horaChegadaAnterior == null) { + horaSaida = truncarDataHora(dataGeracao, esquemaTramo.getEsquemaCorrida().getHorasalida()); + } else { + GregorianCalendar gHoraSaidaProximo = new GregorianCalendar(); + gHoraSaidaProximo.setTime(horaChegadaAnterior); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + log.debug("Tempo Recorrido : " + sdf.format(gHoraSaidaProximo.getTime())); + + if (tiempoEstanciaAnterior != null) { + gHoraSaidaProximo.add(Calendar.MINUTE, tiempoEstanciaAnterior.getMinutes()); + gHoraSaidaProximo.add(Calendar.HOUR_OF_DAY, tiempoEstanciaAnterior.getHours()); + System.out.println("Tempo Recorrido + Estancia: " + sdf.format(gHoraSaidaProximo.getTime())); + } + + horaSaida = gHoraSaidaProximo.getTime(); + + } + + GregorianCalendar gHoraSaida = new GregorianCalendar(); + gHoraSaida.setTime(horaSaida); + + return gHoraSaida.getTime(); + } + + /** + * Adiciciona as horas do parametro hora na data dataGeracao. + * + * Al�m disso � zerado os campos segundos e milisegundos. + * + * @param dataGeracao + * @param hora + * @return + */ + private Date truncarDataHora(Date dataGeracao, Date hora) { + Date dataCorreta = new Date(); + + GregorianCalendar gAux = new GregorianCalendar(); + gAux.setTime(hora); + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(dataGeracao); + gcalendar.set(Calendar.HOUR_OF_DAY, gAux.get(Calendar.HOUR_OF_DAY)); + gcalendar.set(Calendar.MINUTE, gAux.get(Calendar.MINUTE)); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 0); + + dataCorreta = gcalendar.getTime(); + + return dataCorreta; + } + + /** + * Genera una corrida para el esquemaCorrida informado en el dia y fecha + * informados. + * + * Es validado si la corrida ya existe + * + * @param esquemaCorrida + * @param diaSemana + * @param dataGeracao + * @return - La corrida generada o null si no fue generada. + */ + public Corrida generarCorrida(EsquemaCorrida esquemaCorrida, Date dataGeracao, boolean isPisoExtra) { + GregorianCalendar calendario = new GregorianCalendar(); + calendario.setTime(dataGeracao); + + Integer diaSemana = calendario.get(Calendar.DAY_OF_WEEK); + Corrida corrida = null; + if ((esquemaCorrida.getStatusCorrida() != null) && (esquemaCorrida.getStatusCorrida().equals("A"))) { + if (temCorridaDiaSemana(diaSemana, esquemaCorrida)) { + try { + Ruta ruta = esquemaCorrida.getRuta(); + ClaseServicio claseServicio = esquemaCorrida.getClaseServicio(); + Marca marca = esquemaCorrida.getMarca(); + Date horario = esquemaCorrida.getHorasalida(); + horario = DateUtil.normalizar(horario); + + if (corridaDAO.existe(ruta, dataGeracao, horario, claseServicio, marca, isPisoExtra)) { + log.debug("corrida existe = " + ruta.getDescruta() + ";" + DateUtil.getStringDate(dataGeracao) + ";" + DateUtil.getStringDate(horario, "HH:mm") + ";" + claseServicio.getDescclase() + ";" + marca.getDescmarca() + " Piso: " + isPisoExtra); + return null; + } + + CorridaCtrl corridaCtrl = corridaCtrlService.buscar(ruta, claseServicio, marca, horario, isPisoExtra); + if (corridaCtrl == null) { + corridaCtrl = new CorridaCtrl(); + corridaCtrl.setMarca(marca); + corridaCtrl.setRuta(ruta); + corridaCtrl.setClaseServicio(claseServicio); + corridaCtrl.setHorario(horario); + + // parada origem + Parada origen = rutaService.getOrigem(ruta); + if (origen == null) { + log.debug("origen nao encontrado para a ruta = " + ruta.getRutaId()); + } + corridaCtrl.setNodo((origen == null) ? null : origen.getNodo()); + + corridaCtrl.setActivo(Boolean.TRUE); + corridaCtrl.setFecmodif(Calendar.getInstance().getTime()); + if (UsuarioLogado.getUsuarioLogado() != null) { + corridaCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + } + + corridaCtrl.setPisoExtra(isPisoExtra); + corridaCtrl = corridaCtrlService.suscribir(corridaCtrl); + } + + Corrida.Id id = new Corrida.Id(); + id.setCorridaId(corridaCtrl.getCorridaId()); + id.setFeccorrida(DateUtil.normalizarToFecha(dataGeracao)); + + Boolean existeCorrida = corridaDAO.existe(id); + if (!existeCorrida) { + + corrida = new Corrida(); + corrida.setId(id); + corrida.setEsquemaCorrida(esquemaCorrida); + corrida.setCorridaCtrl(corridaCtrl); + corrida.setAutobus(null); + corrida.setClaseServicio(esquemaCorrida.getClaseServicio()); + corrida.setConductor(null); + corrida.setTipoServicio(new Short("1")); + Integer cantparados = esquemaCorrida.getCantparados(); + if (cantparados != null) { + corrida.setCantParados(cantparados.shortValue()); + } + + Parada destino = rutaService.getDestino(ruta); + if (destino == null) { + return null; + } + corrida.setDestino(destino); + + corrida.setEmpresa(esquemaCorrida.getEmpresa()); + corrida.setEmpresa1(esquemaCorrida.getEmpresa1()); + + corrida.setFechorsalida(truncarDataHora(dataGeracao, esquemaCorrida.getHorasalida())); + corrida.setFechorSalidaOriginal(corrida.getFechorsalida()); + corrida.setIndstatuscorrida("H"); + corrida.setMarca(esquemaCorrida.getMarca()); + corrida.setNodo(corridaCtrl.getNodo()); + corrida.setDivision(esquemaCorrida.getDivision()); + + Parada origem = rutaService.getOrigem(ruta); + if (origem == null) { + return null; + } + corrida.setOrigem(origem); + + corrida.setRuta(esquemaCorrida.getRuta()); + corrida.setRolOperativo(esquemaCorrida.getRolOperativo()); + corrida.setZona(null); + + boolean hayCorrida = corridaDAO.count(corrida.getOrigem(), corrida.getDestino(), corrida.getId().getFeccorrida(), corrida.getClaseServicio(), isPisoExtra); + + if (hayCorrida) { + return null; + } + + // corrida Tramo: + List lsCorridaTramo = new ArrayList(); + Integer numSec = 1; + List lsEsquemaTramo = esquemaTramoService.obtenerPorEsquemaCorridaOrderNumSec(esquemaCorrida); + Date horaChegadaAnterior = null; + Date tiempoInstanciaAnterior = null; // indica o tempo + // de instancia + // que fica no + // tramo + // anterior ao + // atual + for (EsquemaTramo esquemaTramo : lsEsquemaTramo) { + CorridaTramo corridaTramo = new CorridaTramo(); + corridaTramo.setAutobus(null); + corridaTramo.setConductor(null); + corridaTramo.setConductor1(null); + + corridaTramo.setTiempoEstancia(esquemaTramo.getTiempoEstancia()); + + // numSec: 1-2, 2-3, 3-4... + corridaTramo.setNumsecorigen(numSec.shortValue()); + numSec = numSec + 1; + corridaTramo.setNumsecdestino(numSec.shortValue()); + + Date fecHorSalida = calcularFechorsalida(esquemaTramo, dataGeracao, horaChegadaAnterior, tiempoInstanciaAnterior); + fecHorSalida.setSeconds(0); + corridaTramo.setFechorsalida(fecHorSalida); + + Date fecHorallegada = calcularFechorllegada(esquemaTramo, corrida.getClaseServicio(), dataGeracao, fecHorSalida); + fecHorallegada.setSeconds(0); + corridaTramo.setFechorllegada(fecHorallegada); + horaChegadaAnterior = fecHorallegada; + tiempoInstanciaAnterior = esquemaTramo.getTiempoEstancia(); + + corridaTramo.setFechortarjetaviaje(null); + corridaTramo.setNodo(corridaCtrl.getNodo()); + + corridaTramo.setNumsecuencia(esquemaTramo.getNumsecuencia()); + Tramo tramo = esquemaTramo.getTramo(); + if (tramo != null) { + corridaTramo.setOrigem(tramo.getOrigem()); + corridaTramo.setDestino(tramo.getDestino()); + } + corridaTramo.setTramo(tramo); + corridaTramo.setUsuariotarjetaviajeId(null); + + Date excepcionTiempo = arreglaExcepcionTiempo(corridaTramo, corrida.getClaseServicio()); + if (excepcionTiempo != null) { + corridaTramo.setFechorllegada(excepcionTiempo); + horaChegadaAnterior = excepcionTiempo; + } + + corridaTramo.setActivo(Boolean.TRUE); + corridaTramo.setFecmodif(Calendar.getInstance().getTime()); + if (UsuarioLogado.getUsuarioLogado() != null) { + corridaTramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + } + corridaTramo.setCorrida(corrida); + corridaTramo.setFechorSalidaOriginal(fecHorSalida); + + lsCorridaTramo.add(corridaTramo); + } + corrida.setCorridaTramoList(lsCorridaTramo); + + corrida.setActivo(Boolean.TRUE); + corrida.setFecmodif(Calendar.getInstance().getTime()); + if (UsuarioLogado.getUsuarioLogado() != null) { + corrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + }else{ + corrida.setUsuarioId(1); + } + corrida.setIndTipoVenta(null); + + corrida = corridaDAO.suscribir(corrida); + cantCorridaGenerada++; + + List lsEsquemaAsiento = esquemaAsientoService.obtenerPorCorrida(esquemaCorrida); + for (EsquemaAsiento ea : lsEsquemaAsiento) { + AsientoExclusivo asientoExclusivo = new AsientoExclusivo(); + asientoExclusivo.setCorrida(corrida); + asientoExclusivo.setMotivobloqueo(null); + asientoExclusivo.setNodo(corrida.getNodo()); + asientoExclusivo.setNumasiento(ea.getNumasiento()); + asientoExclusivo.setVendible(ea.getIndvendible()); + asientoExclusivo.setParada(ea.getParada()); + + asientoExclusivo.setActivo(Boolean.TRUE); + asientoExclusivo.setFecmodif(Calendar.getInstance().getTime()); + if (UsuarioLogado.getUsuarioLogado() != null) { + asientoExclusivo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + } + + asientoExclusivo = asientoExclusivoService.suscribir(asientoExclusivo); + } + + }// if (!existeCorrida) + } catch (org.springframework.dao.DataIntegrityViolationException ex) { + log.error(ex); + } + } // if (temCorridaDiaSemana(diaSemana, esquemaCorrida)) + } // if (esquemaCorrida.getStatusCorrida().equals("A")) + + return corrida; + } + + public void generarCorrida(Date dataGeracao, List lsEsquemaCorrida) { + + DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW); + def.setIsolationLevel(DefaultTransactionDefinition.ISOLATION_READ_UNCOMMITTED); + + TransactionStatus status = transactionManager.getTransaction(def); + cantCorridaGenerada = 0; + cantCorridaCommit = 1; + + for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) { + log.info("esquema=" + esquemaCorrida.getEsquemacorridaId()); + + if (!esquemaCorridaDAO.esHijoRebote(esquemaCorrida)) { + + Corrida corrida = generarCorrida(esquemaCorrida, dataGeracao, false); + Corrida corridaPisoExtra = null; + + if (corrida == null) {// Si no generó la corrida, no va a + // generar el rebote + log.info("No fue generado corrida. Esquema " + esquemaCorrida.getEsquemacorridaId() + " Data" + dataGeracao); + continue; + } + + // PISO EXTRA + if (esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra()) { + // Invertendo RolOperativo e Classe de Serviço para o Piso + // Extra + RolOperativo ro = esquemaCorrida.getRolOperativo(); + ClaseServicio cs = esquemaCorrida.getClaseServicio(); + + esquemaCorrida.setRolOperativo(esquemaCorrida.getRolOperativo2()); + esquemaCorrida.setClaseServicio(esquemaCorrida.getClaseServicio2()); + + corridaPisoExtra = generarCorrida(esquemaCorrida, dataGeracao, true); + if (corrida != null && corridaPisoExtra != null) { + // Voltando RolOperativo e Classe de Serviço + esquemaCorrida.setRolOperativo(ro); + esquemaCorrida.setClaseServicio(cs); + + // Salvando Referencia da Corrida no piso extra + corridaPisoExtra.setCorridaPiso(corrida); + corridaPisoExtra.setNumPiso(2); + corridaPisoExtra = corridaDAO.actualizacion(corridaPisoExtra); + + // Referencia do Piso extra na Corrida + corrida.setCorridaPiso(corridaPisoExtra); + corrida.setNumPiso(1); + corrida = corridaDAO.actualizacion(corrida); + } + } + + if (esquemaCorrida.getEsquemaCorridaRebote() != null) { + + log.info("Corrida Rebote=" + esquemaCorrida.getEsquemacorridaId()); + + Corrida corridaRebote = generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), dataGeracao, false); + Corrida corridaPisoExtraRebote = null; + + boolean generaReboteDiaSeguinte = false; + + if (corridaRebote != null) { + EsquemaCorrida ecRebote = esquemaCorrida.getEsquemaCorridaRebote(); + if (ecRebote.getPisoExtra() != null && ecRebote.getPisoExtra()) { + // Invertendo RolOperativo e Classe de Serviço para + // o Piso Extra + RolOperativo ro = ecRebote.getRolOperativo(); + ClaseServicio cs = ecRebote.getClaseServicio(); + + ecRebote.setRolOperativo(ecRebote.getRolOperativo2()); + ecRebote.setClaseServicio(ecRebote.getClaseServicio2()); + + corridaPisoExtraRebote = generarCorrida(ecRebote, dataGeracao, true); + if (corridaRebote != null && corridaPisoExtraRebote != null) { + // Salvando Referencia da Corrida no piso extra + corridaPisoExtraRebote.setCorridaPiso(corridaRebote); + corridaPisoExtraRebote.setNumPiso(2); + corridaPisoExtraRebote = corridaDAO.actualizacion(corridaPisoExtraRebote); + + // Voltando RolOperativo e Classe de Serviço + ecRebote.setRolOperativo(ro); + ecRebote.setClaseServicio(cs); + + // Referencia do Piso extra na Corrida + corridaRebote.setCorridaPiso(corridaPisoExtraRebote); + corridaRebote.setNumPiso(1); + corridaRebote = corridaDAO.actualizacion(corridaRebote); + } + } + // RebotePisoExtra + if (DateUtil.compareDate(corrida.getFechorsalida(), corridaRebote.getFechorsalida()) > 0) { + generaReboteDiaSeguinte = true; // si fue generado + // con una + // fechamenor tienes + // que generar para + // el día seguinte + } + } else { + generaReboteDiaSeguinte = true;// si no fue encontrado + // para el día de + // hoy,genera para + // mañana + } + + if (generaReboteDiaSeguinte) { + log.info("Haciendo la búsqueda por el esquema rebote para el dia seguiente pues ya existe al dia de hoy"); + + corridaRebote = generarReboteDiaSeguinte(esquemaCorrida, dataGeracao); + + if (corridaPisoExtraRebote != null) { + corridaPisoExtraRebote = generarReboteDiaSeguinte(esquemaCorrida, dataGeracao); + } + + if (corridaRebote == null) { + log.info("No fue posible generar la corrida rebote. No fue encontrado esquema para la fecha del dia seguinte a " + dataGeracao); + } + } + if (corridaRebote != null) { + log.info("Rebote generado=" + corridaRebote.getId()); + corrida.setCorridaRebote(corridaRebote); + corridaDAO.actualizacion(corrida); + } + if (corridaPisoExtraRebote != null && corridaPisoExtra != null) { + log.info("Rebote Piso Extra Generado=" + corridaPisoExtraRebote.getId()); + corridaPisoExtra.setCorridaRebote(corridaPisoExtraRebote); + corridaDAO.actualizacion(corridaPisoExtra); + } + } + } + if (cantCorridaGenerada >= cantCorridaCommit) { + cantCorridaGenerada = 0; + transactionManager.commit(status); + status = transactionManager.getTransaction(def); + } + } // for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) + + if (!status.isCompleted()) { + transactionManager.commit(status); + } + + } + + /** + * Verifica se hay una excepcione de tiempo para el tramo informado. + * + * @param corridaTramo + * @param claseServicio + * @return - Si existe una excepcion, regresa la nueva fecLlegada para el + * tramo, sino, regreso null + */ + private Date arreglaExcepcionTiempo(CorridaTramo corridaTramo, ClaseServicio claseServicio) { + Date nuevaFecLlegada = null; + + Tramo tramo = corridaTramo.getTramo(); + + List lsExcepciones = tramoTiempoDAO.buscar(tramo, claseServicio, corridaTramo.getFechorsalida(), corridaTramo.getFechorllegada()); + + if (!lsExcepciones.isEmpty()) { + + TramoTiempo tramoTiempo = lsExcepciones.get(0); + List diasSemana = getDiaDeLaSemana(tramoTiempo); + + Calendar fecCorrida = Calendar.getInstance(); + fecCorrida.setTime(corridaTramo.getFechorllegada()); + + if (diasSemana.contains(fecCorrida.get(Calendar.DAY_OF_WEEK)) || diasSemana.contains(fecCorrida.get(Calendar.DAY_OF_WEEK))) { + log.debug("Hay Excepcione de tiempo"); + Calendar fechorsalida = Calendar.getInstance(); + fechorsalida.setTime(corridaTramo.getFechorsalida()); + + Calendar tmpTiemporecorrido = Calendar.getInstance(); + tmpTiemporecorrido.setTime(tramoTiempo.getTiemporecorrido()); + + fechorsalida.add(Calendar.HOUR, tmpTiemporecorrido.get(Calendar.HOUR)); + fechorsalida.add(Calendar.MINUTE, tmpTiemporecorrido.get(Calendar.MINUTE)); + + nuevaFecLlegada = fechorsalida.getTime(); + } + } + return nuevaFecLlegada; + } + + private Corrida generarReboteDiaSeguinte(EsquemaCorrida esquemaCorrida, Date dataGeracao) { + Calendar tmp = Calendar.getInstance(); + tmp.setTime(dataGeracao); + tmp.add(Calendar.DAY_OF_MONTH, 1); + return generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), tmp.getTime(), false); + } + + private List getDiaDeLaSemana(TramoTiempo tramoTiempo) { + List diasValidos = new ArrayList(); + + if (tramoTiempo.getIndapliclun()) { + diasValidos.add(Calendar.MONDAY); + } + if (tramoTiempo.getIndaplicmar()) { + diasValidos.add(Calendar.TUESDAY); + } + if (tramoTiempo.getIndaplicmie()) { + diasValidos.add(Calendar.WEDNESDAY); + } + if (tramoTiempo.getIndaplicjue()) { + diasValidos.add(Calendar.THURSDAY); + } + if (tramoTiempo.getIndaplicvie()) { + diasValidos.add(Calendar.FRIDAY); + } + if (tramoTiempo.getIndaplicsab()) { + diasValidos.add(Calendar.SATURDAY); + } + if (tramoTiempo.getIndaplicdom()) { + diasValidos.add(Calendar.SUNDAY); + } + + return diasValidos; + } + + public List buscarPorFecCorrida(Date value) { + return corridaDAO.buscarPorFecCorrida(value); + } + + public List buscarPorId(Integer idCorrida) { + return corridaDAO.buscarPorId(idCorrida); + } + + @Override + public Date calcularDataFinalGeneracionCorrida() { + Date dataDe = new Date(); + + Constante constante = constanteService.buscarPorNomeConstante("CANT_DIAS_GENERACION_CORRIDA"); + Calendar calendarData = Calendar.getInstance(); + calendarData.setTime(dataDe); + calendarData.add(Calendar.DATE, Integer.parseInt(constante.getValorconstante())); + Date dataAte = calendarData.getTime(); + + return dataAte; + } + + @Transactional(readOnly = true, propagation=Propagation.SUPPORTS) + public boolean generarCorridaAutomatica() { + + // Date dataDe = new GregorianCalendar(2012, 4, 25).getTime(); + Date dataDe = new java.util.Date(); + Date dataAte = calcularDataFinalGeneracionCorrida(); + // Date dataAte = new GregorianCalendar(2012, 4, 25).getTime(); + + return generarCorridaAutomatica(dataDe, dataAte); + } + + public boolean generarCorridaAutomatica(Date dataDe, Date dataAte) { + + boolean hayError = false; + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy"); + + log.debug("** AUTO - Data De: " + sdfData.format(dataDe) + " **Data At�: " + sdfData.format(dataAte)); + + Calendar calendarData = Calendar.getInstance(); + calendarData.setTime(dataAte); + calendarData.add(Calendar.DATE, 1); + dataAte = calendarData.getTime(); + try { + while (dataDe.before(dataAte)) { + + log.debug("*** Data: " + sdfData.format(dataDe)); + + List lsEsquemaCorrida = esquemaCorridaService.buscaDentroVigencia(dataDe); + + Boolean dentroVigenciaEsquemaOperacional = !lsEsquemaCorrida.isEmpty(); + if (dentroVigenciaEsquemaOperacional) { + this.generarCorrida(dataDe, lsEsquemaCorrida); + } else { + log.info("No hay esquema vigente para la fecha " + sdfData.format(dataDe)); + } + + calendarData.setTime(dataDe); + calendarData.add(Calendar.DATE, 1); + dataDe = calendarData.getTime(); + } + + } catch (Exception ex) { + log.error("Erro ao gerar corridas: " + ex, ex); + hayError = true; + + } + return hayError; + } + + @Override + public List buscarDistinct(Parada ori, Parada des, Date horaSalidaInicio, Date horaSalidaFin, ClaseServicio cs, Integer corridaId) { + return corridaDAO.buscarDistinct(ori, des, (horaSalidaInicio == null) ? null : DateUtil.getFecInicio(horaSalidaInicio).getTime(), (horaSalidaFin == null) ? null : DateUtil.getFecInicio(horaSalidaFin).getTime(), cs, corridaId); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CorridaTramoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CorridaTramoServiceImpl.java new file mode 100644 index 000000000..b6f4fe01c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CorridaTramoServiceImpl.java @@ -0,0 +1,48 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.CorridaTramoDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.service.CorridaTramoService; + +@Service("corridaTramoService") +public class CorridaTramoServiceImpl implements CorridaTramoService { + + @Autowired + private CorridaTramoDAO corridaTramoDAO; + + @Override + public List obtenerTodos() { + return corridaTramoDAO.obtenerTodos(); + } + + @Override + public CorridaTramo obtenerID(Integer id) { + return corridaTramoDAO.obtenerID(id); + } + + @Override + public CorridaTramo suscribir(CorridaTramo entidad) { + return corridaTramoDAO.suscribir(entidad); + } + + @Override + public CorridaTramo actualizacion(CorridaTramo entidad) { + return corridaTramoDAO.actualizacion(entidad); + } + + @Override + public void borrar(CorridaTramo entidad) { + corridaTramoDAO.borrar(entidad); + } + + @Override + public List obtenerTramoTarjetaEmitida() { + return corridaTramoDAO.obtenerTramoTarjetaEmitida(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CortesiaBeneficiarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaBeneficiarioServiceImpl.java new file mode 100644 index 000000000..390f99942 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaBeneficiarioServiceImpl.java @@ -0,0 +1,64 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CortesiaBeneficiarioDAO; +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import com.rjconsultores.ventaboletos.service.CortesiaBeneficiarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("cortesiaBeneficiarioService") +public class CortesiaBeneficiarioServiceImpl implements CortesiaBeneficiarioService{ + + @Autowired + private CortesiaBeneficiarioDAO cortesiaBeneficiarioDAO; + + public List obtenerTodos() { + return cortesiaBeneficiarioDAO.obtenerTodos(); + } + + public CortesiaBeneficiario obtenerID(Integer id) { + return cortesiaBeneficiarioDAO.obtenerID(id); + } + + @Transactional + public CortesiaBeneficiario suscribir(CortesiaBeneficiario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaBeneficiarioDAO.suscribir(entidad); + } + + @Transactional + public CortesiaBeneficiario actualizacion(CortesiaBeneficiario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaBeneficiarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CortesiaBeneficiario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cortesiaBeneficiarioDAO.actualizacion(entidad); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CortesiaDireccionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaDireccionServiceImpl.java new file mode 100644 index 000000000..6665fbdc0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaDireccionServiceImpl.java @@ -0,0 +1,78 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CortesiaDireccionDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.service.CortesiaDireccionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("cortesiaDireccionService") +public class CortesiaDireccionServiceImpl implements CortesiaDireccionService { + + @Autowired + private CortesiaDireccionDAO cortesiaDireccionDAO; + + public List obtenerTodos() { + return cortesiaDireccionDAO.obtenerTodos(); + } + + public CortesiaDireccion obtenerID(Integer id) { + return cortesiaDireccionDAO.obtenerID(id); + } + + @Transactional + public CortesiaDireccion suscribir(CortesiaDireccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaDireccionDAO.suscribir(entidad); + + } + + @Transactional + public CortesiaDireccion actualizacion(CortesiaDireccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaDireccionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CortesiaDireccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cortesiaDireccionDAO.actualizacion(entidad); + } + + public List pesquisar(Marca marca, ClaseServicio claseServicio, Date fecInicio, Date fecFinal) { + + return cortesiaDireccionDAO.pesquisar(marca, claseServicio, fecInicio, fecFinal); + } + + public List buscar(CortesiaDireccion cortesiaDireccion) { + return cortesiaDireccionDAO.buscar(cortesiaDireccion); + } + + public List buscarFolio(CortesiaDireccion cortesiaDireccion) { + return cortesiaDireccionDAO.buscarFolio(cortesiaDireccion); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CortesiaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaServiceImpl.java new file mode 100644 index 000000000..d7a386823 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CortesiaServiceImpl.java @@ -0,0 +1,114 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CortesiaDAO; +import com.rjconsultores.ventaboletos.dao.EmpleadoDAO; +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.service.CortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("cortesiaService") +public class CortesiaServiceImpl implements CortesiaService { + + public static final String PENDIENTE = "P"; + @Autowired + private CortesiaDAO cortesiaDAO; + @Autowired + private EmpleadoDAO empleadoDAO; + + public List obtenerTodos() { + return cortesiaDAO.obtenerTodos(); + } + + public Cortesia obtenerID(Integer id) { + return cortesiaDAO.obtenerID(id); + } + + @Transactional + public Cortesia suscribir(Cortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaDAO.suscribir(entidad); + } + + @Transactional + public Cortesia actualizacion(Cortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cortesiaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Cortesia entidad) { + + entidad = this.obtenerID(entidad.getCortesiaId()); + + for (CortesiaBeneficiario cb : entidad.getCortesiaBeneficiarioList()) { + cb.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cb.setFecmodif(Calendar.getInstance().getTime()); + cb.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cortesiaDAO.actualizacion(entidad); + } + + public List pesquisar(String empleadoClave) { + List empleados = empleadoDAO.obtenerTodos(); + Empleado eSlec = null; + for (Empleado emp : empleados) { + if (emp.getCveEmpleado().equals(empleadoClave)) { + eSlec = emp; + } + } + + return cortesiaDAO.pesquisar(eSlec); + } + + public Cortesia buscar(Integer cortesiaId) { + List cortesias = cortesiaDAO.obtenerTodos(); + Cortesia corSelec = null; + for (Cortesia c : cortesias) { + if (c.getCortesiaId().equals(cortesiaId)) { + corSelec = c; + } + } + + return cortesiaDAO.buscar(corSelec); + } + + public List buscarDplicidad(Cortesia cortesia) { + return cortesiaDAO.buscarDplicidad(cortesia); + } + + public boolean cortesiaUtilizada(Cortesia cortesia) { + if ((cortesia == null) || (cortesia.getNdstatus() == null)) { + throw new IllegalArgumentException("Deve de infromar los datos de la cortesia"); + } + if (!cortesia.getNdstatus().equals(PENDIENTE)) { + return true; + } + return false; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CuponConvenioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CuponConvenioServiceImpl.java new file mode 100644 index 000000000..8505609df --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CuponConvenioServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CuponConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.service.CuponConvenioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("cuponConvenioService") +public class CuponConvenioServiceImpl implements CuponConvenioService{ + + @Autowired + private CuponConvenioDAO cuponConvenioDAO; + public List obtenerTodos() { + return cuponConvenioDAO.obtenerTodos(); + } + + public CuponConvenio obtenerID(Integer id) { + return cuponConvenioDAO.obtenerID(id); + } + + @Transactional + public CuponConvenio suscribir(CuponConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cuponConvenioDAO.suscribir(entidad); + } + + @Transactional + public CuponConvenio actualizacion(CuponConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cuponConvenioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CuponConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cuponConvenioDAO.actualizacion(entidad); + } + + public List pesquisar(TipoConvenio tipoConvenio) { + + return cuponConvenioDAO.pesquisar(tipoConvenio); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CuponSecretariaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CuponSecretariaServiceImpl.java new file mode 100644 index 000000000..0d30145fb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/CuponSecretariaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.CuponSecretariaDAO; +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; +import com.rjconsultores.ventaboletos.service.CuponSecretariaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("cuponSecretariaService") +public class CuponSecretariaServiceImpl implements CuponSecretariaService { + + @Autowired + private CuponSecretariaDAO cuponSecretariaDAO; + + public List obtenerTodos() { + return cuponSecretariaDAO.obtenerTodos(); + } + + public CuponSecretaria obtenerID(Integer id) { + return cuponSecretariaDAO.obtenerID(id); + } + + @Transactional + public CuponSecretaria suscribir(CuponSecretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cuponSecretariaDAO.suscribir(entidad); + } + + @Transactional + public CuponSecretaria actualizacion(CuponSecretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return cuponSecretariaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(CuponSecretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cuponSecretariaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/DepositoBancarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/DepositoBancarioServiceImpl.java new file mode 100644 index 000000000..eb3d21f1d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/DepositoBancarioServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.DepositoBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.DepositoBancario; +import com.rjconsultores.ventaboletos.service.DepositoBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("depositoBancarioService") +public class DepositoBancarioServiceImpl implements DepositoBancarioService { + + @Autowired + private DepositoBancarioDAO depositoBancarioDAO; + + public List obtenerTodos() { + return depositoBancarioDAO.obtenerTodos(); + } + + public DepositoBancario obtenerID(Integer id) { + return depositoBancarioDAO.obtenerID(id); + } + + @Transactional + public DepositoBancario suscribir(DepositoBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return depositoBancarioDAO.suscribir(entidad); + } + + @Transactional + public DepositoBancario actualizacion(DepositoBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return depositoBancarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(DepositoBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + depositoBancarioDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/DetDiagramaAutobusServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/DetDiagramaAutobusServiceImpl.java new file mode 100644 index 000000000..34a81e4c6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/DetDiagramaAutobusServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.DetDiagramaAutobusDAO; +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import com.rjconsultores.ventaboletos.service.DetDiagramaAutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("detDiagramaAutobusService") +public class DetDiagramaAutobusServiceImpl implements DetDiagramaAutobusService { + + @Autowired + private DetDiagramaAutobusDAO detDiagramaAtuobusDAO; + + public List obtenerTodos() { + return detDiagramaAtuobusDAO.obtenerTodos(); + } + + public DetDiagramaAutobus obtenerID(Short id) { + return detDiagramaAtuobusDAO.obtenerID(id); + } + + @Transactional + public DetDiagramaAutobus suscribir(DetDiagramaAutobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return detDiagramaAtuobusDAO.suscribir(entidad); + } + + @Transactional + public DetDiagramaAutobus actualizacion(DetDiagramaAutobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return detDiagramaAtuobusDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(DetDiagramaAutobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + detDiagramaAtuobusDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/DiagramaAutobusServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/DiagramaAutobusServiceImpl.java new file mode 100644 index 000000000..fa435e434 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/DiagramaAutobusServiceImpl.java @@ -0,0 +1,78 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.DiagramaAutobusDAO; +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("diagramaAutobusService") +public class DiagramaAutobusServiceImpl implements DiagramaAutobusService { + + @Autowired + private DiagramaAutobusDAO diagramaAutobusDAO; + + public List obtenerTodos() { + return diagramaAutobusDAO.obtenerTodos(); + } + + public DiagramaAutobus obtenerID(Short id) { + return diagramaAutobusDAO.obtenerID(id); + } + + @Transactional + public DiagramaAutobus suscribir(DiagramaAutobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return diagramaAutobusDAO.suscribir(entidad); + } + + @Transactional + public DiagramaAutobus actualizacion(DiagramaAutobus entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return diagramaAutobusDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(DiagramaAutobus entidad) { + + for (DetDiagramaAutobus dda : entidad.getDetDiagramaAutobusList()) { + dda.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + dda.setFecmodif(Calendar.getInstance().getTime()); + dda.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + diagramaAutobusDAO.actualizacion(entidad); + } + + public List buscar(String descDiagrama, Short maxparados, + Short cantasientos) { + return diagramaAutobusDAO.buscar(descDiagrama, maxparados, cantasientos); + } + + public List buscar(String descDiagrama) { + return diagramaAutobusDAO.buscar(descDiagrama); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/DivisionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/DivisionServiceImpl.java new file mode 100644 index 000000000..5543b545c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/DivisionServiceImpl.java @@ -0,0 +1,62 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.DivisionDAO; +import com.rjconsultores.ventaboletos.entidad.Division; +import com.rjconsultores.ventaboletos.service.DivisionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("divisionService") +public class DivisionServiceImpl implements DivisionService { + + @Autowired + private DivisionDAO divisionDAO; + + @Override + public List obtenerTodos() { + return divisionDAO.obtenerTodos(); + } + + @Override + public Division obtenerID(Integer id) { + return divisionDAO.obtenerID(id); + } + + @Override + @Transactional + public Division suscribir(Division entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return divisionDAO.suscribir(entidad); + } + + @Override + @Transactional + public Division actualizacion(Division entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return divisionDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(Division entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + divisionDAO.actualizacion(entidad); + + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpleadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpleadoServiceImpl.java new file mode 100644 index 000000000..1af66d645 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpleadoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EmpleadoDAO; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.service.EmpleadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * @author Shiro + */ +@Service("empleadoService") +public class EmpleadoServiceImpl implements EmpleadoService { + + @Autowired + private EmpleadoDAO empleadoDAO; + + public List obtenerTodos() { + return empleadoDAO.obtenerTodos(); + } + + public Empleado obtenerID(Integer id) { + return empleadoDAO.obtenerID(id); + } + + public Empleado suscribir(Empleado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empleadoDAO.suscribir(entidad); + } + + public Empleado actualizacion(Empleado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empleadoDAO.actualizacion(entidad); + } + + public void borrar(Empleado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + empleadoDAO.actualizacion(entidad); + } + + public List pesquisaClave(String empleadoClave) { + return empleadoDAO.pesquisaClave(empleadoClave); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaEquivalenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaEquivalenciaServiceImpl.java new file mode 100644 index 000000000..0e6248b58 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaEquivalenciaServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EmpresaEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import com.rjconsultores.ventaboletos.service.EmpresaEquivalenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("empresaEquivalenciaService") +public class EmpresaEquivalenciaServiceImpl implements EmpresaEquivalenciaService { + + @Autowired + private EmpresaEquivalenciaDAO empresaEquivalenciaDAO; + + public List obtenerTodos() { + return empresaEquivalenciaDAO.obtenerTodos(); + } + + public EmpresaEquivalencia obtenerID(Integer id) { + return empresaEquivalenciaDAO.obtenerID(id); + } + + @Transactional + public EmpresaEquivalencia suscribir(EmpresaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaEquivalenciaDAO.suscribir(entidad); + } + + @Transactional + public EmpresaEquivalencia actualizacion(EmpresaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaEquivalenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EmpresaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + empresaEquivalenciaDAO.actualizacion(entidad); + } + + public List buscar(Empresa empresa, ComisionistaExterno comisionistaExterno) { + return empresaEquivalenciaDAO.buscar(empresa, comisionistaExterno); + } + + public List buscarEquivalencia(EmpresaEquivalencia empresaEquivalencia) { + return empresaEquivalenciaDAO.buscar(empresaEquivalencia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java new file mode 100644 index 000000000..a064e1208 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("empresaService") +public class EmpresaServiceImpl implements EmpresaService { + + @Autowired + private EmpresaDAO empresaDAO; + + public List obtenerTodos() { + return empresaDAO.obtenerTodos(); + } + + public Empresa obtenerID(Integer id) { + return empresaDAO.obtenerID(id); + } + + @Transactional + public Empresa suscribir(Empresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaDAO.suscribir(entidad); + } + + @Transactional + public Empresa actualizacion(Empresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Empresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + empresaDAO.actualizacion(entidad); + } + + public List buscar(String nombempresa, Boolean indExterna, Short indTipo) { + return empresaDAO.buscar(nombempresa, indExterna, indTipo); + } + + public List buscarTodosExceto(Integer... idEmpresa) { + return empresaDAO.buscarTodosExceto(idEmpresa); + } + + public List obtenerIndExternoFalse() { + return empresaDAO.obtenerIndExternoFalse(); + } + + public List obtenerIndTipo1() { + return empresaDAO.obtenerIndTipo1(); + } + + public List obtenerIndTipo2() { + return empresaDAO.obtenerIndTipo2(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java new file mode 100644 index 000000000..e47bb4c4b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EsquemaAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.service.EsquemaAsientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("esquemaAsientoService") +public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { + + @Autowired + private EsquemaAsientoDAO esquemaAsientoDAO; + + public List obtenerTodos() { + return esquemaAsientoDAO.obtenerTodos(); + } + + public EsquemaAsiento obtenerID(Integer id) { + return esquemaAsientoDAO.obtenerID(id); + } + + @Transactional + public EsquemaAsiento suscribir(EsquemaAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaAsientoDAO.suscribir(entidad); + } + + @Transactional + public EsquemaAsiento actualizacion(EsquemaAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaAsientoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EsquemaAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + esquemaAsientoDAO.actualizacion(entidad); + } + + public List obtenerPorCorrida(EsquemaCorrida esquemaCorrida) { + return esquemaAsientoDAO.obtenerPorCorrida(esquemaCorrida); + } + + public EsquemaAsiento obtenerPorCorridaeAsiento(EsquemaCorrida esquemaCorrida, String asiento) { + return esquemaAsientoDAO.obtenerPorCorridaeAsiento(esquemaCorrida, asiento); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java new file mode 100644 index 000000000..7b5537c6c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java @@ -0,0 +1,155 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.dao.EsquemaTramoDAO; +import com.rjconsultores.ventaboletos.dao.RutaCombinacionDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEsquema; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("esquemaCorridaService") +public class EsquemaCorridaServiceImpl implements EsquemaCorridaService { + + @Autowired + private EsquemaCorridaDAO esquemaCorridaDAO; + @Autowired + private RutaCombinacionDAO rutaCombinacionDAO; + @Autowired + private EsquemaTramoDAO esquemaTramoDAO; + + public List obtenerTodos() { + return esquemaCorridaDAO.obtenerTodos(); + } + + public EsquemaCorrida obtenerID(Integer id) { + return esquemaCorridaDAO.obtenerID(id); + } + + @Transactional + public EsquemaCorrida suscribir(EsquemaCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaCorridaDAO.suscribir(entidad); + } + + @Transactional + public EsquemaCorrida actualizacion(EsquemaCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaCorridaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EsquemaCorrida entidad) { + entidad = (entidad.getEsquemacorridaId() == null) ? entidad : esquemaCorridaDAO.obtenerID(entidad.getEsquemacorridaId()); + for (EsquemaAsiento pricing : entidad.getEsquemaAsientoList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (EsquemaTramo pricing : entidad.getEsquemaTramoList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + esquemaCorridaDAO.actualizacion(entidad); + } + + public List buscarPorEsquemaOperacional(EsquemaOperacional eo) { + return esquemaCorridaDAO.buscarPorEsquemaOperacional(eo); + } + + public List buscar(Marca marca, RolOperativo rolOperativo, + Ruta ruta, ClaseServicio claseServicio) { + return esquemaCorridaDAO.buscar(marca, rolOperativo, ruta, claseServicio); + } + + public List buscar(EsquemaCorrida ec) { + return esquemaCorridaDAO.buscar(ec); + } + + @Transactional + public void actualizaEsquemaTramo(List listParadaEsquema, EsquemaCorrida ec) { + + ec = this.obtenerID(ec.getEsquemacorridaId()); + if (ec.getEsquemaTramoList() != null) { + for (EsquemaTramo et : ec.getEsquemaTramoList()) { + et.setActivo(Boolean.FALSE); + et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + et.setFecmodif(Calendar.getInstance().getTime()); + + esquemaTramoDAO.actualizacion(et); + } + } + + for (int i = 0; (i < listParadaEsquema.size() - 1); i++) { + Parada paradaOrigen = listParadaEsquema.get(i).getParada(); + Parada paradaDestino = listParadaEsquema.get(i + 1).getParada(); + + Tramo t = rutaCombinacionDAO.busqueda(ec.getRuta(), paradaOrigen, paradaDestino); + + if (t == null) { + throw new RuntimeException("No fue encontrado el tramo para el origen:" + paradaOrigen + " y destino:" + paradaDestino); + } + + EsquemaTramo et = new EsquemaTramo(); + et.setActivo(Boolean.TRUE); + et.setEsquemaCorrida(ec); + et.setFecmodif(Calendar.getInstance().getTime()); + et.setNumsecuencia((short) (i + 1)); + et.setTiempoEstancia(listParadaEsquema.get(i + 1).getTiempoEstancia()); + et.setTramo(t); + et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + esquemaTramoDAO.suscribir(et); + } + } + + @Override + public List buscaDentroVigencia(Date dataGeracao) { + return esquemaCorridaDAO.buscaDentroVigencia(dataGeracao); + } + + public boolean buscarEsquemaCorridaExisteTramo(Tramo tramo) { + return esquemaCorridaDAO.buscarEsquemaCorridaExisteTramo(tramo); + } + + @Override + public List existe(Ruta ruta, Integer paradaId) { + return esquemaCorridaDAO.existe(ruta, paradaId); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaOperacionalServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaOperacionalServiceImpl.java new file mode 100644 index 000000000..ff8c1e036 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaOperacionalServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EsquemaOperacionalDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.service.EsquemaOperacionalService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("esquemaOperacionalService") +public class EsquemaOperacionalServiceImpl implements EsquemaOperacionalService { + + @Autowired + private EsquemaOperacionalDAO esquemaOperacionalDAO; + + public List obtenerTodos() { + return esquemaOperacionalDAO.obtenerTodos(); + } + + public EsquemaOperacional obtenerID(Integer id) { + return esquemaOperacionalDAO.obtenerID(id); + } + + @Transactional + public EsquemaOperacional suscribir(EsquemaOperacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaOperacionalDAO.suscribir(entidad); + } + + @Transactional + public EsquemaOperacional actualizacion(EsquemaOperacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaOperacionalDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EsquemaOperacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + esquemaOperacionalDAO.actualizacion(entidad); + } + + public List dentroVigenciaEsquemaOperacional(Date dataGeracao) { + return esquemaOperacionalDAO.dentroVigenciaEsquemaOperacional(dataGeracao); + } + + public List dentroVigenciaEsquemaOperacional(Date dataDe, Date dataAte) { + return esquemaOperacionalDAO.dentroVigenciaEsquemaOperacional(dataDe, dataAte); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaTramoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaTramoServiceImpl.java new file mode 100644 index 000000000..3d9cac67f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaTramoServiceImpl.java @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EsquemaTramoDAO; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import com.rjconsultores.ventaboletos.service.EsquemaTramoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("esquemaTramoService") +public class EsquemaTramoServiceImpl implements EsquemaTramoService { + + @Autowired + private EsquemaTramoDAO esquemaTramoDAO; + + public List obtenerTodos() { + return esquemaTramoDAO.obtenerTodos(); + } + + public EsquemaTramo obtenerID(Integer id) { + return esquemaTramoDAO.obtenerID(id); + } + + @Transactional + public EsquemaTramo suscribir(EsquemaTramo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaTramoDAO.suscribir(entidad); + } + + @Transactional + public EsquemaTramo actualizacion(EsquemaTramo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return esquemaTramoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EsquemaTramo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + esquemaTramoDAO.actualizacion(entidad); + } + + public List obtenerPorEsquemaCorrida(EsquemaCorrida ec) { + return esquemaTramoDAO.obtenerPorEsquemaCorrida(ec); + } + + public List obtenerPorEsquemaCorridaOrderNumSec(EsquemaCorrida ec) { + return esquemaTramoDAO.obtenerPorEsquemaCorridaOrderNumSec(ec); + } + + public List obtenerAtivosDesativosPorEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + return esquemaTramoDAO.obtenerAtivosDesativosPorEsquemaCorrida(esquemaCorrida); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java new file mode 100644 index 000000000..8b0b75ef3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java @@ -0,0 +1,107 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.EstacionDAO; +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.EstacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Administrador + */ +@Service("estacionService") +public class EstacionServiceImpl implements EstacionService { + + @Autowired + private EstacionDAO estacionDAO; + + public List obtenerTodos() { + return estacionDAO.obtenerTodos(); + } + + public Estacion obtenerID(Integer id) { + return estacionDAO.obtenerID(id); + } + + @Transactional(rollbackFor=BusinessException.class) + public Estacion suscribirActualizar(Estacion estacion) throws BusinessException { + List lsEstacion = estacionDAO.buscar(estacion.getDescmac()); + boolean esDuplicado = false; + + if (!lsEstacion.isEmpty()) { + if (estacion.getEstacionId() == null) { + esDuplicado = true; + } else { + esDuplicado = !lsEstacion.get(0).getEstacionId().equals(estacion.getEstacionId()); + } + } + + if (esDuplicado) { + throw new BusinessException("MSG.Registro.Existe"); + } + + boolean esCajaDuplicado = false; + lsEstacion = estacionDAO.buscar(estacion.getNumcaja(), estacion.getPuntoVenta()); + + if (!lsEstacion.isEmpty()) { + if (estacion.getEstacionId() == null) { + esCajaDuplicado = true; + } else { + esCajaDuplicado = !lsEstacion.get(0).getEstacionId().equals(estacion.getEstacionId()); + } + } + + + if (esCajaDuplicado) { + throw new BusinessException("estacionServiceImpl.msg.cajaDuplicado"); + } + + estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + estacion.setFecmodif(Calendar.getInstance().getTime()); + estacion.setActivo(Boolean.TRUE); + + if (estacion.getEstacionId() == null) { + return estacionDAO.suscribir(estacion); + } else { + + return estacionDAO.actualizacion(estacion); + } + } + + @Transactional + public void borrar(Estacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + estacionDAO.actualizacion(entidad); + } + + public List buscar(String descEstacion, String descMac, Long nunCaja, PuntoVenta pv) { + return estacionDAO.buscar(descEstacion, descMac, nunCaja, pv); + } + + public List buscar(String descMac) { + return estacionDAO.buscar(descMac); + } + + @Override + public Long getDecimalMAC(String mac) { + mac = mac.trim(); + mac = mac.replace("-", ""); + return Long.parseLong(mac, 16); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EstadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EstadoServiceImpl.java new file mode 100644 index 000000000..7f51915e9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EstadoServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EstadoDAO; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author MCosso + */ +@Service("estadoService") +public class EstadoServiceImpl implements EstadoService { + + @Autowired + private EstadoDAO estadoDAO; + + public List obtenerTodos() { + return estadoDAO.obtenerTodos(); + } + + public Estado obtenerID(Integer id) { + return estadoDAO.obtenerID(id); + } + + @Transactional + public Estado suscribir(Estado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return estadoDAO.suscribir(entidad); + } + + @Transactional + public Estado actualizacion(Estado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return estadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Estado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + estadoDAO.actualizacion(entidad); + } + + public List buscar(String nombestado, Pais pais) { + return estadoDAO.buscar(nombestado, pais); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EventoExtraServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EventoExtraServiceImpl.java new file mode 100644 index 000000000..235d1eaa3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EventoExtraServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.EventoExtra; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; +import com.rjconsultores.ventaboletos.service.EventoExtraService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("eventoExtraService") +public class EventoExtraServiceImpl implements EventoExtraService { + + @Autowired + private EventoExtraDAO eventoExtraDAO; + + public List obtenerTodos() { + return eventoExtraDAO.obtenerTodos(); + } + + public EventoExtra obtenerID(Integer id) { + return eventoExtraDAO.obtenerID(id); + } + + @Transactional + public EventoExtra suscribir(EventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return eventoExtraDAO.suscribir(entidad); + } + + @Transactional + public EventoExtra actualizacion(EventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return eventoExtraDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(EventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + eventoExtraDAO.actualizacion(entidad); + } + + @Transactional + public List obtenerPorTipo(TipoEventoExtra tipoEventoExtra){ + return eventoExtraDAO.obtenerPorTipo(tipoEventoExtra); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ExcepcionRedondoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ExcepcionRedondoServiceImpl.java new file mode 100644 index 000000000..293f9091d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ExcepcionRedondoServiceImpl.java @@ -0,0 +1,88 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ExcepcionRedondoDAO; +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ExcepcionRedondoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("excepcionRedondoService") +public class ExcepcionRedondoServiceImpl implements ExcepcionRedondoService { + + @Autowired + private ExcepcionRedondoDAO excepcionRedondoDAO; + + public List obtenerTodos() { + return excepcionRedondoDAO.obtenerTodos(); + } + + public ExcepcionRedondo obtenerID(Integer id) { + return excepcionRedondoDAO.obtenerID(id); + } + + @Transactional(rollbackFor=BusinessException.class) + public ExcepcionRedondo suscribirActualizar(ExcepcionRedondo entidad) throws BusinessException { + + if (entidad.getOrigem().getParadaId().equals(entidad.getDestino().getParadaId())) { + throw new BusinessException("MSG.Origem.Igual.Destino"); + } + + + List lsExcepciones = excepcionRedondoDAO.buscar(entidad.getOrigem(), entidad.getDestino()); + boolean podeSavar = false; + if (lsExcepciones.isEmpty()) { + podeSavar = true; + } else { + if (entidad.getExcepcionredondoId() != null) { + for (ExcepcionRedondo er : lsExcepciones) { + if (entidad.getExcepcionredondoId().equals(er.getExcepcionredondoId())) { + podeSavar = true; + } + } + } + } + + if (!podeSavar) { + throw new BusinessException("MSG.Registro.Existe"); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + if (entidad.getExcepcionredondoId() == null) { + return excepcionRedondoDAO.suscribir(entidad); + } else { + return excepcionRedondoDAO.actualizacion(entidad); + } + + } + + + @Transactional + public void borrar(ExcepcionRedondo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + excepcionRedondoDAO.actualizacion(entidad); + } + + public List buscar(String indTipo, Parada origem, Parada destino) { + return excepcionRedondoDAO.buscar(indTipo, origem, destino); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoDetServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoDetServiceImpl.java new file mode 100644 index 000000000..581aebe20 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoDetServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.FormaPagoDetDAO; +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import com.rjconsultores.ventaboletos.service.FormaPagoDetService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("formaPagoDetService") +public class FormaPagoDetServiceImpl implements FormaPagoDetService { + + @Autowired + private FormaPagoDetDAO formaPagoDetDAO; + + public List obtenerTodos() { + return formaPagoDetDAO.obtenerTodos(); + } + + public FormaPagoDet obtenerID(Integer id) { + return formaPagoDetDAO.obtenerID(id); + } + + @Transactional + public FormaPagoDet suscribir(FormaPagoDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return formaPagoDetDAO.suscribir(entidad); + } + + @Transactional + public FormaPagoDet actualizacion(FormaPagoDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return formaPagoDetDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(FormaPagoDet entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + formaPagoDetDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java new file mode 100644 index 000000000..1dcce15a8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.FormaPagoDAO; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("formaPagoService") +public class FormaPagoServiceImpl implements FormaPagoService { + + private Integer[] formasPagoEspeciales = {4, 5, 6, 9, 10, 11, 96, 97, 98, 99}; + + @Autowired + private FormaPagoDAO formaPagoDAO; + + public List obtenerTodos() { + return formaPagoDAO.obtenerTodos(); + } + + public FormaPago obtenerID(Short id) { + return formaPagoDAO.obtenerID(id); + } + + @Transactional + public FormaPago suscribir(FormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return formaPagoDAO.suscribir(entidad); + } + + @Transactional + public FormaPago actualizacion(FormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return formaPagoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(FormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + formaPagoDAO.actualizacion(entidad); + } + + public List buscarPorDescricao(String descpago) { + return formaPagoDAO.buscarPorDescricao(descpago); + } + + public List buscarFormasPagoExceptoEspeciales() { + return formaPagoDAO.buscarTodosExceto(formasPagoEspeciales); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FuncionSistemaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FuncionSistemaServiceImpl.java new file mode 100644 index 000000000..29b6e152d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/FuncionSistemaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.FuncionSistemaDAO; +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import com.rjconsultores.ventaboletos.service.FuncionSistemaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("funcionSistemaService") +public class FuncionSistemaServiceImpl implements FuncionSistemaService { + + @Autowired + private FuncionSistemaDAO funcionSistemaDAO; + + public List obtenerTodos() { + return funcionSistemaDAO.obtenerTodos(); + } + + public FuncionSistema obtenerID(Integer id) { + return funcionSistemaDAO.obtenerID(id); + } + + @Transactional + public FuncionSistema suscribir(FuncionSistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return funcionSistemaDAO.suscribir(entidad); + } + + @Transactional + public FuncionSistema actualizacion(FuncionSistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return funcionSistemaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(FuncionSistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + funcionSistemaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GrupoCortesiasServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GrupoCortesiasServiceImpl.java new file mode 100644 index 000000000..40bee2664 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GrupoCortesiasServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.GrupoCortesiasDAO; +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.service.GrupoCortesiasService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("grupoCortesiaService") +public class GrupoCortesiasServiceImpl implements GrupoCortesiasService { + + @Autowired + private GrupoCortesiasDAO grupoCortesiasDAO; + + public List obtenerTodos() { + return grupoCortesiasDAO.obtenerTodos(); + } + + public GrupoCortesia obtenerID(Integer id) { + return grupoCortesiasDAO.obtenerID(id); + } + + @Transactional + public GrupoCortesia suscribir(GrupoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return grupoCortesiasDAO.suscribir(entidad); + } + + @Transactional + public GrupoCortesia actualizacion(GrupoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return grupoCortesiasDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GrupoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + grupoCortesiasDAO.actualizacion(entidad); + } + + public List buscar(String descgrupo) { + return grupoCortesiasDAO.buscar(descgrupo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/InformeCategoriaVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/InformeCategoriaVentaServiceImpl.java new file mode 100644 index 000000000..8ab08c109 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/InformeCategoriaVentaServiceImpl.java @@ -0,0 +1,92 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRResultSetDataSource; +import net.sf.jasperreports.engine.JasperRunManager; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.zkoss.util.media.AMedia; + +import com.rjconsultores.ventaboletos.dao.InformeCategoriaVentaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.InformeCategoriaVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; + +/** + * + * @author Administrador + */ +@Service("informeCategoriaVentaService") +public class InformeCategoriaVentaServiceImpl implements InformeCategoriaVentaService { + + @Autowired + private InformeCategoriaVentaDAO informeCategoriaVentaDAO; + @Autowired + private DataSource dataSource; + private static final Logger log = Logger.getLogger(InformeCategoriaVentaServiceImpl.class); + + public AMedia gerarInforme(InputStream informe, Map parameters) throws BusinessException{ + Connection conn = null; + AMedia amedia = null; + + try { + conn = dataSource.getConnection(); + + ResultSet rs = informeCategoriaVentaDAO.executarSQL(conn, parameters); + JRDataSource jrDataSource = new JRResultSetDataSource(rs); + + String nomeEmpresa = "TODAS"; + Empresa empresa = (Empresa) parameters.get("empresa"); + if (empresa != null) { + nomeEmpresa = empresa.getNombempresa().toUpperCase(); + } + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + Map args = new HashMap(); + args.put("nomeEmpresa", nomeEmpresa); + args.put("dataInicio", dataInicio); + args.put("dataFinal", dataFinal); + final byte[] buf = + JasperRunManager.runReportToPdf(informe, args, jrDataSource); + + final InputStream mediais = new ByteArrayInputStream(buf); + + amedia = new AMedia("categoriaVenta.pdf", "pdf", null, mediais); + } catch (JRException e) { + log.error("Erro al generar reporte", e); + throw new BusinessException("MSG.Error"); + } catch (SQLException e) { + log.error("Error al obtener una conexcion en el datasource", e); + throw new BusinessException("MSG.Error"); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + log.error("Error al cerrar la conexion", e); + } + } + } + + return amedia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/InformePasajeroServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/InformePasajeroServicioServiceImpl.java new file mode 100644 index 000000000..48cc307b2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/InformePasajeroServicioServiceImpl.java @@ -0,0 +1,91 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRResultSetDataSource; +import net.sf.jasperreports.engine.JasperRunManager; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.zkoss.util.media.AMedia; + +import com.rjconsultores.ventaboletos.dao.InformePasajeroServicioDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.InformePasajeroServicioService; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; + +/** + * + * @author Administrador + */ +@Service("informePasajeroServicioService") +public class InformePasajeroServicioServiceImpl implements InformePasajeroServicioService { + + @Autowired + private InformePasajeroServicioDAO informePasajeroServicioDAO; + @Autowired + private DataSource dataSource; + private static final Logger log = Logger.getLogger(InformePasajeroServicioServiceImpl.class); + + public AMedia gerarInforme(InputStream informe, Map parameters) throws BusinessException { + Connection conn = null; + AMedia amedia = null; + + try { + conn = dataSource.getConnection(); + + ResultSet rs = informePasajeroServicioDAO.executarSQL(conn, parameters); + JRDataSource jrDataSource = new JRResultSetDataSource(rs); + + String nomeEmpresa = "TODAS"; + Empresa empresa = (Empresa) parameters.get("empresa"); + if (empresa != null) { + nomeEmpresa = empresa.getNombempresa().toUpperCase(); + } + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + Map args = new HashMap(); + args.put("empresa", nomeEmpresa); + args.put("dataInicio", dataInicio); + args.put("dataFinal", dataFinal); + final byte[] buf = JasperRunManager.runReportToPdf(informe, args, jrDataSource); + + final InputStream mediais = new ByteArrayInputStream(buf); + + amedia = new AMedia("pasajeroServicio.pdf", "pdf", null, mediais); + } catch (JRException e) { + log.error("Erro al generar reporte", e); + throw new BusinessException("MSG.Error"); + } catch (SQLException e) { + log.error("Error al obtener una conexcion en el datasource", e); + throw new BusinessException("MSG.Error"); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + log.error("Error al cerrar la conexion", e); + } + } + } + + return amedia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/InformeServicioDiarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/InformeServicioDiarioServiceImpl.java new file mode 100644 index 000000000..7f5be17b5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/InformeServicioDiarioServiceImpl.java @@ -0,0 +1,89 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRResultSetDataSource; +import net.sf.jasperreports.engine.JasperRunManager; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.zkoss.util.media.AMedia; + +import com.rjconsultores.ventaboletos.dao.InformeServicioDiarioDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.InformeServicioDiarioService; + +/** + * + * @author Administrador + */ +@Service("informeServicioDiarioService") +public class InformeServicioDiarioServiceImpl implements InformeServicioDiarioService { + + @Autowired + private InformeServicioDiarioDAO informeServicioDiarioDAO; + @Autowired + private DataSource dataSource; + private static final Logger log = Logger.getLogger(InformeServicioDiarioServiceImpl.class); + + public AMedia gerarInforme(InputStream informe, Map parameters) throws BusinessException { + AMedia amedia = null; + Connection conn = null; + try { + conn = dataSource.getConnection(); + ResultSet rs = informeServicioDiarioDAO.executarSQL(conn, parameters); + JRDataSource jrDataSource = new JRResultSetDataSource(rs); + + String nomeEmpresa = "TODAS"; + Empresa empresa = (Empresa) parameters.get("empresa"); + if (empresa != null) { + nomeEmpresa = empresa.getNombempresa().toUpperCase(); + } + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + Map args = new HashMap(); + args.put("nomeEmpresa", nomeEmpresa); + args.put("dataInicio", dataInicio); + args.put("dataFinal", dataFinal); + final byte[] buf = + JasperRunManager.runReportToPdf(informe, args, jrDataSource); + + final InputStream mediais = new ByteArrayInputStream(buf); + + amedia = new AMedia("servicioDiario.pdf", "pdf", null, mediais); + } catch (JRException e) { + log.error("Erro al generar reporte", e); + throw new BusinessException("MSG.Error"); + } catch (SQLException e) { + log.error("Error al obtener una conexcion en el datasource", e); + throw new BusinessException("MSG.Error"); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + log.error("Error al cerrar la conexion", e); + } + } + } + + return amedia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/InformeVentasPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/InformeVentasPuntoVentaServiceImpl.java new file mode 100644 index 000000000..ef77be93d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/InformeVentasPuntoVentaServiceImpl.java @@ -0,0 +1,84 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRResultSetDataSource; +import net.sf.jasperreports.engine.JasperRunManager; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.zkoss.util.media.AMedia; + +import com.rjconsultores.ventaboletos.dao.InformeVentasPuntoVentaDAO; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.InformeVentasPuntoVentaService; + +/** + * + * @author Administrador + */ +@Service("informeVentasPuntoVentaService") +public class InformeVentasPuntoVentaServiceImpl implements InformeVentasPuntoVentaService { + + @Autowired + private InformeVentasPuntoVentaDAO informeVentasPuntoVentaDAO; + @Autowired + private DataSource dataSource; + private static final Logger log = Logger.getLogger(InformeVentasPuntoVentaServiceImpl.class); + + public AMedia gerarInforme(InputStream informe, Map parameters) throws BusinessException { + Connection conn = null; + AMedia amedia = null; + + try { + conn = dataSource.getConnection(); + + ResultSet rs = informeVentasPuntoVentaDAO.executarSQL(conn, parameters); + JRDataSource jrDataSource = new JRResultSetDataSource(rs); + + Date dataInicio = (Date) parameters.get("dataInicio"); + Date dataFinal = (Date) parameters.get("dataFinal"); + Map args = new HashMap(); + args.put("dataInicio", dataInicio); + args.put("dataFinal", dataFinal); + final byte[] buf = + JasperRunManager.runReportToPdf(informe, args, jrDataSource); + + final InputStream mediais = new ByteArrayInputStream(buf); + + amedia = new AMedia("ventasPuntoVenta.pdf", "pdf", null, mediais); + } catch (JRException e) { + log.error("Erro al generar reporte", e); + throw new BusinessException("MSG.Error"); + } catch (SQLException e) { + log.error("Error al obtener una conexcion en el datasource", e); + throw new BusinessException("MSG.Error"); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + log.error("Error al cerrar la conexion", e); + } + } + } + + return amedia; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MarcaClaseServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MarcaClaseServicioServiceImpl.java new file mode 100644 index 000000000..30e13e659 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MarcaClaseServicioServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MarcaClaseServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicioPK; +import com.rjconsultores.ventaboletos.service.MarcaClaseServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("marcaClaseServicioService") +public class MarcaClaseServicioServiceImpl implements MarcaClaseServicioService { + + @Autowired + private MarcaClaseServicioDAO marcaClaseServicioDAO; + + public List obtenerTodos() { + return marcaClaseServicioDAO.obtenerTodos(); + } + + public MarcaClaseServicio obtenerID(MarcaClaseServicioPK id) { + return marcaClaseServicioDAO.obtenerID(id); + } + + @Transactional + public MarcaClaseServicio suscribir(MarcaClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return marcaClaseServicioDAO.suscribir(entidad); + } + + @Transactional + public MarcaClaseServicio actualizacion(MarcaClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return marcaClaseServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MarcaClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + marcaClaseServicioDAO.actualizacion(entidad); + } + + public List buscar(ClaseServicio clase) { + return marcaClaseServicioDAO.buscar(clase); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MarcaServiceImpl.java new file mode 100644 index 000000000..60009d50f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MarcaServiceImpl.java @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MarcaDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("marcaService") +public class MarcaServiceImpl implements MarcaService { + + @Autowired + private MarcaDAO marcaDAO; + + public List obtenerTodos() { + return marcaDAO.obtenerTodos(); + } + + public Marca obtenerID(Short id) { + return marcaDAO.obtenerID(id); + } + + @Transactional + public Marca suscribir(Marca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return marcaDAO.suscribir(entidad); + } + + @Transactional + public Marca actualizacion(Marca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return marcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Marca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + marcaDAO.actualizacion(entidad); + } + + public List buscarPorNome(String nomeMarca) { + return marcaDAO.buscarPorNome(nomeMarca); + } + + public List buscarTodosExceto(Integer... idMarca) { + return marcaDAO.buscarTodosExceto(idMarca); + } + + @Override + public List buscarDescricaoIdMarca() { + return marcaDAO.buscarDescricaoIdMarca(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MercadoCompetidoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MercadoCompetidoServiceImpl.java new file mode 100644 index 000000000..c1baabe2e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MercadoCompetidoServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MercadoCompetidoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("mercadoCompetidoService") +public class MercadoCompetidoServiceImpl implements MercadoCompetidoService { + + @Autowired + private MercadoCompetidoDAO mercadoCompetidoDAO; + + public List obtenerTodos() { + return mercadoCompetidoDAO.obtenerTodos(); + } + + public MercadoCompetido obtenerID(Integer id) { + return mercadoCompetidoDAO.obtenerID(id); + } + + @Transactional + public MercadoCompetido suscribir(MercadoCompetido entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return mercadoCompetidoDAO.suscribir(entidad); + } + + @Transactional + public MercadoCompetido actualizacion(MercadoCompetido entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return mercadoCompetidoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MercadoCompetido entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + mercadoCompetidoDAO.actualizacion(entidad); + } + + public boolean existe(ClaseServicio claseServicio, Parada origem, + Parada destino) { + return mercadoCompetidoDAO.existe(claseServicio, origem, destino); + } + + public List buscar(Parada origem, Parada destino) { + return mercadoCompetidoDAO.buscar(origem, destino); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MerchantBancarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MerchantBancarioServiceImpl.java new file mode 100644 index 000000000..130d96ff1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MerchantBancarioServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MerchantBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import com.rjconsultores.ventaboletos.service.MerchantBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("merchantBancarioService") +public class MerchantBancarioServiceImpl implements MerchantBancarioService { + + @Autowired + private MerchantBancarioDAO merchantBancarioDAO; + + public List obtenerTodos() { + return merchantBancarioDAO.obtenerTodos(); + } + + public MerchantBancario obtenerID(Integer id) { + return merchantBancarioDAO.obtenerID(id); + } + + @Transactional + public MerchantBancario suscribir(MerchantBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return merchantBancarioDAO.suscribir(entidad); + } + + @Transactional + public MerchantBancario actualizacion(MerchantBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return merchantBancarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MerchantBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + merchantBancarioDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MonedaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MonedaServiceImpl.java new file mode 100644 index 000000000..6117f1fef --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MonedaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MonedaDAO; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("monedaService") +public class MonedaServiceImpl implements MonedaService { + + @Autowired + private MonedaDAO monedaDAO; + + public List obtenerTodos() { + return monedaDAO.obtenerTodos(); + } + + public Moneda obtenerID(Integer id) { + return monedaDAO.obtenerID(id); + } + + @Transactional + public Moneda suscribir(Moneda entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return monedaDAO.suscribir(entidad); + } + + @Transactional + public Moneda actualizacion(Moneda entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return monedaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Moneda entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + monedaDAO.actualizacion(entidad); + } + + public List buscar(String descmoneda) { + return monedaDAO.buscar(descmoneda); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MotivoCancelacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MotivoCancelacionServiceImpl.java new file mode 100644 index 000000000..dd658fabf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MotivoCancelacionServiceImpl.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("motivoCancelacionService") +public class MotivoCancelacionServiceImpl implements MotivoCancelacionService { + + @Autowired + private MotivoCancelacionDAO motivoCancelacionDAO; + + public List obtenerTodos() { + return motivoCancelacionDAO.obtenerTodos(); + } + + public MotivoCancelacion obtenerID(Integer id) { + return motivoCancelacionDAO.obtenerID(id); + } + + @Transactional + public MotivoCancelacion suscribir(MotivoCancelacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoCancelacionDAO.suscribir(entidad); + } + + @Transactional + public MotivoCancelacion actualizacion(MotivoCancelacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoCancelacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MotivoCancelacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + motivoCancelacionDAO.actualizacion(entidad); + } + + public List buscar(String descmotivo, String tipomotivo) { + return motivoCancelacionDAO.buscar(descmotivo, tipomotivo); + } + + public List obtenerTodosTipoMotivoB() { + return motivoCancelacionDAO.obtenerTodosTipoMotivoB(); + } + + public List obtenerTodosEspecificos(Integer[] motivos) { + return motivoCancelacionDAO.obtenerTodosEspecificos(motivos); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MotivoReimpresionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MotivoReimpresionServiceImpl.java new file mode 100644 index 000000000..d163421f8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MotivoReimpresionServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MotivoReimpresionDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import com.rjconsultores.ventaboletos.service.MotivoReimpresionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("motivoReimpresionService") +public class MotivoReimpresionServiceImpl implements MotivoReimpresionService { + + @Autowired + private MotivoReimpresionDAO motivoReimpresionDAO; + + public List obtenerTodos() { + return motivoReimpresionDAO.obtenerTodos(); + } + + public MotivoReimpresion obtenerID(Integer id) { + return motivoReimpresionDAO.obtenerID(id); + } + + @Transactional + public MotivoReimpresion suscribir(MotivoReimpresion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoReimpresionDAO.suscribir(entidad); + } + + @Transactional + public MotivoReimpresion actualizacion(MotivoReimpresion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoReimpresionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MotivoReimpresion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + motivoReimpresionDAO.actualizacion(entidad); + } + + public List buscar(String descmotivo) { + return motivoReimpresionDAO.buscar(descmotivo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MotivoViajeServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MotivoViajeServiceImpl.java new file mode 100644 index 000000000..d64c6a0ca --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MotivoViajeServiceImpl.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MotivoViajeDAO; +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; +import com.rjconsultores.ventaboletos.service.MotivoViajeService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("motivoViajeService") +public class MotivoViajeServiceImpl implements MotivoViajeService { + + @Autowired + private MotivoViajeDAO motivoViajeDAO; + + public List obtenerTodos() { + return motivoViajeDAO.obtenerTodos(); + } + + public MotivoViaje obtenerID(Integer id) { + return motivoViajeDAO.obtenerID(id); + } + + @Transactional + public MotivoViaje suscribir(MotivoViaje entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoViajeDAO.suscribir(entidad); + } + + @Transactional + public MotivoViaje actualizacion(MotivoViaje entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivoViajeDAO.actualizacion(entidad); + + } + + @Transactional + public void borrar(MotivoViaje entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + motivoViajeDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/MotivocancelacionEquivalenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/MotivocancelacionEquivalenciaServiceImpl.java new file mode 100644 index 000000000..e37acc8bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/MotivocancelacionEquivalenciaServiceImpl.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.MotivocancelacionEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import com.rjconsultores.ventaboletos.service.MotivocancelacionEquivalenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("motivocancelacionEquivalenciaService") +public class MotivocancelacionEquivalenciaServiceImpl + implements MotivocancelacionEquivalenciaService { + + @Autowired + private MotivocancelacionEquivalenciaDAO motivocancelacionEquivalenciaDAO; + + public List obtenerTodos() { + return motivocancelacionEquivalenciaDAO.obtenerTodos(); + } + + public MotivocancelacionEquivalencia obtenerID(Integer id) { + return motivocancelacionEquivalenciaDAO.obtenerID(id); + } + + @Transactional + public MotivocancelacionEquivalencia suscribir(MotivocancelacionEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivocancelacionEquivalenciaDAO.suscribir(entidad); + } + + @Transactional + public MotivocancelacionEquivalencia actualizacion(MotivocancelacionEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return motivocancelacionEquivalenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(MotivocancelacionEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + motivocancelacionEquivalenciaDAO.actualizacion(entidad); + } + + public List buscar(ComisionistaExterno comisionistaExterno, + MotivoCancelacion motivoCancelacion) { + return motivocancelacionEquivalenciaDAO.buscar(comisionistaExterno, motivoCancelacion); + } + + public List buscarEquivalencia(MotivocancelacionEquivalencia motivoCancelacionEquivalencia) { + return motivocancelacionEquivalenciaDAO.buscarEquivalencia(motivoCancelacionEquivalencia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/NodoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/NodoServiceImpl.java new file mode 100644 index 000000000..ed9a09feb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/NodoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.NodoDAO; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.service.NodoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("nodoService") +public class NodoServiceImpl implements NodoService { + + @Autowired + private NodoDAO nodoDAO; + + public List obtenerTodos() { + return nodoDAO.obtenerTodos(); + } + + public Nodo obtenerID(Integer id) { + return nodoDAO.obtenerID(id); + } + + @Transactional + public Nodo suscribir(Nodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return nodoDAO.suscribir(entidad); + } + + @Transactional + public Nodo actualizacion(Nodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return nodoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Nodo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + nodoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PaisServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PaisServiceImpl.java new file mode 100644 index 000000000..d13f543f0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PaisServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PaisDAO; +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.service.PaisService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("paisService") +public class PaisServiceImpl implements PaisService { + + @Autowired + private PaisDAO paisDAO; + + public List obtenerTodos() { + return paisDAO.obtenerTodos(); + } + + public Pais obtenerID(Integer id) { + return paisDAO.obtenerID(id); + } + + @Transactional + public Pais suscribir(Pais entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paisDAO.suscribir(entidad); + } + + @Transactional + public Pais actualizacion(Pais entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paisDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Pais entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paisDAO.actualizacion(entidad); + } + + public List buscar(String nombpais) { + return paisDAO.buscar(nombpais); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParadaEquivalenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParadaEquivalenciaServiceImpl.java new file mode 100644 index 000000000..afdb132cd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParadaEquivalenciaServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParadaEquivalenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import com.rjconsultores.ventaboletos.service.ParadaEquivalenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("paradaEquivalenciaService") +public class ParadaEquivalenciaServiceImpl implements ParadaEquivalenciaService { + + @Autowired + private ParadaEquivalenciaDAO paradaEquivalenciaDAO; + + public List obtenerTodos() { + return paradaEquivalenciaDAO.obtenerTodos(); + } + + public ParadaEquivalencia obtenerID(Integer id) { + return paradaEquivalenciaDAO.obtenerID(id); + } + + @Transactional + public ParadaEquivalencia suscribir(ParadaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paradaEquivalenciaDAO.suscribir(entidad); + } + + @Transactional + public ParadaEquivalencia actualizacion(ParadaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paradaEquivalenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParadaEquivalencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paradaEquivalenciaDAO.actualizacion(entidad); + } + + public List buscar(Parada parada, + ComisionistaExterno comisionistaExterno, String equivalencia) { + return paradaEquivalenciaDAO.buscar(parada, comisionistaExterno, equivalencia); + } + + public List buscarEquivalencia(String equivalencia) { + return paradaEquivalenciaDAO.buscarEquivalencia(equivalencia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParadaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParadaServiceImpl.java new file mode 100644 index 000000000..a6f0e2663 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParadaServiceImpl.java @@ -0,0 +1,89 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParadaDAO; +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("paradaService") +public class ParadaServiceImpl implements ParadaService { + + @Autowired + private ParadaDAO paradaDAO; + @Autowired + private TramoDAO tramoDAO; + + public List obtenerTodos() { + return paradaDAO.obtenerTodos(); + } + + public Parada obtenerID(Integer id) { + return paradaDAO.obtenerID(id); + } + + @Transactional + public Parada suscribir(Parada entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paradaDAO.suscribir(entidad); + } + + @Transactional + public Parada actualizacion(Parada entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paradaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Parada entidad) throws RegistroConDependenciaException { + if ((tramoDAO.count("origem", entidad) > 0l) + || (tramoDAO.count("destino", entidad) > 0l)) { + throw new RegistroConDependenciaException(); + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paradaDAO.actualizacion(entidad); + } + + public List buscar(String descparada, String cveparada, Ciudad ciudad, + TipoParada tipoParada, Nodo nodo) { + return paradaDAO.buscar(descparada, cveparada, ciudad, tipoParada, nodo); + } + + public List buscar(String descparada) { + return paradaDAO.buscar(descparada); + } + + public List buscarCVE(String cveparada) { + return paradaDAO.buscarCVE(cveparada); + } + + public List buscaLike(String descparada) { + return paradaDAO.buscaLike(descparada); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaMasivoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaMasivoServiceImpl.java new file mode 100644 index 000000000..83fa27645 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaMasivoServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamAcumulaMasivoDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import com.rjconsultores.ventaboletos.service.ParamAcumulaMasivoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("paramAcumulaMasivoService") +public class ParamAcumulaMasivoServiceImpl implements ParamAcumulaMasivoService { + + @Autowired + private ParamAcumulaMasivoDAO paramAcumulaMasivoDAO; + + public List obtenerTodos() { + return paramAcumulaMasivoDAO.obtenerTodos(); + } + + public ParamAcumulaMasivo obtenerID(Integer id) { + return paramAcumulaMasivoDAO.obtenerID(id); + } + + @Transactional + public ParamAcumulaMasivo suscribir(ParamAcumulaMasivo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramAcumulaMasivoDAO.suscribir(entidad); + } + + @Transactional + public ParamAcumulaMasivo actualizacion(ParamAcumulaMasivo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramAcumulaMasivoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamAcumulaMasivo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramAcumulaMasivoDAO.actualizacion(entidad); + } + + public List buscar(ParamAcumulaMasivo paramAcumulaMasivo) { + return paramAcumulaMasivoDAO.buscar(paramAcumulaMasivo); + } + + public List buscar(Empresa emp, Integer min, Integer max, Date fecIni, Date fecFim) { + return paramAcumulaMasivoDAO.buscar(emp, min, max, fecIni, fecFim); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaPuntoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaPuntoServiceImpl.java new file mode 100644 index 000000000..22ec106c1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamAcumulaPuntoServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamAcumulaPuntoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import com.rjconsultores.ventaboletos.service.ParamAcumulaPuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("paramAcumulaPuntoService") +public class ParamAcumulaPuntoServiceImpl implements ParamAcumulaPuntoService { + + @Autowired + private ParamAcumulaPuntoDAO paramAcumulaPuntoDAO; + + public List obtenerTodos() { + return paramAcumulaPuntoDAO.obtenerTodos(); + } + + public ParamAcumulaPunto obtenerID(Integer id) { + return paramAcumulaPuntoDAO.obtenerID(id); + } + + @Transactional + public ParamAcumulaPunto suscribir(ParamAcumulaPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramAcumulaPuntoDAO.suscribir(entidad); + } + + @Transactional + public ParamAcumulaPunto actualizacion(ParamAcumulaPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramAcumulaPuntoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamAcumulaPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramAcumulaPuntoDAO.actualizacion(entidad); + } + + public List buscar(Parada origem, Parada destino, Date ini, Date fim) { + return paramAcumulaPuntoDAO.buscar(origem, destino, ini, fim); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamArticuloServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamArticuloServiceImpl.java new file mode 100644 index 000000000..cc10e247c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamArticuloServiceImpl.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.ParamArticuloDAO; +import com.rjconsultores.ventaboletos.entidad.ParamArticulo; +import com.rjconsultores.ventaboletos.service.ParamArticuloService; + +/** + * + * @author Administrador + */ +@Service("paramArticuloService") +public class ParamArticuloServiceImpl implements ParamArticuloService { + + @Autowired + private ParamArticuloDAO paramArticuloDAO; + + public List obtenerTodos() { + return paramArticuloDAO.obtenerTodos(); + } + + public ParamArticulo obtenerID(Integer id) { + return paramArticuloDAO.obtenerID(id); + } + + @Transactional + public ParamArticulo suscribir(ParamArticulo entidad) { + + return paramArticuloDAO.suscribir(entidad); + } + + @Transactional + public ParamArticulo actualizacion(ParamArticulo entidad) { + + return paramArticuloDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamArticulo entidad) { + + paramArticuloDAO.actualizacion(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamCanjePuntoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamCanjePuntoServiceImpl.java new file mode 100644 index 000000000..7be46374e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamCanjePuntoServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamCanjePuntoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import com.rjconsultores.ventaboletos.service.ParamCanjePuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("paramCanjePuntoService") +public class ParamCanjePuntoServiceImpl implements ParamCanjePuntoService { + + @Autowired + private ParamCanjePuntoDAO paramCanjePuntoDAO; + + public List obtenerTodos() { + return paramCanjePuntoDAO.obtenerTodos(); + } + + public ParamCanjePunto obtenerID(Integer id) { + return paramCanjePuntoDAO.obtenerID(id); + } + + @Transactional + public ParamCanjePunto suscribir(ParamCanjePunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCanjePuntoDAO.suscribir(entidad); + } + + @Transactional + public ParamCanjePunto actualizacion(ParamCanjePunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCanjePuntoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamCanjePunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramCanjePuntoDAO.actualizacion(entidad); + } + + public List buscar(Parada origem, Parada destino, Date ini, Date fim) { + return paramCanjePuntoDAO.buscar(origem, destino, ini, fim); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamCompraPuntoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamCompraPuntoServiceImpl.java new file mode 100644 index 000000000..744110144 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamCompraPuntoServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamCompraPuntoDAO; +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import com.rjconsultores.ventaboletos.service.ParamCompraPuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("paramCompraPuntoService") +public class ParamCompraPuntoServiceImpl implements ParamCompraPuntoService { + + @Autowired + private ParamCompraPuntoDAO paramCompraPuntoDAO; + + public List obtenerTodos() { + return paramCompraPuntoDAO.obtenerTodos(); + } + + public ParamCompraPunto obtenerID(Integer id) { + return paramCompraPuntoDAO.obtenerID(id); + } + + @Transactional + public ParamCompraPunto suscribir(ParamCompraPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCompraPuntoDAO.suscribir(entidad); + } + + @Transactional + public ParamCompraPunto actualizacion(ParamCompraPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCompraPuntoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamCompraPunto entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramCompraPuntoDAO.actualizacion(entidad); + } + + public List buscar(Date ini, Date fim) { + return paramCompraPuntoDAO.buscar(ini, fim); + } + + public List buscar(Date ini, Date fim, Integer cantPuntos, BigDecimal costoPunto) { + return paramCompraPuntoDAO.buscar(ini, fim, cantPuntos, costoPunto); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamCostoTarjetaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamCostoTarjetaServiceImpl.java new file mode 100644 index 000000000..2b5c18c90 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamCostoTarjetaServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamCostoTarjetaDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import com.rjconsultores.ventaboletos.service.ParamCostoTarjetaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("paramCostoTarjetaService") +public class ParamCostoTarjetaServiceImpl implements ParamCostoTarjetaService { + + @Autowired + private ParamCostoTarjetaDAO paramCostoTarjetaDAO; + + public List obtenerTodos() { + return paramCostoTarjetaDAO.obtenerTodos(); + } + + public ParamCostoTarjeta obtenerID(Integer id) { + return paramCostoTarjetaDAO.obtenerID(id); + } + + @Transactional + public ParamCostoTarjeta suscribir(ParamCostoTarjeta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCostoTarjetaDAO.suscribir(entidad); + } + + @Transactional + public ParamCostoTarjeta actualizacion(ParamCostoTarjeta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramCostoTarjetaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamCostoTarjeta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramCostoTarjetaDAO.actualizacion(entidad); + } + + public List buscar(ParamCostoTarjeta paramCostoTarjeta) { + return paramCostoTarjetaDAO.buscar(paramCostoTarjeta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ParamRecoleccionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ParamRecoleccionServiceImpl.java new file mode 100644 index 000000000..48d39d24b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ParamRecoleccionServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParamRecoleccionDAO; +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; +import com.rjconsultores.ventaboletos.service.ParamRecoleccionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("paramRecoleccionService") +public class ParamRecoleccionServiceImpl implements ParamRecoleccionService { + + @Autowired + private ParamRecoleccionDAO paramRecoleccionDAO; + + public List obtenerTodos() { + return paramRecoleccionDAO.obtenerTodos(); + } + + public ParamRecoleccion obtenerID(Integer id) { + return paramRecoleccionDAO.obtenerID(id); + } + + @Transactional + public ParamRecoleccion suscribir(ParamRecoleccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramRecoleccionDAO.suscribir(entidad); + } + + @Transactional + public ParamRecoleccion actualizacion(ParamRecoleccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return paramRecoleccionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ParamRecoleccion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + paramRecoleccionDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PerfilFuncionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PerfilFuncionServiceImpl.java new file mode 100644 index 000000000..a88c99492 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PerfilFuncionServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PerfilFuncionDAO; +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; +import com.rjconsultores.ventaboletos.service.PerfilFuncionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("perfilFuncionService") +public class PerfilFuncionServiceImpl implements PerfilFuncionService { + + @Autowired + private PerfilFuncionDAO perfilFuncionDAO; + + public List obtenerTodos() { + return perfilFuncionDAO.obtenerTodos(); + } + + public PerfilFuncion obtenerID(Integer id) { + return perfilFuncionDAO.obtenerID(id); + } + + @Transactional + public PerfilFuncion suscribir(PerfilFuncion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return perfilFuncionDAO.suscribir(entidad); + } + + @Transactional + public PerfilFuncion actualizacion(PerfilFuncion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return perfilFuncionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PerfilFuncion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + perfilFuncionDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PerfilServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PerfilServiceImpl.java new file mode 100644 index 000000000..dad4d8d08 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PerfilServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("perfilService") +public class PerfilServiceImpl implements PerfilService { + + @Autowired + private PerfilDAO perfilDAO; + + public List obtenerTodos() { + return perfilDAO.obtenerTodos(); + } + + public Perfil obtenerID(Integer id) { + return perfilDAO.obtenerID(id); + } + + @Transactional + public Perfil suscribir(Perfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return perfilDAO.suscribir(entidad); + } + + @Transactional + public Perfil actualizacion(Perfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return perfilDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Perfil entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + perfilDAO.actualizacion(entidad); + } + + public List buscar(String dscPerfil) { + return perfilDAO.buscar(dscPerfil); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PeriodoVacacionalServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PeriodoVacacionalServiceImpl.java new file mode 100644 index 000000000..dde4476d9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PeriodoVacacionalServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PeriodoVacacionalDAO; +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import com.rjconsultores.ventaboletos.service.PeriodoVacacionalService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("periodoVacacionalService") +public class PeriodoVacacionalServiceImpl implements PeriodoVacacionalService { + + @Autowired + private PeriodoVacacionalDAO periodoVacacionalDAO; + + public List obtenerTodos() { + return periodoVacacionalDAO.obtenerTodos(); + } + + public PeriodoVacacional obtenerID(Integer id) { + return periodoVacacionalDAO.obtenerID(id); + } + + @Transactional + public PeriodoVacacional suscribir(PeriodoVacacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return periodoVacacionalDAO.suscribir(entidad); + } + + @Transactional + public PeriodoVacacional actualizacion(PeriodoVacacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return periodoVacacionalDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PeriodoVacacional entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + periodoVacacionalDAO.actualizacion(entidad); + } + + public List buscar(Date dataInicio, Date dataFim) { + return periodoVacacionalDAO.buscar(dataInicio, dataFim); + } + + public List buscarFechaTraslapa(PeriodoVacacional periodoVacacional) { + return periodoVacacionalDAO.buscarFechaTraslapa(periodoVacacional); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PlazaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PlazaServiceImpl.java new file mode 100644 index 000000000..11650129e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PlazaServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PlazaDAO; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("plazaService") +public class PlazaServiceImpl implements PlazaService { + + @Autowired + private PlazaDAO plazaDAO; + + public List obtenerTodos() { + return plazaDAO.obtenerTodos(); + } + + public Plaza obtenerID(Integer id) { + return plazaDAO.obtenerID(id); + } + + @Transactional + public Plaza suscribir(Plaza entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return plazaDAO.suscribir(entidad); + } + + @Transactional + public Plaza actualizacion(Plaza entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return plazaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Plaza entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + plazaDAO.actualizacion(entidad); + } + + public List buscar(String nombplaza) { + return plazaDAO.buscar(nombplaza); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingAnticipacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingAnticipacionServiceImpl.java new file mode 100644 index 000000000..1b2597170 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingAnticipacionServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingAnticipacionDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import com.rjconsultores.ventaboletos.service.PricingAnticipacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("pricingAnticipacionService") +public class PricingAnticipacionServiceImpl implements PricingAnticipacionService { + + @Autowired + private PricingAnticipacionDAO pricingAnticipacionDAO; + + public List obtenerTodos() { + return pricingAnticipacionDAO.obtenerTodos(); + } + + public PricingAnticipacion obtenerID(Integer id) { + return pricingAnticipacionDAO.obtenerID(id); + } + + @Transactional + public PricingAnticipacion suscribir(PricingAnticipacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingAnticipacionDAO.suscribir(entidad); + } + + @Transactional + public PricingAnticipacion actualizacion(PricingAnticipacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingAnticipacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingAnticipacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingAnticipacionDAO.actualizacion(entidad); + } + + public List obtenerPorPricing(Pricing pricing) { + return pricingAnticipacionDAO.obtenerPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java new file mode 100644 index 000000000..f41d84458 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import com.rjconsultores.ventaboletos.service.PricingAsientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingAsientoService") +public class PricingAsientoServiceImpl implements PricingAsientoService { + + @Autowired + private PricingAsientoDAO pricingAsientoDAO; + + public List obtenerTodos() { + return pricingAsientoDAO.obtenerTodos(); + } + + public PricingAsiento obtenerID(Integer id) { + return pricingAsientoDAO.obtenerID(id); + } + + @Transactional + public PricingAsiento suscribir(PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingAsientoDAO.suscribir(entidad); + } + + @Transactional + public PricingAsiento actualizacion(PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingAsientoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingAsientoDAO.actualizacion(entidad); + } + + public List obtenerPricingCategoria(Pricing pricing, Integer asiento) { + return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java new file mode 100644 index 000000000..e576e01cd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import com.rjconsultores.ventaboletos.service.PricingCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingCategoriaService") +public class PricingCategoriaServiceImpl implements PricingCategoriaService { + + @Autowired + private PricingCategoriaDAO pricingCategoriaDAO; + + public List obtenerTodos() { + return pricingCategoriaDAO.obtenerTodos(); + } + + public PricingCategoria obtenerID(Integer id) { + return pricingCategoriaDAO.obtenerID(id); + } + + @Transactional + public PricingCategoria suscribir(PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingCategoriaDAO.suscribir(entidad); + } + + @Transactional + public PricingCategoria actualizacion(PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingCategoriaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingCategoriaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria) { + return pricingCategoriaDAO.obtenerPricingCategoria(pricing, categoria); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java new file mode 100644 index 000000000..df791acbf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.service.PricingClaseService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingClaseService") +public class PricingClaseServiceImpl implements PricingClaseService { + + @Autowired + private PricingClaseDAO pricingClaseDAO; + + public List obtenerTodos() { + return pricingClaseDAO.obtenerTodos(); + } + + public PricingClase obtenerID(Integer id) { + return pricingClaseDAO.obtenerID(id); + } + + @Transactional + public PricingClase suscribir(PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingClaseDAO.suscribir(entidad); + } + + @Transactional + public PricingClase actualizacion(PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingClaseDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingClaseDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio) { + return pricingClaseDAO.obtenerPricingClase(pricing, claseServicio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java new file mode 100644 index 000000000..a0036cd27 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import com.rjconsultores.ventaboletos.service.PricingCorridaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingCorridaService") +public class PricingCorridaServiceImpl implements PricingCorridaService { + + @Autowired + private PricingCorridaDAO pricingCorridaDAO; + + public List obtenerTodos() { + return pricingCorridaDAO.obtenerTodos(); + } + + public PricingCorrida obtenerID(Integer id) { + return pricingCorridaDAO.obtenerID(id); + } + + @Transactional + public PricingCorrida suscribir(PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingCorridaDAO.suscribir(entidad); + } + + @Transactional + public PricingCorrida actualizacion(PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingCorridaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingCorridaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida) { + return pricingCorridaDAO.obtenerPricingCorrida(pricing, corrida); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java new file mode 100644 index 000000000..d24294386 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingDiaDAO; +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import com.rjconsultores.ventaboletos.service.PricingDiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingDiaService") +public class PricingDiaServiceImpl implements PricingDiaService { + + @Autowired + private PricingDiaDAO pricingDiaDAO; + + public List obtenerTodos() { + return pricingDiaDAO.obtenerTodos(); + } + + public PricingDia obtenerID(Integer id) { + return pricingDiaDAO.obtenerID(id); + } + + @Transactional + public PricingDia suscribir(PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingDiaDAO.suscribir(entidad); + } + + @Transactional + public PricingDia actualizacion(PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingDiaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingDiaDAO.actualizacion(entidad); + } + + public List buscarTraslapa(PricingDia pricingDia) { + return pricingDiaDAO.buscarTraslapa(pricingDia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingEspecificoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingEspecificoServiceImpl.java new file mode 100644 index 000000000..07519f2e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingEspecificoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingEspecificoDAO; +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import com.rjconsultores.ventaboletos.service.PricingEspecificoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingEspecificoService") +public class PricingEspecificoServiceImpl implements PricingEspecificoService { + + @Autowired + private PricingEspecificoDAO pricingEspecificoDAO; + + public List obtenerTodos() { + return pricingEspecificoDAO.obtenerTodos(); + } + + public PricingEspecifico obtenerID(Integer id) { + return pricingEspecificoDAO.obtenerID(id); + } + + @Transactional + public PricingEspecifico suscribir(PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoDAO.suscribir(entidad); + } + + @Transactional + public PricingEspecifico actualizacion(PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoDAO.actualizacion(entidad); + } + + public List buscarPorNome(PricingEspecifico pricingEspecifico) { + return pricingEspecificoDAO.buscarPorNome(pricingEspecifico); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingImporteServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingImporteServiceImpl.java new file mode 100644 index 000000000..1a6709dbf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingImporteServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingImporteDAO; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import com.rjconsultores.ventaboletos.service.PricingImporteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingImporteService") +public class PricingImporteServiceImpl implements PricingImporteService { + + @Autowired + private PricingImporteDAO pricingImporteDAO; + + public List obtenerTodos() { + return pricingImporteDAO.obtenerTodos(); + } + + public PricingImporte obtenerID(Integer id) { + return pricingImporteDAO.obtenerID(id); + } + + @Transactional + public PricingImporte suscribir(PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingImporteDAO.suscribir(entidad); + } + + @Transactional + public PricingImporte actualizacion(PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingImporteDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingImporteDAO.actualizacion(entidad); + } + + public List buscarMoneda(PricingImporte pricingImporte, Moneda moneda) { + return pricingImporteDAO.buscarMoneda(pricingImporte, moneda); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java new file mode 100644 index 000000000..16abdc5c0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import com.rjconsultores.ventaboletos.service.PricingMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingMarcaService") +public class PricingMarcaServiceImpl implements PricingMarcaService { + + @Autowired + private PricingMarcaDAO pricingMarcaDAO; + + public List obtenerTodos() { + return pricingMarcaDAO.obtenerTodos(); + } + + public PricingMarca obtenerID(Integer id) { + return pricingMarcaDAO.obtenerID(id); + } + + @Transactional + public PricingMarca suscribir(PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingMarcaDAO.suscribir(entidad); + } + + @Transactional + public PricingMarca actualizacion(PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingMarcaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingMarca(Pricing pricing, Marca marca) { + return pricingMarcaDAO.obtenerPricingMarca(pricing,marca); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java new file mode 100644 index 000000000..6d356433e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import com.rjconsultores.ventaboletos.service.PricingMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingMercadoService") +public class PricingMercadoServiceImpl implements PricingMercadoService { + + @Autowired + private PricingMercadoDAO pricingMercadoDAO; + + public List obtenerTodos() { + return pricingMercadoDAO.obtenerTodos(); + } + + public PricingMercado obtenerID(Integer id) { + return pricingMercadoDAO.obtenerID(id); + } + + @Transactional + public PricingMercado suscribir(PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingMercadoDAO.suscribir(entidad); + } + + @Transactional + public PricingMercado actualizacion(PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingMercadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingMercadoDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino) { + return pricingMercadoDAO.obtenerPricingMercado(pricing, origen, destino); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupacionServiceImpl.java new file mode 100644 index 000000000..50b54368a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupacionServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import com.rjconsultores.ventaboletos.service.PricingOcupacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingOcupacionService") +public class PricingOcupacionServiceImpl implements PricingOcupacionService { + + @Autowired + private PricingOcupacionDAO pricingOcupacionDAO; + + public List obtenerTodos() { + return pricingOcupacionDAO.obtenerTodos(); + } + + public PricingOcupacion obtenerID(Integer id) { + return pricingOcupacionDAO.obtenerID(id); + } + + @Transactional + public PricingOcupacion suscribir(PricingOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingOcupacionDAO.suscribir(entidad); + } + + @Transactional + public PricingOcupacion actualizacion(PricingOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingOcupacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingOcupacionDAO.actualizacion(entidad); + } + + public Boolean podeSalvar(Pricing pricing, BigDecimal min, BigDecimal max) { + return pricingOcupacionDAO.podeSalvar(pricing, min, max); + } + + public List obtenerPorPricing(Pricing pricing) { + return pricingOcupacionDAO.podeSalvar(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java new file mode 100644 index 000000000..96ad8cb93 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PricingPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingPuntoVentaService") +public class PricingPuntoVentaServiceImpl implements PricingPuntoVentaService { + + @Autowired + private PricingPuntoVentaDAO pricingPuntoVentaDAO; + + public List obtenerTodos() { + return pricingPuntoVentaDAO.obtenerTodos(); + } + + public PricingPuntoVenta obtenerID(Integer id) { + return pricingPuntoVentaDAO.obtenerID(id); + } + + @Transactional + public PricingPuntoVenta suscribir(PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingPuntoVentaDAO.suscribir(entidad); + } + + @Transactional + public PricingPuntoVenta actualizacion(PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingPuntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingPuntoVentaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta) { + return pricingPuntoVentaDAO.obtenerPricingPuntoVenta(pricing, puntoVenta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java new file mode 100644 index 000000000..d39eb8ad5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingRutaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.PricingRutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingRutaService") +public class PricingRutaServiceImpl implements PricingRutaService { + + @Autowired + private PricingRutaDAO pricingRutaDAO; + + public List obtenerTodos() { + return pricingRutaDAO.obtenerTodos(); + } + + public PricingRuta obtenerID(Integer id) { + return pricingRutaDAO.obtenerID(id); + } + + @Transactional + public PricingRuta suscribir(PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingRutaDAO.suscribir(entidad); + } + + @Transactional + public PricingRuta actualizacion(PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingRutaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingRutaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta) { + return pricingRutaDAO.obtenerPricingRuta(pricing, ruta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java new file mode 100644 index 000000000..930497376 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.service.PricingService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingService") +public class PricingServiceImpl implements PricingService { + + @Autowired + private PricingDAO pricingDAO; + + public List obtenerTodos() { + return pricingDAO.obtenerTodos(); + } + + public Pricing obtenerID(Integer id) { + return pricingDAO.obtenerID(id); + } + + @Transactional + public Pricing suscribir(Pricing entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingDAO.suscribir(entidad); + } + + @Transactional + public Pricing actualizacion(Pricing entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Pricing entidad) { + + entidad = obtenerID(entidad.getPricingId()); + + for (PricingAsiento pricing : entidad.getPricingAsientoList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingCategoria pricing : entidad.getPricingCategoriaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingClase pricing : entidad.getPricingClaseList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingCorrida pricing : entidad.getPricingCorridaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingDia pricing : entidad.getPricingDiaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingImporte pricing : entidad.getPricingImporteList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingMarca pricing : entidad.getPricingMarcaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingMercado pricing : entidad.getPricingMercadoList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingOcupacion pricing : entidad.getPricingOcupacionList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingPuntoVenta pricing : entidad.getPricingPuntoventaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingRuta pricing : entidad.getPricingRutaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingTipoPtoVta pricing : entidad.getPricingTipoptovtaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (PricingVigencia pricing : entidad.getPricingVigenciaList()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingDAO.actualizacion(entidad); + } + + @Transactional + public void borrarFisico(Pricing entidad) { + borrar(entidad); + } + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo) { + return pricingDAO.buscar(nombPricing, empresa, cantboleto, cantdiasanticipacion, + descuentoporcentaje, descuentoporcredondo); + } + + public List buscarPorNombre(String nombPricing) { + return pricingDAO.buscarPorNombre(nombPricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java new file mode 100644 index 000000000..6ffac999b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.PricingTipoPtoVtaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingTipoPtoVtaService") +public class PricingTipoPtoVtaServiceImpl implements PricingTipoPtoVtaService { + + @Autowired + private PricingTipoPtoVtaDAO pricingTipoPtoVtaDAO; + + public List obtenerTodos() { + return pricingTipoPtoVtaDAO.obtenerTodos(); + } + + public PricingTipoPtoVta obtenerID(Integer id) { + return pricingTipoPtoVtaDAO.obtenerID(id); + } + + @Transactional + public PricingTipoPtoVta suscribir(PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingTipoPtoVtaDAO.suscribir(entidad); + } + + @Transactional + public PricingTipoPtoVta actualizacion(PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingTipoPtoVtaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingTipoPtoVtaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta) { + return pricingTipoPtoVtaDAO.obtenerPricingTipoPuntoVenta(pricing, tipoPuntoVenta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java new file mode 100644 index 000000000..bc7ebfc8b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingTipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.service.PricingTipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("pricingTipoServicioService") +public class PricingTipoServicioServiceImpl implements PricingTipoServicioService { + + @Autowired + private PricingTipoServicioDAO pricingTipoServicioDAO; + + public List obtenerTodos() { + return pricingTipoServicioDAO.obtenerTodos(); + } + + public PricingTipoServicio obtenerID(Integer id) { + return pricingTipoServicioDAO.obtenerID(id); + } + + @Transactional + public PricingTipoServicio suscribir(PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingTipoServicioDAO.suscribir(entidad); + } + + @Transactional + public PricingTipoServicio actualizacion(PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingTipoServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingTipoServicioDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio) { + return pricingTipoServicioDAO.obtenerPricingTipoServicio(pricing,tipoServicio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java new file mode 100644 index 000000000..04f65bc3f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PricingVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.service.PricingVigenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("pricingVigenciaService") +public class PricingVigenciaServiceImpl implements PricingVigenciaService { + + @Autowired + private PricingVigenciaDAO pricingVigenciaDAO; + + public List obtenerTodos() { + return pricingVigenciaDAO.obtenerTodos(); + } + + public PricingVigencia obtenerID(Integer id) { + return pricingVigenciaDAO.obtenerID(id); + } + + @Transactional + public PricingVigencia suscribir(PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingVigenciaDAO.suscribir(entidad); + } + + @Transactional + public PricingVigencia actualizacion(PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingVigenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingVigenciaDAO.actualizacion(entidad); + } + + public List buscarPorVigencias(PricingVigencia pv) { + return pricingVigenciaDAO.buscarPorVigencias(pv); + } + + public Boolean podeSalvar(Pricing pricing, PricingVigencia pricingVigencia, + Date inicio, Date fim) { + return pricingVigenciaDAO.podeSalvar(pricing, pricingVigencia, + inicio, fim); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdClaseServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdClaseServicioServiceImpl.java new file mode 100644 index 000000000..eaab1a96b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdClaseServicioServiceImpl.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdClaseServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import com.rjconsultores.ventaboletos.service.ProdClaseServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodClaseServicioService") +public class ProdClaseServicioServiceImpl implements ProdClaseServicioService { + + @Autowired + private ProdClaseServicioDAO prodClaseServicioDAO; + + public List obtenerTodos() { + return prodClaseServicioDAO.obtenerTodos(); + } + + public ProdClaseServicio obtenerID(Integer id) { + return prodClaseServicioDAO.obtenerID(id); + } + + @Transactional + public ProdClaseServicio suscribir(ProdClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodClaseServicioDAO.suscribir(entidad); + } + + @Transactional + public ProdClaseServicio actualizacion(ProdClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodClaseServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdClaseServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodClaseServicioDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdFormaPagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdFormaPagoServiceImpl.java new file mode 100644 index 000000000..384fb064d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdFormaPagoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdFormaPagoDAO; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import com.rjconsultores.ventaboletos.service.ProdFormaPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodFormaPagoService") +public class ProdFormaPagoServiceImpl implements ProdFormaPagoService { + + @Autowired + private ProdFormaPagoDAO prodFormaPagoDAO; + + public List obtenerTodos() { + return prodFormaPagoDAO.obtenerTodos(); + } + + public ProdFormaPago obtenerID(Integer id) { + return prodFormaPagoDAO.obtenerID(id); + } + + @Transactional + public ProdFormaPago suscribir(ProdFormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodFormaPagoDAO.suscribir(entidad); + } + + @Transactional + public ProdFormaPago actualizacion(ProdFormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodFormaPagoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdFormaPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodFormaPagoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdMarcaServiceImpl.java new file mode 100644 index 000000000..0720f8d09 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdMarcaServiceImpl.java @@ -0,0 +1,84 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.service.ProdMarcaService; +import com.rjconsultores.ventaboletos.service.ProdPrecioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodMarcaService") +public class ProdMarcaServiceImpl implements ProdMarcaService { + + @Autowired + private ProdMarcaDAO prodMarcaDAO; + @Autowired + private ProdPrecioService prodPrecioService; + + + public List obtenerTodos() { + return prodMarcaDAO.obtenerTodos(); + } + + public ProdMarca obtenerID(Integer id) { + return prodMarcaDAO.obtenerID(id); + } + + @Transactional + public ProdMarca suscribir(ProdMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodMarcaDAO.suscribir(entidad); + } + + @Transactional + public ProdMarca actualizacion(ProdMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodMarcaDAO.actualizacion(entidad); + } + + @Transactional + public ProdMarca actualizacion(ProdMarca entidad, List listPrecios) { + entidad = this.actualizacion(entidad); + for(ProdPrecio pp : listPrecios){ + prodPrecioService.actualizacion(pp); + } + return entidad; + } + + @Transactional + public ProdMarca suscribir(ProdMarca entidad, List listPrecios) { + entidad = this.suscribir(entidad); + for(ProdPrecio pp : listPrecios){ + prodPrecioService.suscribir(pp); + } + return entidad; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdMercadoServiceImpl.java new file mode 100644 index 000000000..195ec4458 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdMercadoServiceImpl.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import com.rjconsultores.ventaboletos.service.ProdMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodMercadoService") +public class ProdMercadoServiceImpl implements ProdMercadoService { + + @Autowired + private ProdMercadoDAO prodMercadoDAO; + + public List obtenerTodos() { + return prodMercadoDAO.obtenerTodos(); + } + + public ProdMercado obtenerID(Integer id) { + return prodMercadoDAO.obtenerID(id); + } + + @Transactional + public ProdMercado suscribir(ProdMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodMercadoDAO.suscribir(entidad); + } + + @Transactional + public ProdMercado actualizacion(ProdMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodMercadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodMercadoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdPrecioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdPrecioServiceImpl.java new file mode 100644 index 000000000..b34b2a356 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdPrecioServiceImpl.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdPrecioDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.ProdPrecioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("prodPrecioService") +public class ProdPrecioServiceImpl implements ProdPrecioService { + + @Autowired + private ProdPrecioDAO prodPrecioDAO; + + public List obtenerTodos() { + return prodPrecioDAO.obtenerTodos(); + } + + public ProdPrecio obtenerID(Integer id) { + return prodPrecioDAO.obtenerID(id); + } + + @Transactional + public ProdPrecio suscribir(ProdPrecio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodPrecioDAO.suscribir(entidad); + } + + @Transactional + public ProdPrecio actualizacion(ProdPrecio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodPrecioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdPrecio entidad) { + if (entidad.getProdprecio() == null) { + return; + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodPrecioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Marca marca) { + if (marca == null){ + return; + } + List lsPrecios = prodPrecioDAO.buscar(marca); + for (ProdPrecio pp : lsPrecios) { + pp.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pp.setFecmodif(Calendar.getInstance().getTime()); + pp.setActivo(Boolean.FALSE); + + prodPrecioDAO.actualizacion(pp); + } + } + + public List buscar(Marca marca, ProductoServicio productoservicio) { + return prodPrecioDAO.buscar(marca, productoservicio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdPuntoVentaServiceImpl.java new file mode 100644 index 000000000..113f32c2b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdPuntoVentaServiceImpl.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import com.rjconsultores.ventaboletos.service.ProdPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodPuntoVentaService") +public class ProdPuntoVentaServiceImpl implements ProdPuntoVentaService { + + @Autowired + private ProdPuntoVentaDAO prodPuntoVentaDAO; + + public List obtenerTodos() { + return prodPuntoVentaDAO.obtenerTodos(); + } + + public ProdPuntoVenta obtenerID(Integer id) { + return prodPuntoVentaDAO.obtenerID(id); + } + + @Transactional + public ProdPuntoVenta suscribir(ProdPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodPuntoVentaDAO.suscribir(entidad); + } + + @Transactional + public ProdPuntoVenta actualizacion(ProdPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodPuntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodPuntoVentaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdRutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdRutaServiceImpl.java new file mode 100644 index 000000000..7415810f6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdRutaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdRutaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import com.rjconsultores.ventaboletos.service.ProdRutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodRutaService") +public class ProdRutaServiceImpl implements ProdRutaService { + + @Autowired + private ProdRutaDAO prodRutaDAO; + + public List obtenerTodos() { + return prodRutaDAO.obtenerTodos(); + } + + public ProdRuta obtenerID(Integer id) { + return prodRutaDAO.obtenerID(id); + } + + @Transactional + public ProdRuta suscribir(ProdRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodRutaDAO.suscribir(entidad); + } + + @Transactional + public ProdRuta actualizacion(ProdRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodRutaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodRutaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdTipoptovtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdTipoptovtaServiceImpl.java new file mode 100644 index 000000000..308ed122f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdTipoptovtaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdTipoptovtaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import com.rjconsultores.ventaboletos.service.ProdTipoptovtaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodTipoptovtaService") +public class ProdTipoptovtaServiceImpl implements ProdTipoptovtaService { + + @Autowired + private ProdTipoptovtaDAO prodTipoptovtaDAO; + + public List obtenerTodos() { + return prodTipoptovtaDAO.obtenerTodos(); + } + + public ProdTipoptovta obtenerID(Integer id) { + return prodTipoptovtaDAO.obtenerID(id); + } + + @Transactional + public ProdTipoptovta suscribir(ProdTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodTipoptovtaDAO.suscribir(entidad); + } + + @Transactional + public ProdTipoptovta actualizacion(ProdTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodTipoptovtaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodTipoptovtaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProdVigenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProdVigenciaServiceImpl.java new file mode 100644 index 000000000..d75ffcdd7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProdVigenciaServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProdVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import com.rjconsultores.ventaboletos.service.ProdVigenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("prodVigenciaService") +public class ProdVigenciaServiceImpl implements ProdVigenciaService { + + @Autowired + private ProdVigenciaDAO prodVigenciaDAO; + + public List obtenerTodos() { + return prodVigenciaDAO.obtenerTodos(); + } + + public ProdVigencia obtenerID(Integer id) { + return prodVigenciaDAO.obtenerID(id); + } + + @Transactional + public ProdVigencia suscribir(ProdVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodVigenciaDAO.suscribir(entidad); + } + + @Transactional + public ProdVigencia actualizacion(ProdVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return prodVigenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProdVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + prodVigenciaDAO.actualizacion(entidad); + } + + public List buscarTraslapa(ProdVigencia prodVigencia) { + return prodVigenciaDAO.buscarTraslapa(prodVigencia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ProductoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ProductoServicioServiceImpl.java new file mode 100644 index 000000000..4afc90601 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ProductoServicioServiceImpl.java @@ -0,0 +1,124 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ProductoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.ProductoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("productoServicioService") +public class ProductoServicioServiceImpl implements ProductoServicioService { + + @Autowired + private ProductoServicioDAO productoServicioDAO; + + public List obtenerTodos() { + return productoServicioDAO.obtenerTodos(); + } + + public ProductoServicio obtenerID(Integer id) { + return productoServicioDAO.obtenerID(id); + } + + @Transactional + public ProductoServicio suscribir(ProductoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return productoServicioDAO.suscribir(entidad); + } + + @Transactional + public ProductoServicio actualizacion(ProductoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return productoServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ProductoServicio entidad) { + + entidad = this.obtenerID(entidad.getProductoservicioId()); + for (ProdClaseServicio p : entidad.getProdClaseServicioList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdFormaPago p : entidad.getProdFormaPagoList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdMarca p : entidad.getProdMarcaList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdMercado p : entidad.getProdMercadoList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdPuntoVenta p : entidad.getProdPuntoVentaList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdRuta p : entidad.getProdRutaList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdTipoptovta p : entidad.getProdTipoptovtaList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + for (ProdVigencia p : entidad.getProdVigenciaList()) { + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + p.setFecmodif(Calendar.getInstance().getTime()); + p.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + productoServicioDAO.actualizacion(entidad); + } + @Transactional + public void borrarFisico(ProductoServicio entidad) { + productoServicioDAO.borrar(entidad); + } + + public List buscar(String descproductoservicio) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List obtener(ProductoServicio ps) { + return productoServicioDAO.obtener(ps); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PtoVtaUsuarioBancarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PtoVtaUsuarioBancarioServiceImpl.java new file mode 100644 index 000000000..de9d34c3c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PtoVtaUsuarioBancarioServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PtoVtaUsuarioBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; +import com.rjconsultores.ventaboletos.service.PtoVtaUsuarioBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("ptoVtaUsuarioBancarioService") +public class PtoVtaUsuarioBancarioServiceImpl implements PtoVtaUsuarioBancarioService { + + @Autowired + private PtoVtaUsuarioBancarioDAO ptoVtaUsuarioBancarioDAO; + + public List obtenerTodos() { + return ptoVtaUsuarioBancarioDAO.obtenerTodos(); + } + + public PtoVtaUsuarioBancario obtenerID(Integer id) { + return ptoVtaUsuarioBancarioDAO.obtenerID(id); + } + + @Transactional + public PtoVtaUsuarioBancario suscribir(PtoVtaUsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ptoVtaUsuarioBancarioDAO.suscribir(entidad); + } + + @Transactional + public PtoVtaUsuarioBancario actualizacion(PtoVtaUsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ptoVtaUsuarioBancarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PtoVtaUsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + ptoVtaUsuarioBancarioDAO.actualizacion(entidad); + } + + public void borrarFisico(PtoVtaUsuarioBancario pto2) { + ptoVtaUsuarioBancarioDAO.borrarFisico(pto2); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PtovtaEmpresaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PtovtaEmpresaServiceImpl.java new file mode 100644 index 000000000..fb11d64b1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PtovtaEmpresaServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PtovtaEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("ptovtaEmpresaService") +public class PtovtaEmpresaServiceImpl implements PtovtaEmpresaService { + + @Autowired + private PtovtaEmpresaDAO ptovtaEmpresaDAO; + + public List obtenerTodos() { + return ptovtaEmpresaDAO.obtenerTodos(); + } + + public PtovtaEmpresa obtenerID(Integer id) { + return ptovtaEmpresaDAO.obtenerID(id); + } + + @Transactional + public PtovtaEmpresa suscribir(PtovtaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ptovtaEmpresaDAO.suscribir(entidad); + } + + @Transactional + public PtovtaEmpresa actualizacion(PtovtaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return ptovtaEmpresaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PtovtaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + ptovtaEmpresaDAO.actualizacion(entidad); + } + + public List buscar(PtovtaEmpresa ptovtaEmpresa) { + return ptovtaEmpresaDAO.buscar(ptovtaEmpresa); + } + + public void borrarFisico(PtovtaEmpresa pto) { + ptovtaEmpresaDAO.borrarFisico(pto); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java new file mode 100644 index 000000000..71e94b48e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java @@ -0,0 +1,82 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("puntoVentaService") +public class PuntoVentaServiceImpl implements PuntoVentaService { + + @Autowired + private PuntoVentaDAO puntoVentaDAO; + @Autowired + private PtovtaEmpresaService ptoVtaService; + + public List obtenerTodos() { + return puntoVentaDAO.obtenerTodos(); + } + + public PuntoVenta obtenerID(Integer id) { + return puntoVentaDAO.obtenerID(id); + } + + @Transactional + public PuntoVenta suscribir(PuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return puntoVentaDAO.suscribir(entidad); + } + + @Transactional + public PuntoVenta actualizacion(PuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return puntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(PuntoVenta entidad) { + + for (FormaPagoDet forma : entidad.getLsFormaPagoDet()) { + forma.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + forma.setFecmodif(Calendar.getInstance().getTime()); + forma.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + puntoVentaDAO.actualizacion(entidad); + } + + public List buscaLike(String strEstacion) { + return puntoVentaDAO.buscaLike(strEstacion); + } + + public List buscar(PuntoVenta puntoVenta) { + return puntoVentaDAO.busca(puntoVenta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RedondeoCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoCtrlServiceImpl.java new file mode 100644 index 000000000..5e67b8bac --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoCtrlServiceImpl.java @@ -0,0 +1,86 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RedondeoCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import com.rjconsultores.ventaboletos.service.RedondeoCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("redondeoCtrlService") +public class RedondeoCtrlServiceImpl implements RedondeoCtrlService { + + @Autowired + private RedondeoCtrlDAO redondeoCtrlDAO; + + public List obtenerTodos() { + return redondeoCtrlDAO.obtenerTodos(); + } + + public RedondeoCtrl obtenerID(Integer id) { + return redondeoCtrlDAO.obtenerID(id); + } + + @Transactional + public RedondeoCtrl suscribir(RedondeoCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoCtrlDAO.suscribir(entidad); + } + + @Transactional + public RedondeoCtrl actualizacion(RedondeoCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RedondeoCtrl entidad) { + + entidad = obtenerID(entidad.getRedondeoctrlId()); + + for (Redondeo r : entidad.getRedondeoList()) { + r.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + r.setFecmodif(Calendar.getInstance().getTime()); + r.setActivo(Boolean.FALSE); + } + for (RedondeoMarca rm : entidad.getRedondeoMarcaList()) { + rm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rm.setFecmodif(Calendar.getInstance().getTime()); + rm.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + redondeoCtrlDAO.actualizacion(entidad); + } + + public List buscar(RedondeoCtrl redondeoCtrl) { + return redondeoCtrlDAO.buscar(redondeoCtrl); + } + + public List buscarTraslapa(Short[] iDMarcas, BigDecimal valorinicial, BigDecimal valorfinal, Boolean indaplicadescuento, Boolean indaplicapricing) { + return redondeoCtrlDAO.buscarTraslapa(iDMarcas, valorinicial, valorfinal, indaplicadescuento, indaplicapricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RedondeoMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoMarcaServiceImpl.java new file mode 100644 index 000000000..dfcbcd661 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoMarcaServiceImpl.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RedondeoMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import com.rjconsultores.ventaboletos.service.RedondeoMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("redondeoMarcaService") +public class RedondeoMarcaServiceImpl implements RedondeoMarcaService { + + @Autowired + private RedondeoMarcaDAO redondeoMarcaDAO; + + public List obtenerTodos() { + return redondeoMarcaDAO.obtenerTodos(); + } + + public RedondeoMarca obtenerID(Integer id) { + return redondeoMarcaDAO.obtenerID(id); + } + + @Transactional + public RedondeoMarca suscribir(RedondeoMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoMarcaDAO.suscribir(entidad); + } + + @Transactional + public RedondeoMarca actualizacion(RedondeoMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RedondeoMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + redondeoMarcaDAO.actualizacion(entidad); + } + + public List buscar(Marca marca) { + return redondeoMarcaDAO.buscar(marca); + } + + public List obtenerTodasMarcas(Short[] iDMarcas) { + return redondeoMarcaDAO.obtenerTodasMarcas(iDMarcas); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RedondeoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoServiceImpl.java new file mode 100644 index 000000000..f3e4e7ce5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RedondeoServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RedondeoDAO; +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import com.rjconsultores.ventaboletos.service.RedondeoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("redondeoService") +public class RedondeoServiceImpl implements RedondeoService { + + @Autowired + private RedondeoDAO redondeoDAO; + + public List obtenerTodos() { + return redondeoDAO.obtenerTodos(); + } + + public Redondeo obtenerID(Integer id) { + return redondeoDAO.obtenerID(id); + } + + @Transactional + public Redondeo suscribir(Redondeo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoDAO.suscribir(entidad); + } + + @Transactional + public Redondeo actualizacion(Redondeo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return redondeoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Redondeo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + redondeoDAO.actualizacion(entidad); + } + + public List buscar(BigDecimal valorInicial, BigDecimal valorFinal, + BigDecimal valorRedondeo) { + return redondeoDAO.buscar(valorInicial, valorFinal, valorRedondeo); + } + + public List buscarVlrIniVlrFin(BigDecimal valorInicial, BigDecimal valorFinal) { + return redondeoDAO.buscar(valorInicial, valorFinal); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCategoriaServiceImpl.java new file mode 100644 index 000000000..5296f4538 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCategoriaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; +import com.rjconsultores.ventaboletos.service.ReservacionCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("reservacionCategoriaService") +public class ReservacionCategoriaServiceImpl implements ReservacionCategoriaService { + + @Autowired + private ReservacionCategoriaDAO reservacionCategoriaDAO; + + public List obtenerTodos() { + return reservacionCategoriaDAO.obtenerTodos(); + } + + public ReservacionCategoria obtenerID(Integer id) { + return reservacionCategoriaDAO.obtenerID(id); + } + + @Transactional + public ReservacionCategoria suscribir(ReservacionCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionCategoriaDAO.suscribir(entidad); + } + + @Transactional + public ReservacionCategoria actualizacion(ReservacionCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionCategoriaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionCategoriaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionClaseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionClaseServiceImpl.java new file mode 100644 index 000000000..c85adc937 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionClaseServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; +import com.rjconsultores.ventaboletos.service.ReservacionClaseService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("reservacionClaseService") +public class ReservacionClaseServiceImpl implements ReservacionClaseService { + + @Autowired + private ReservacionClaseDAO reservacionClaseDAO; + + public List obtenerTodos() { + return reservacionClaseDAO.obtenerTodos(); + } + + public ReservacionClase obtenerID(Integer id) { + return reservacionClaseDAO.obtenerID(id); + } + + @Transactional + public ReservacionClase suscribir(ReservacionClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionClaseDAO.suscribir(entidad); + } + + @Transactional + public ReservacionClase actualizacion(ReservacionClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionClaseDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionClaseDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCtrlServiceImpl.java new file mode 100644 index 000000000..3f032906d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionCtrlServiceImpl.java @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; +import com.rjconsultores.ventaboletos.service.ReservacionCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("reservacionCtrlService") +public class ReservacionCtrlServiceImpl implements ReservacionCtrlService { + + @Autowired + private ReservacionCtrlDAO reservacionCtrlDAO; + + public List obtenerTodos() { + return reservacionCtrlDAO.obtenerTodos(); + } + + public ReservacionCtrl obtenerID(Integer id) { + return reservacionCtrlDAO.obtenerID(id); + } + + @Transactional + public ReservacionCtrl suscribir(ReservacionCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionCtrlDAO.suscribir(entidad); + } + + @Transactional + public ReservacionCtrl actualizacion(ReservacionCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionCtrl entidad) { + for (ReservacionCategoria reservacion : entidad.getReservacionCategoriaList()) { + reservacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + reservacion.setFecmodif(Calendar.getInstance().getTime()); + reservacion.setActivo(Boolean.FALSE); + } + for (ReservacionClase reservacion : entidad.getReservacionClaseList()) { + reservacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + reservacion.setFecmodif(Calendar.getInstance().getTime()); + reservacion.setActivo(Boolean.FALSE); + } + for (ReservacionMarca reservacion : entidad.getReservacionMarcaList()) { + reservacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + reservacion.setFecmodif(Calendar.getInstance().getTime()); + reservacion.setActivo(Boolean.FALSE); + } + for (ReservacionMercado reservacion : entidad.getReservacionMercadoList()) { + reservacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + reservacion.setFecmodif(Calendar.getInstance().getTime()); + reservacion.setActivo(Boolean.FALSE); + } + for (ReservacionPuntoVenta reservacion : entidad.getReservacionPuntoVentaList()) { + reservacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + reservacion.setFecmodif(Calendar.getInstance().getTime()); + reservacion.setActivo(Boolean.FALSE); + } + + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionCtrlDAO.actualizacion(entidad); + } + + public List buscar(ReservacionCtrl reservacionCtrl) { + return reservacionCtrlDAO.buscar(reservacionCtrl); + } + + public List buscarFechaTraslapa(ReservacionCtrl reservacionCtrl) { + return reservacionCtrlDAO.buscarFechaTraslapa(reservacionCtrl); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMarcaServiceImpl.java new file mode 100644 index 000000000..a6fc1c718 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMarcaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; +import com.rjconsultores.ventaboletos.service.ReservacionMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("reservacionMarcaService") +public class ReservacionMarcaServiceImpl implements ReservacionMarcaService { + + @Autowired + private ReservacionMarcaDAO reservacionMarcaDAO; + + public List obtenerTodos() { + return reservacionMarcaDAO.obtenerTodos(); + } + + public ReservacionMarca obtenerID(Integer id) { + return reservacionMarcaDAO.obtenerID(id); + } + + @Transactional + public ReservacionMarca suscribir(ReservacionMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionMarcaDAO.suscribir(entidad); + } + + @Transactional + public ReservacionMarca actualizacion(ReservacionMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionMarcaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMercadoServiceImpl.java new file mode 100644 index 000000000..fe51ac0fb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionMercadoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; +import com.rjconsultores.ventaboletos.service.ReservacionMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("reservacionMercadoService") +public class ReservacionMercadoServiceImpl implements ReservacionMercadoService { + + @Autowired + private ReservacionMercadoDAO reservacionMercadoDAO; + + public List obtenerTodos() { + return reservacionMercadoDAO.obtenerTodos(); + } + + public ReservacionMercado obtenerID(Integer id) { + return reservacionMercadoDAO.obtenerID(id); + } + + @Transactional + public ReservacionMercado suscribir(ReservacionMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionMercadoDAO.suscribir(entidad); + } + + @Transactional + public ReservacionMercado actualizacion(ReservacionMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionMercadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionMercadoDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ReservacionPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionPuntoVentaServiceImpl.java new file mode 100644 index 000000000..5ac669987 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ReservacionPuntoVentaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ReservacionPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; +import com.rjconsultores.ventaboletos.service.ReservacionPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("reservacionPuntoVentaService") +public class ReservacionPuntoVentaServiceImpl implements ReservacionPuntoVentaService { + + @Autowired + private ReservacionPuntoVentaDAO reservacionPuntoVentaDAO; + + public List obtenerTodos() { + return reservacionPuntoVentaDAO.obtenerTodos(); + } + + public ReservacionPuntoVenta obtenerID(Integer id) { + return reservacionPuntoVentaDAO.obtenerID(id); + } + + @Transactional + public ReservacionPuntoVenta suscribir(ReservacionPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionPuntoVentaDAO.suscribir(entidad); + } + + @Transactional + public ReservacionPuntoVenta actualizacion(ReservacionPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return reservacionPuntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ReservacionPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + reservacionPuntoVentaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RestriccionPagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RestriccionPagoServiceImpl.java new file mode 100644 index 000000000..a01d12877 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RestriccionPagoServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RestriccionPagoDAO; +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import com.rjconsultores.ventaboletos.service.RestriccionPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("restriccionService") +public class RestriccionPagoServiceImpl implements RestriccionPagoService { + + @Autowired + private RestriccionPagoDAO restriccionDAO; + + public List obtenerTodos() { + return restriccionDAO.obtenerTodos(); + } + + public RestriccionPago obtenerID(Short id) { + return restriccionDAO.obtenerID(id); + } + + @Transactional + public RestriccionPago suscribir(RestriccionPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return restriccionDAO.suscribir(entidad); + } + + @Transactional + public RestriccionPago actualizacion(RestriccionPago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return restriccionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RestriccionPago entidad) { + for (ConfigRestriccionPago crp : entidad.getConfigRestriccionPagoList()) { + crp.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + crp.setFecmodif(Calendar.getInstance().getTime()); + crp.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + restriccionDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RhPagoConductorServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RhPagoConductorServiceImpl.java new file mode 100644 index 000000000..cbb6eb51b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RhPagoConductorServiceImpl.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RhPagoConductorDAO; +import com.rjconsultores.ventaboletos.entidad.RhPagoConductor; +import com.rjconsultores.ventaboletos.service.RhPagoConductorService; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("rhPagoConductorService") +public class RhPagoConductorServiceImpl implements RhPagoConductorService { + + @Autowired + private RhPagoConductorDAO restriccionDAO; + + public List obtenerTodos() { + return restriccionDAO.obtenerTodos(); + } + + public RhPagoConductor obtenerID(Integer id) { + return restriccionDAO.obtenerID(id); + } + + @Transactional + public RhPagoConductor suscribir(RhPagoConductor entidad) { + + + return restriccionDAO.suscribir(entidad); + } + + @Transactional + public RhPagoConductor actualizacion(RhPagoConductor entidad) { + + + return restriccionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RhPagoConductor entidad) { + restriccionDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RolOperativoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RolOperativoServiceImpl.java new file mode 100644 index 000000000..6590757d1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RolOperativoServiceImpl.java @@ -0,0 +1,78 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.dao.RolOperativoDAO; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.service.RolOperativoService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("rolOperativoService") +public class RolOperativoServiceImpl implements RolOperativoService { + + @Autowired + private RolOperativoDAO rolOperativoDAO; + @Autowired + private EsquemaCorridaDAO esquemaCorridaDAO; + + public List obtenerTodos() { + return rolOperativoDAO.obtenerTodos(); + } + + public RolOperativo obtenerID(Integer id) { + return rolOperativoDAO.obtenerID(id); + } + + @Transactional + public RolOperativo suscribir(RolOperativo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rolOperativoDAO.suscribir(entidad); + } + + @Transactional + public RolOperativo actualizacion(RolOperativo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rolOperativoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RolOperativo entidad) throws RegistroConDependenciaException { + if (esquemaCorridaDAO.count("rolOperativo", entidad) > 0l) { + throw new RegistroConDependenciaException(); + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + rolOperativoDAO.actualizacion(entidad); + } + + public List pesquisar(DiagramaAutobus diagrama, String rol) { + + return rolOperativoDAO.pesquisar(diagrama, rol); + } + + public List buscar(String descroloperativo) { + return rolOperativoDAO.buscar(descroloperativo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RutaCombinacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RutaCombinacionServiceImpl.java new file mode 100644 index 000000000..43d7b19d4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RutaCombinacionServiceImpl.java @@ -0,0 +1,104 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RutaCombinacionDAO; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("rutaCombinacionaService") +public class RutaCombinacionServiceImpl implements RutaCombinacionService { + + @Autowired + private RutaCombinacionDAO rutaCombinacionaDAO; + + public List obtenerTodos() { + return rutaCombinacionaDAO.obtenerTodos(); + } + + public RutaCombinacion obtenerID(Integer id) { + return rutaCombinacionaDAO.obtenerID(id); + } + + @Transactional + public RutaCombinacion suscribir(RutaCombinacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaCombinacionaDAO.suscribir(entidad); + } + + @Transactional + public RutaCombinacion actualizacion(RutaCombinacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaCombinacionaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RutaCombinacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + rutaCombinacionaDAO.actualizacion(entidad); + } + + public boolean busquedaRutaTramo(Ruta ruta, Tramo tramo, Boolean ativo) { + return rutaCombinacionaDAO.busquedaRutaTramo(ruta, tramo, ativo); + } + + public RutaCombinacion busquedaTramoRutaTramo(Ruta ruta, Tramo trBuscaOrigemDestino) { + return rutaCombinacionaDAO.busquedaTramoRutaTramo(ruta, trBuscaOrigemDestino); + } + + public void ativar(RutaCombinacion rcExiste) { + rcExiste.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rcExiste.setFecmodif(Calendar.getInstance().getTime()); + rcExiste.setActivo(Boolean.TRUE); + + rutaCombinacionaDAO.actualizacion(rcExiste); + } + + public Tramo busqueda(Ruta ruta, Parada origen, Parada destino) { + return rutaCombinacionaDAO.busqueda(ruta, origen, destino); + } + + public RutaCombinacion busquedaTramoRutaOrigemDestino(Ruta ruta, Parada origem, Parada destino) { + return rutaCombinacionaDAO.busquedaTramoRutaOrigemDestino(ruta, origem, destino); + } + + public List obtenerPorRuta(Ruta ruta) { + return rutaCombinacionaDAO.obtenerPorRuta(ruta); + } + + public boolean buscarRutaCombinacionExisteTramo(Tramo tramo) { + return rutaCombinacionaDAO.buscarRutaCombinacionExisteTramo(tramo); + } + + public int borrarCombinaciones(Ruta ruta){ + return rutaCombinacionaDAO.borrarCombinaciones(ruta); + } + @Transactional + public void activar(Ruta ruta, Tramo trBuscaOrigemDestino){ + rutaCombinacionaDAO.activar(ruta, trBuscaOrigemDestino); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RutaEmpresaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RutaEmpresaServiceImpl.java new file mode 100644 index 000000000..94475ff23 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RutaEmpresaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import com.rjconsultores.ventaboletos.service.RutaEmpresaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("rutaEmpresaService") +public class RutaEmpresaServiceImpl implements RutaEmpresaService { + + @Autowired + private RutaEmpresaDAO rutaEmpresaDAO; + + public List obtenerTodos() { + return rutaEmpresaDAO.obtenerTodos(); + } + + public RutaEmpresa obtenerID(Integer id) { + return rutaEmpresaDAO.obtenerID(id); + } + + @Transactional + public RutaEmpresa suscribir(RutaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaEmpresaDAO.suscribir(entidad); + } + + @Transactional + public RutaEmpresa actualizacion(RutaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaEmpresaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RutaEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + rutaEmpresaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RutaSecuenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RutaSecuenciaServiceImpl.java new file mode 100644 index 000000000..53f3dbb8c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RutaSecuenciaServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.RutaSecuenciaDAO; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("rutaSecuenciaService") +public class RutaSecuenciaServiceImpl implements RutaSecuenciaService { + + @Autowired + private RutaSecuenciaDAO rutaSecuenciaDAO; + + public List obtenerTodos() { + return rutaSecuenciaDAO.obtenerTodos(); + } + + public RutaSecuencia obtenerID(Integer id) { + return rutaSecuenciaDAO.obtenerID(id); + } + + @Transactional + public RutaSecuencia suscribir(RutaSecuencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaSecuenciaDAO.suscribir(entidad); + } + + @Transactional + public RutaSecuencia actualizacion(RutaSecuencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return rutaSecuenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(RutaSecuencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + rutaSecuenciaDAO.actualizacion(entidad); + } + + public List buscarSecuenciaOrdenado(Ruta ruta) { + return rutaSecuenciaDAO.buscarSecuenciaOrdenado(ruta); + } + public int borrarSecuencias(Ruta ruta) { + return rutaSecuenciaDAO.borrarSecuencias(ruta); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/RutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/RutaServiceImpl.java new file mode 100644 index 000000000..720daeb46 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/RutaServiceImpl.java @@ -0,0 +1,292 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.CorridaDAO; +import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO; +import com.rjconsultores.ventaboletos.dao.RutaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Rafius + */ +@Service("rutaService") +public class RutaServiceImpl implements RutaService { + + @Autowired + private RutaDAO rutaDAO; + @Autowired + private TramoService tramoService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + @Autowired + private CorridaDAO corridaDAO; + @Autowired + private EsquemaCorridaDAO esquemaCorridaDAO; + + private static Logger log = Logger.getLogger(RutaServiceImpl.class); + + public List obtenerTodos() { + return rutaDAO.obtenerTodos(); + } + + public Ruta obtenerID(Integer id) { + return rutaDAO.obtenerID(id); + } + + @Transactional(rollbackFor=BusinessException.class) + public Ruta suscribir(Ruta entidad, List lsParadasSequencia) throws BusinessException { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + entidad = rutaDAO.suscribir(entidad); + if (lsParadasSequencia != null) { + generarSecuencias(entidad, lsParadasSequencia); + generarCombinacion(entidad); + } + + return entidad; + } + + private void generarSecuencias(Ruta ruta, List lsParadasSequencia) throws BusinessException { + + if (lsParadasSequencia != null) { + List lsRutaSecuencia = new ArrayList(); + + // Desativo todas as secuencias e gero novamente. + rutaSecuenciaService.borrarSecuencias(ruta); + + log.info("Geração de Secuencia!"); + log.info("Ruta: " + ruta.getRutaId() + " - " + ruta.getDescruta()); + + lsRutaSecuencia.clear(); + StringBuilder sb = new StringBuilder("Tramo(s) inexistente(s):"); + sb.append("\n"); + boolean msg = false; + for (int i = 0; i < lsParadasSequencia.size() - 1; i++) { + Parada ori = lsParadasSequencia.get(i).getParada(); + Via via = lsParadasSequencia.get(i).getVia(); + Integer sec1 = lsParadasSequencia.get(i).getSecuencia().intValue(); + log.info("Secuencia: " + sec1 + " origen " + ori.getDescparada() + " - " + ori.getCveparada() + " Via: " + via.getNombvia()); + + Parada des = lsParadasSequencia.get(i + 1).getParada(); + Integer sec2 = lsParadasSequencia.get(i + 1).getSecuencia().intValue(); + log.info("Secuencia: " + sec2 + " destino " + des.getDescparada() + " - " + des.getCveparada() + " Via: " + via.getNombvia()); + + ClaseServicio claseServicio = ruta.getClaseServicio(); + + Tramo tramo = tramoService.obtenerTramoUnicoRuta(ori, des, via, claseServicio); + + if (tramo != null) { + + RutaSecuencia rutaSecuencia = new RutaSecuencia(); + rutaSecuencia.setRuta(ruta); + rutaSecuencia.setTramo(tramo); + rutaSecuencia.setNumsecuencia(sec1.shortValue()); + rutaSecuencia.setActivo(Boolean.TRUE); + rutaSecuencia.setFecmodif(Calendar.getInstance().getTime()); + rutaSecuencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + rutaSecuencia = rutaSecuenciaService.suscribir(rutaSecuencia); + lsRutaSecuencia.add(rutaSecuencia); + + } else { + throw new BusinessException("rutaServiceImpl.msg.validacionTRamo", new Object[] { ori.getCveparada(), des.getCveparada(), via.getNombvia(), claseServicio.getDescclase() }); + } + } + } + } + + @Transactional(rollbackFor=BusinessException.class) + public Ruta actualizacion(Ruta ruta, List lsParadasSequencia) throws BusinessException { + if (lsParadasSequencia != null) { + generarSecuencias(ruta, lsParadasSequencia); + generarCombinacion(ruta); + } + + ruta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ruta.setFecmodif(Calendar.getInstance().getTime()); + ruta.setActivo(Boolean.TRUE); + + return rutaDAO.actualizacion(ruta); + } + + @Transactional(rollbackFor=RegistroConDependenciaException.class) + public void borrar(Ruta entidad) throws RegistroConDependenciaException { + if ((corridaDAO.count(entidad) > 0l) || (esquemaCorridaDAO.count("ruta", entidad) > 0l)) { + throw new RegistroConDependenciaException(); + } + + entidad = this.obtenerID(entidad.getRutaId()); + for (RutaCombinacion rutaCombinacion : entidad.getRutaCombinacionList()) { + rutaCombinacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rutaCombinacion.setFecmodif(Calendar.getInstance().getTime()); + rutaCombinacion.setActivo(Boolean.FALSE); + } + + for (RutaSecuencia rutaSecuencia : entidad.getRutaSecuenciaList()) { + rutaSecuencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rutaSecuencia.setFecmodif(Calendar.getInstance().getTime()); + rutaSecuencia.setActivo(Boolean.FALSE); + } + + for (RutaEmpresa rutaEmpresa : entidad.getLsRutaEmpresa()) { + rutaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rutaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + rutaEmpresa.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + rutaDAO.actualizacion(entidad); + } + + @Transactional(rollbackFor=BusinessException.class) + public void generarCombinacion(Ruta ruta) throws BusinessException { + + rutaCombinacionService.borrarCombinaciones(ruta); + + List listRutaCombinacion = new ArrayList(); + List lsRutaSecuencia = new ArrayList(); + + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + + StringBuilder sb = new StringBuilder(); + Boolean gerou = true; + + for (int i = 0; i < lsRutaSecuencia.size(); i++) { + Tramo tramoSecuencia1 = lsRutaSecuencia.get(i).getTramo(); + Parada origem = tramoSecuencia1.getOrigem(); + + for (int x = 0; x < lsRutaSecuencia.size(); x++) { + Tramo tramoSecuencia2 = lsRutaSecuencia.get(x).getTramo(); + Parada destinoOrigem = tramoSecuencia2.getDestino(); + + // Numero secuencia anterior > Numero secuencia atual não deve fazer. + // Essa condição não permiti gerar uma volta. + if (lsRutaSecuencia.get(i).getNumsecuencia().intValue() > lsRutaSecuencia.get(x).getNumsecuencia().intValue()) { + continue; + } + + // IDA - A x B - A x C + if (origem == destinoOrigem) { + continue; + } + + List listTramo = tramoService.obtenerPorOrigemDestinoFetchLazy(origem, destinoOrigem); + + if (listTramo.isEmpty()) { + throw new BusinessException("rutaServiceImpl.msg.validacionTRamoCombinacion", new Object[] { origem.getDescparada(), origem.getCveparada(), destinoOrigem.getDescparada(), destinoOrigem.getCveparada() }); + } + + Tramo trBuscaOrigemDestino = new Tramo(); + for (Tramo tm : listTramo) { + if (tm.getVia().equals(tramoSecuencia2.getVia())) { + trBuscaOrigemDestino = tm; + break; + } else if (tm.getVia().equals(tramoSecuencia1.getVia())) { + trBuscaOrigemDestino = tm; + break; + } else { + trBuscaOrigemDestino = tm; + } + } + + log.debug("Tramo:"+trBuscaOrigemDestino.getDesctramo()); + + RutaCombinacion rc = new RutaCombinacion(); + rc.setActivo(Boolean.TRUE); + rc.setFecmodif(Calendar.getInstance().getTime()); + rc.setIndventa(Boolean.TRUE); + rc.setRuta(ruta); + rc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rc.setTramo(trBuscaOrigemDestino); + + // Verifica se já existe o registro INATIVO para Reativa-lo e manter a configuração se vende. + // if (!rutaCombinacionService.busquedaRutaTramo(ruta, trBuscaOrigemDestino, Boolean.FALSE)) { + rc = rutaCombinacionService.suscribir(rc); + // } else { + // rutaCombinacionService.activar(ruta, trBuscaOrigemDestino); + // } + + } + } + } + + public Parada getDestino(Ruta ruta) { + return rutaDAO.buscarDestino(ruta); + } + + public Parada getOrigem(Ruta ruta) { + return rutaDAO.buscarOrigen(ruta); + } + + public List buscarPorRutaPorEmpresa(Ruta ruta, Empresa empresa) { + return rutaDAO.buscarPorRutaPorEmpresa(ruta, empresa); + } + + public List buscarPorClaseServicio(ClaseServicio claseServicio) { + return rutaDAO.buscarPorClaseServicio(claseServicio); + } + + public List buscar(String nomeRuta, ClaseServicio claseServicio, Boolean nomeObrigatorio) { + return rutaDAO.buscar(nomeRuta, claseServicio, nomeObrigatorio); + } + + public List obtenerPorEmpresa(Empresa empresa) { + return rutaDAO.obtenerPorEmpresa(empresa); + } + + public List buscarTodosExceto(Integer... idRuta) { + return rutaDAO.buscarTodosExceto(idRuta); + } + + @Override + public boolean paradaExisteEnLaRuta(Parada parada, Ruta ruta) { + ruta = obtenerID(ruta.getRutaId()); + boolean existe = false; + for (int i = 0; (i < ruta.getRutaSecuenciaList().size()) && !existe; i++) { + RutaSecuencia rutaSecuencia = ruta.getRutaSecuenciaList().get(i); + Tramo tramo = rutaSecuencia.getTramo(); + if (tramo != null) { + if (tramo.getOrigem().equals(parada) || tramo.getDestino().equals(parada)) { + existe = true; + } + } + } + return existe; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/SecretariaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/SecretariaServiceImpl.java new file mode 100644 index 000000000..a88ba68c8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/SecretariaServiceImpl.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.SecretariaDAO; +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import com.rjconsultores.ventaboletos.service.SecretariaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("secretariaService") +public class SecretariaServiceImpl implements SecretariaService { + + @Autowired + private SecretariaDAO secretariaDAO; + + public List obtenerTodos() { + return secretariaDAO.obtenerTodos(); + } + + public Secretaria obtenerID(Integer id) { + return secretariaDAO.obtenerID(id); + } + + @Transactional + public Secretaria suscribir(Secretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return secretariaDAO.suscribir(entidad); + } + + @Transactional + public Secretaria actualizacion(Secretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return secretariaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Secretaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + for (CuponSecretaria cd : entidad.getLsCuponSecretaria()) { + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setActivo(Boolean.FALSE); + } + + secretariaDAO.actualizacion(entidad); + } + + public List buscar(String descsecretaria, String cvesecretaria) { + return secretariaDAO.buscar(descsecretaria, cvesecretaria); + } + + public List buscar(String descsecretaria) { + return secretariaDAO.buscar(descsecretaria); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/SistemaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/SistemaServiceImpl.java new file mode 100644 index 000000000..13a8f5b26 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/SistemaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.SistemaDAO; +import com.rjconsultores.ventaboletos.entidad.Sistema; +import com.rjconsultores.ventaboletos.service.SistemaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("sistemaService") +public class SistemaServiceImpl implements SistemaService { + + @Autowired + private SistemaDAO sistemaDAO; + + public List obtenerTodos() { + return sistemaDAO.obtenerTodos(); + } + + public Sistema obtenerID(Integer id) { + return sistemaDAO.obtenerID(id); + } + + @Transactional + public Sistema suscribir(Sistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return sistemaDAO.suscribir(entidad); + } + + @Transactional + public Sistema actualizacion(Sistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return sistemaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Sistema entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + sistemaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarifaCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarifaCategoriaServiceImpl.java new file mode 100644 index 000000000..bc5abe308 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarifaCategoriaServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarifaCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import com.rjconsultores.ventaboletos.service.TarifaCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("tarifaCategoriaService") +public class TarifaCategoriaServiceImpl implements TarifaCategoriaService { + + @Autowired + private TarifaCategoriaDAO tarifaCategoriaDAO; + + public List obtenerTodos() { + return tarifaCategoriaDAO.obtenerTodos(); + } + + public TarifaCategoria obtenerID(Integer id) { + return tarifaCategoriaDAO.obtenerID(id); + } + + @Transactional + public TarifaCategoria suscribir(TarifaCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaCategoriaDAO.suscribir(entidad); + } + + @Transactional + public TarifaCategoria actualizacion(TarifaCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaCategoriaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarifaCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tarifaCategoriaDAO.actualizacion(entidad); + } + + public List buscar(Categoria categoria) { + return tarifaCategoriaDAO.buscarPorCategoria(categoria); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarifaHistServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarifaHistServiceImpl.java new file mode 100644 index 000000000..1cff76433 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarifaHistServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarifaHistDAO; +import com.rjconsultores.ventaboletos.entidad.TarifaHist; +import com.rjconsultores.ventaboletos.service.TarifaHistService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("tarifaHistService") +public class TarifaHistServiceImpl implements TarifaHistService { + + @Autowired + private TarifaHistDAO tarifaHistDAO; + + public List obtenerTodos() { + return tarifaHistDAO.obtenerTodos(); + } + + public TarifaHist obtenerID(Integer id) { + return tarifaHistDAO.obtenerID(id); + } + + @Transactional + public TarifaHist suscribir(TarifaHist entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaHistDAO.suscribir(entidad); + } + + @Transactional + public TarifaHist actualizacion(TarifaHist entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaHistDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarifaHist entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tarifaHistDAO.borrar(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarifaMinimaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarifaMinimaServiceImpl.java new file mode 100644 index 000000000..dd0d77b73 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarifaMinimaServiceImpl.java @@ -0,0 +1,105 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarifaMinimaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import com.rjconsultores.ventaboletos.service.TarifaMinimaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("tarifaMinimaService") +public class TarifaMinimaServiceImpl implements TarifaMinimaService { + + @Autowired + private TarifaMinimaDAO tarifaMinimaDAO; + + public List obtenerTodos() { + return tarifaMinimaDAO.obtenerTodos(); + } + + public TarifaMinima obtenerID(Integer id) { + return tarifaMinimaDAO.obtenerID(id); + } + + @Transactional + public TarifaMinima suscribir(TarifaMinima entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaMinimaDAO.suscribir(entidad); + } + + @Transactional + public TarifaMinima actualizacion(TarifaMinima entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaMinimaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarifaMinima entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tarifaMinimaDAO.actualizacion(entidad); + } + + public List buscarPorPlaza(Plaza plaza) { + return tarifaMinimaDAO.buscarPorPlaza(plaza); + } + + public List pesquisar(Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio, Moneda moneda) { + return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda); + } + + public List pesquisar(BigDecimal valor, Moneda moneda, + Plaza plaza, Marca marca, Parada origem, Parada destino, + ClaseServicio claseServicio) { + return tarifaMinimaDAO.pesquisar(valor, moneda, plaza, marca, origem, + destino, claseServicio); + } + + public List pesquisarEspecifico(Marca marca, Parada origem, + Parada destino, ClaseServicio claseServicio, Moneda moneda) { + return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda); + } + + public List pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda) { + return tarifaMinimaDAO.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda); + } + + public List buscarPorMarca(Marca marca, Moneda moneda) { + return tarifaMinimaDAO.buscarPorMarcaMoneda(marca, moneda); + } + + public List buscarPorClaseServico(ClaseServicio claseServicio, + Moneda moneda) { + return tarifaMinimaDAO.buscarPorClaseServicioMoneda(claseServicio, moneda); + } + + public List buscarPorPlazaMoneda(Plaza plaza, Moneda moneda) { + return tarifaMinimaDAO.buscarPorPlazaMoneda(plaza, moneda); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarifaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarifaServiceImpl.java new file mode 100644 index 000000000..e2893d342 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarifaServiceImpl.java @@ -0,0 +1,377 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.rjconsultores.ventaboletos.dao.TarifaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import com.rjconsultores.ventaboletos.entidad.TarifaHist; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TarifaHistService; +import com.rjconsultores.ventaboletos.service.TarifaMinimaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import org.apache.log4j.Logger; + +/** + * + * @author rodrigo + */ +@Service("tarifaService") +public class TarifaServiceImpl implements TarifaService { + + @Autowired + private TarifaDAO tarifaDAO; + @Autowired + private TarifaHistService tarifaHistService; + @Autowired + private ConstanteService constanteService; + @Autowired + private MonedaService monedaService; + @Autowired + private TarifaMinimaService tarifaMinimaService; + @Autowired + private ParadaService paradaService; + @Autowired + private RutaService rutaService; + private static Logger log = Logger.getLogger(TarifaServiceImpl.class); + + public List obtenerTodos() { + return tarifaDAO.obtenerTodos(); + } + + @Transactional(readOnly = true) + public Tarifa obtenerID(Integer id) { + return tarifaDAO.obtenerID(id); + } + + private void cadastrarTarifaHistorico(Tarifa entidad) { + TarifaHist th = new TarifaHist(); + th.setActivo(entidad.getActivo()); + th.setClaseServicio(entidad.getClaseServicio()); + th.setFecmodif(entidad.getFecmodif()); + th.setMarca(entidad.getMarca()); + th.setMoneda(entidad.getMoneda()); + th.setPrecio(entidad.getPrecio()); + th.setPreciooriginal(entidad.getPreciooriginal()); + th.setStatustarifa(entidad.getStatustarifa()); + th.setUsuarioId(entidad.getUsuarioId()); + th.setVigenciaTarifa(entidad.getVigenciaTarifa()); + + th = tarifaHistService.suscribir(th); + } + + private void cadastrarTarifaMonedaEstrangeira(Tarifa tarifa) { + Constante constMonedaNacional = + constanteService.buscarPorNomeConstante("MONEDANACIONAL_ID"); + Integer idMonedaNacional = new Integer(constMonedaNacional.getValorconstante()); + + Constante constMonedaEstrangeira = + constanteService.buscarPorNomeConstante("MONEDAEXTRANJERA_ID"); + Integer idMonedaEstrangeira = new Integer(constMonedaEstrangeira.getValorconstante()); + + Constante constCalculoTarifa = + constanteService.buscarPorNomeConstante("CAMBIO_CALCULO_TARIFA"); + BigDecimal valorCalculoTarifa = new BigDecimal(constCalculoTarifa.getValorconstante()); + + if (tarifa.getMoneda() != null) { + if (tarifa.getMoneda().getMonedaId().equals(idMonedaNacional)) { + Moneda monedaEstrangeira = + monedaService.obtenerID(idMonedaEstrangeira); + Tramo tramo = tarifa.getTramo(); + ClaseServicio claseServicio = tarifa.getClaseServicio(); + VigenciaTarifa vigenciaTarifa = tarifa.getVigenciaTarifa(); + Marca marca = tarifa.getMarca(); + + List lsTarifasEstrangeiraEquivalente = + pesquisar(marca, tramo, monedaEstrangeira, + claseServicio, vigenciaTarifa); + + // se a tarifa estrangeira nao existe, cria: + if (lsTarifasEstrangeiraEquivalente.isEmpty()) { + + Tarifa tarifaEstrangeira = new Tarifa(); + tarifaEstrangeira.setActivo(Boolean.TRUE); + tarifaEstrangeira.setClaseServicio(tarifa.getClaseServicio()); + tarifaEstrangeira.setFecmodif(Calendar.getInstance().getTime()); + tarifaEstrangeira.setLsTarifaCategoria(tarifa.getLsTarifaCategoria()); + tarifaEstrangeira.setLsTarifaTipoptovta(tarifa.getLsTarifaTipoptovta()); + tarifaEstrangeira.setMarca(tarifa.getMarca()); + tarifaEstrangeira.setMoneda(monedaEstrangeira); + tarifaEstrangeira.setStatustarifa(tarifa.getStatustarifa()); + tarifaEstrangeira.setTramo(tarifa.getTramo()); + tarifaEstrangeira.setVigenciaTarifa(tarifa.getVigenciaTarifa()); + tarifaEstrangeira.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + // Moneda Nacional -> Moneda Estrangeria: + BigDecimal precioCambiar = tarifa.getPrecio(); + precioCambiar = precioCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPrecio(precioCambiar); + + BigDecimal precioOriginalCambiar = tarifa.getPreciooriginal(); + precioOriginalCambiar = precioOriginalCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPreciooriginal(precioOriginalCambiar); + + BigDecimal preciorEdAbiertoCambiar = tarifa.getPrecioredabierto();// esse valor tem q vir preenchido ou eu posso desconsiderá-lo? + if (preciorEdAbiertoCambiar != null) { + preciorEdAbiertoCambiar = preciorEdAbiertoCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPrecioredabierto(preciorEdAbiertoCambiar); + } + + Boolean podeAlterar = true; + podeAlterar = + podeAlterarTarifaMinima(tarifaEstrangeira, tarifa.getMarca(), + tarifa.getTramo().getOrigem(), tarifa.getTramo().getDestino(), + claseServicio, null, tarifaEstrangeira.getMoneda()); + + if (podeAlterar) { + cadastrarTarifaHistorico(tarifaEstrangeira); + + tarifaDAO.suscribir(tarifaEstrangeira); + } + + } else { + for (Tarifa tarifaEstrangeira : lsTarifasEstrangeiraEquivalente) { + tarifaEstrangeira.setActivo(Boolean.TRUE); + tarifaEstrangeira.setClaseServicio(tarifa.getClaseServicio()); + tarifaEstrangeira.setFecmodif(Calendar.getInstance().getTime()); + tarifaEstrangeira.setLsTarifaCategoria(tarifa.getLsTarifaCategoria()); + tarifaEstrangeira.setLsTarifaTipoptovta(tarifa.getLsTarifaTipoptovta()); + tarifaEstrangeira.setMarca(tarifa.getMarca()); + tarifaEstrangeira.setMoneda(monedaEstrangeira); + tarifaEstrangeira.setStatustarifa(tarifa.getStatustarifa()); + tarifaEstrangeira.setTramo(tarifa.getTramo()); + tarifaEstrangeira.setVigenciaTarifa(tarifa.getVigenciaTarifa()); + tarifaEstrangeira.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + // Moneda Nacional -> Moneda Estrangeria: + BigDecimal precioCambiar = tarifa.getPrecio(); + precioCambiar = precioCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPrecio(precioCambiar); + + BigDecimal precioOriginalCambiar = tarifa.getPreciooriginal(); + precioOriginalCambiar = precioOriginalCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPreciooriginal(precioOriginalCambiar); + + BigDecimal preciorEdAbiertoCambiar = tarifa.getPrecioredabierto(); + if (preciorEdAbiertoCambiar != null) { + preciorEdAbiertoCambiar = preciorEdAbiertoCambiar.divide(valorCalculoTarifa, 2, java.math.RoundingMode.HALF_UP); + tarifaEstrangeira.setPrecioredabierto(preciorEdAbiertoCambiar); + } + Boolean podeAlterar = true; + podeAlterar = + podeAlterarTarifaMinima(tarifaEstrangeira, tarifa.getMarca(), + tarifa.getTramo().getOrigem(), tarifa.getTramo().getDestino(), + tarifaEstrangeira.getClaseServicio(), null, tarifaEstrangeira.getMoneda()); + + if (podeAlterar) { + cadastrarTarifaHistorico(tarifaEstrangeira); + + tarifaDAO.suscribir(tarifaEstrangeira); + } + } + } + } + } + } + + @Transactional + public Tarifa suscribir(Tarifa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + cadastrarTarifaHistorico(entidad); + cadastrarTarifaMonedaEstrangeira(entidad); + + return tarifaDAO.suscribir(entidad); + } + + @Transactional + public Tarifa actualizacion(Tarifa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + // Rafael: Segundo a Letícia, não pode atualizar o DOLAR caso haja uma + // atualização de preço, os dolores somente são gerados na inclusão de preço. + + // Tarifa tarifa = this.obtenerID(entidad.getTarifaId()); + // entidad.setLsTarifaCategoria(tarifa.getLsTarifaCategoria()); + // entidad.setLsTarifaTipoptovta(tarifa.getLsTarifaTipoptovta()); + + cadastrarTarifaHistorico(entidad); + // cadastrarTarifaMonedaEstrangeira(entidad); + + return tarifaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Tarifa entidad) { + for (TarifaCategoria pricing : entidad.getLsTarifaCategoria()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + for (TarifaTipoptovta pricing : entidad.getLsTarifaTipoptovta()) { + pricing.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricing.setFecmodif(Calendar.getInstance().getTime()); + pricing.setActivo(Boolean.FALSE); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + cadastrarTarifaHistorico(entidad); + + tarifaDAO.actualizacion(entidad); + } + + public List pesquisar(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa) { + return tarifaDAO.pesquisar(marca, tramo, moneda, claseServicio, vigenciaTarifa); + } + + public boolean existe(Marca marca, Tramo tramo, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa) { + return tarifaDAO.existe(marca, tramo, moneda, claseServicio, vigenciaTarifa); + } + + public List pesquisar(Marca marca, Parada origem, Parada destino, Moneda moneda, + ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, + Categoria categoria, TipoPuntoVenta tipoPuntoVenta) { + return tarifaDAO.pesquisar(marca, origem, destino, moneda, claseServicio, vigenciaTarifa, + categoria, tipoPuntoVenta); + } + + public Tarifa buscar(Tramo tramo, Marca marca, ClaseServicio claseServicio, + VigenciaTarifa vigenciaTarifa, Moneda moneda) { + return tarifaDAO.buscar(tramo, marca, claseServicio, vigenciaTarifa, moneda); + } + + public List buscarPorVigencia(VigenciaTarifa vigencia) { + return tarifaDAO.buscarPorVigencia(vigencia); + } + + public List pesquisar(List lsMoneda, List lsMarca, + List lsClaseServicio, List lsCategoria, + List lsEmpresa, List lsRuta, + List lsTipoPuntoVenta, List lsVigenciaTarifa) { + return tarifaDAO.pesquisar(lsMoneda, lsMarca, lsClaseServicio, lsCategoria, + lsEmpresa, lsRuta, lsTipoPuntoVenta, lsVigenciaTarifa); + } + + public Boolean podeAlterarTarifaMinima(Tarifa tarifa, Marca marca, Parada origem, + Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda) { + + Boolean podeAlterarTarifaMinima = Boolean.TRUE; + + List lsTarifaMinima = tarifaMinimaService.pesquisarEspecifico(marca, origem, destino, claseServicio, moneda); + + if (lsTarifaMinima.isEmpty()) { + lsTarifaMinima = tarifaMinimaService.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda); + } + + log.debug("Moneda : " + moneda.getDescmoneda()); + log.debug("Preço : " + tarifa.getPrecio()); + + for (TarifaMinima tm : lsTarifaMinima) { + if (tarifa.getPrecio().compareTo(tm.getImportetarifa()) == -1) { + podeAlterarTarifaMinima = Boolean.FALSE; + log.debug("Tarifa Minima ID: " + tm.getTarifaminimaId()); + log.debug("Tarifa Minima Origen : " + tm.getOrigem().getDescparada()); + log.debug("Tarifa Minima Destino: " + tm.getDestino().getDescparada()); + log.debug("Tarifa Minima Marca : " + tm.getMarca().getDescmarca()); + log.debug("Tarifa Minima Clase : " + tm.getClaseServicio().getDescclase()); + log.debug("Tarifa Minima Moneda : " + tm.getMoneda().getDescmoneda()); + log.debug("Tarifa Minima : " + tm.getImportetarifa() + " Valor Alterado: " + tarifa.getPrecio()); + } + } + + return podeAlterarTarifaMinima; + } + + public List buscarExisteVigencia(VigenciaTarifa vigenciaTarifa) { + return tarifaDAO.buscarExisteVigencia(vigenciaTarifa); + } + + // Metodo para gerar todas as tarifas possiveis + @Transactional + public Boolean generarTarifas(VigenciaTarifa vigencia, Marca marca) { + + // Lista de Rutas + List lsRuta = rutaService.obtenerTodos(); + try { + for (Ruta r : lsRuta) { + Ruta ruta = rutaService.obtenerID(r.getRutaId()); + + // Lista de Combinações + List lsRutaCombinacion = ruta.getRutaCombinacionList(); + for (RutaCombinacion rc : lsRutaCombinacion) { + + Tarifa tarifa = new Tarifa(); + // Valor de 6 Pesos por Default + tarifa.setPrecio(BigDecimal.valueOf(6)); + tarifa.setPreciooriginal(BigDecimal.ZERO); + // Pesos Mexicano + tarifa.setMoneda(monedaService.obtenerID(1)); + // Marca... informado antes + // Vigencia... informado antes + tarifa.setVigenciaTarifa(vigencia); + tarifa.setMarca(marca); + + tarifa.setClaseServicio(r.getClaseServicio()); + tarifa.setTramo(rc.getTramo()); + + // Tramo-Marca-Classe-Vigencia-Moneda + Tarifa existeTarifa = tarifaDAO.buscar(tarifa.getTramo(), tarifa.getMarca(), tarifa.getClaseServicio(), + tarifa.getVigenciaTarifa(), tarifa.getMoneda()); + + if (existeTarifa == null) { + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + tarifa.setStatustarifa("L"); + + log.debug("Tarifa: Ruta " + ruta.getDescruta() + " - " + ruta.getRutaId() + " Tramo: " + tarifa.getTramo().getTramoId() + + " Marca " + marca + " Vigencia: " + vigencia); + + tarifa = tarifaDAO.suscribir(tarifa); + } + } + } + } catch (Exception e) { + log.debug("ERRO:" + e); + return false; + } + return true; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarifaTipoptovtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarifaTipoptovtaServiceImpl.java new file mode 100644 index 000000000..b9f1352b9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarifaTipoptovtaServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarifaTipoptovtaDAO; +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; +import com.rjconsultores.ventaboletos.service.TarifaTipoptovtaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("tarifaTipoptovtaService") +public class TarifaTipoptovtaServiceImpl implements TarifaTipoptovtaService { + + @Autowired + private TarifaTipoptovtaDAO tarifaTipoptovtaDAO; + + public List obtenerTodos() { + return tarifaTipoptovtaDAO.obtenerTodos(); + } + + public TarifaTipoptovta obtenerID(Integer id) { + return tarifaTipoptovtaDAO.obtenerID(id); + } + + @Transactional + public TarifaTipoptovta suscribir(TarifaTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaTipoptovtaDAO.suscribir(entidad); + } + + @Transactional + public TarifaTipoptovta actualizacion(TarifaTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tarifaTipoptovtaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarifaTipoptovta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tarifaTipoptovtaDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarjetaFidelidadServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaFidelidadServiceImpl.java new file mode 100644 index 000000000..67854f0d5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaFidelidadServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarjetaFidelidadDAO; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidadCuenta; +import com.rjconsultores.ventaboletos.service.TarjetaFidelidadService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("tarjetaFidelidadService") +public class TarjetaFidelidadServiceImpl implements TarjetaFidelidadService { + + @Autowired + private TarjetaFidelidadDAO fidelidadDAO; + + public List obtenerTodos() { + return fidelidadDAO.obtenerTodos(); + } + + public TarjetaFidelidad obtenerID(Integer id) { + return fidelidadDAO.obtenerID(id); + } + + @Transactional + public TarjetaFidelidad suscribir(TarjetaFidelidad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return fidelidadDAO.suscribir(entidad); + } + + @Transactional + public TarjetaFidelidad actualizacion(TarjetaFidelidad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return fidelidadDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarjetaFidelidad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + fidelidadDAO.actualizacion(entidad); + } + + public List obtenerCantDesc() { + return fidelidadDAO.obtenerCantDesc(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarjetaRecaudacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaRecaudacionServiceImpl.java new file mode 100644 index 000000000..357b4c1b1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaRecaudacionServiceImpl.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TarjetaRecaudacionDAO; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacionPK; +import com.rjconsultores.ventaboletos.service.TarjetaRecaudacionService; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tarjetaRecaudacionService") +public class TarjetaRecaudacionServiceImpl implements TarjetaRecaudacionService { + + @Autowired + private TarjetaRecaudacionDAO tarjetaRecaudacionDAO; + + public List obtenerTodos() { + return tarjetaRecaudacionDAO.obtenerTodos(); + } + + public TarjetaRecaudacion obtenerID(TarjetaRecaudacionPK id) { + return tarjetaRecaudacionDAO.obtenerID(id); + } + + @Transactional + public TarjetaRecaudacion suscribir(TarjetaRecaudacion entidad) { + return tarjetaRecaudacionDAO.suscribir(entidad); + } + + @Transactional + public TarjetaRecaudacion actualizacion(TarjetaRecaudacion entidad) { + return tarjetaRecaudacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarjetaRecaudacion entidad) { + tarjetaRecaudacionDAO.borrar(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TarjetaViajeServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaViajeServiceImpl.java new file mode 100644 index 000000000..e13a85796 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TarjetaViajeServiceImpl.java @@ -0,0 +1,267 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.zkoss.zul.Comboitem; + + +import com.rjconsultores.ventaboletos.dao.CorridaTramoDAO; +import com.rjconsultores.ventaboletos.dao.TarjetaViajeDAO; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.RhPagoConductor; +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.RhPagoConductorService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TarjetaViajeService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.omg.CORBA.TCKind; + +@Service("tarjetaViajeService") +public class TarjetaViajeServiceImpl implements TarjetaViajeService { + + @Autowired + private TarjetaViajeDAO tarjetaViajeDAO; + @Autowired + private CorridaTramoDAO corridaTramoDAO; + @Autowired + private CorridaService corridaService; + @Autowired + private RhPagoConductorService rhPagoConductorService; + @Autowired + private RutaService rutaService; + private static Logger log = Logger.getLogger(TarjetaViajeServiceImpl.class); + + @Override + public List obtenerTodos() { + return tarjetaViajeDAO.obtenerTodos(); + } + + @Override + public TarjetaViaje obtenerID(Integer id) { + return tarjetaViajeDAO.obtenerID(id); + } + + @Transactional + public TarjetaViaje suscribir(TarjetaViaje entidad) { + entidad.setActivo(true); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + return tarjetaViajeDAO.suscribir(entidad); + } + + @Transactional + public TarjetaViaje actualizacion(TarjetaViaje entidad) { + entidad.setActivo(true); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + return tarjetaViajeDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TarjetaViaje entidad) { + if (entidad.getIndstatustarjeta().equals("M")) { + tarjetaViajeDAO.borrar(entidad); + } else { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(false); + entidad.setIndstatustarjeta("B"); + tarjetaViajeDAO.actualizacion(entidad); + } + } + + @Transactional + public void grabarTarjetaViaje(List lsCorridaTramo) { + try { + TarjetaViaje tarjeta = null; + for (CorridaTramo ct : lsCorridaTramo) { + + if (ct.getCorrida() == null) { + log.debug("Corrida Tramo sem Corrida: " + ct.getCorridatramoId()); + continue; + } + + tarjeta = new TarjetaViaje(); + tarjeta.setActivo(true); + if (ct.getCorrida().getCorridaRebote() != null) { + tarjeta.setIndRebote(1); + } else { + tarjeta.setIndRebote(0); + } + tarjeta.setFecenvionomina(null); + tarjeta.setFecmodif(new Date()); + tarjeta.setFoliotarjetaviaje(ct.getFolioTarjeta() == null ? null : ct.getFolioTarjeta().toString());// checar + tarjeta.setIndstatustarjeta("N"); + tarjeta.setNumsecuencia(ct.getNumsecuencia() != null ? Integer.getInteger(ct.getNumsecuencia().toString()) : null); + tarjeta.setUsuarioId(ct.getUsuarioId()); + tarjeta.setAutobus(ct.getAutobus()); + tarjeta.setClaseServicio(ct.getCorrida().getClaseServicio()); + tarjeta.setConductor(ct.getConductor()); + tarjeta.setConductor1(ct.getConductor1()); + tarjeta.setEmpresa(ct.getCorrida().getEmpresa()); + tarjeta.setMarca(ct.getCorrida().getMarca()); + + tarjeta.setFecInicial(ct.getCorrida().getId().getFeccorrida()); + tarjeta.setFecHorSalida(ct.getCorrida().getFechorsalida()); + + tarjeta.setNumCorrida(ct.getCorrida().getId().getCorridaId()); + + BigDecimal kmPagoCondutor = new BigDecimal(BigInteger.ZERO); + BigDecimal kmReal = new BigDecimal(BigInteger.ZERO); +// BigDecimal teste = corridaTramoDAO.buscarSumTarjetaMesmaCorrida(ct); +// tarjeta.setKmPagoConductor(teste); +// tarjeta.setKmReal(teste); +// + List lsCorridasAdicionais = corridaTramoDAO.buscarTarjetaMesmaCorrida(ct); + if (!lsCorridasAdicionais.isEmpty()) { + for (CorridaTramo ct2 : lsCorridasAdicionais) { + if (ct2.getTramo() == null) { + log.debug("Corrida Tramo Sem Tramo: " + ct2.getCorridatramoId().toString()); + continue; + } + if (ct2.getTramo().getKmPagoConductor() != null) { + + log.debug("Corrida Tramo Id: " + ct2.getCorridatramoId().toString()); + kmPagoCondutor = kmPagoCondutor.add(ct2.getTramo().getKmPagoConductor()); + kmReal = kmReal.add(ct2.getTramo().getKmReal()); + } + } + } + + tarjeta.setKmPagoConductor(kmPagoCondutor); + tarjeta.setKmReal(kmReal); + + //Origem Destino Inicial e Final da Corrida + Corrida corrida = ct.getCorrida(); + tarjeta.setOrigen(corrida.getOrigem().getCveparada()); + tarjeta.setDestino(corrida.getDestino().getCveparada()); + + tarjetaViajeDAO.suscribir(tarjeta); + ct.setIndmanttarjeta(true); + corridaTramoDAO.actualizacion(ct); + + } + } catch (Exception e) { + log.error("Geracao de Tarjetas"); + log.error(e); + } + } + + @Override + public void verificaCorridaDuplicada(List lsTarjetaViaje, boolean todasTarjetas) { + + for (TarjetaViaje t : lsTarjetaViaje) { + List ls = tarjetaViajeDAO.buscarTarjetaPorFiltros(t); + if (ls.size() > 1) { + //Vermelho + t.seteCorridaDuplicada(true); + + //Esse teste checa se houve uma volta para o autobus/condutor, + //Se teve volta a TarjetaViaje tem que ser preta + boolean existeCorridaVolta = tarjetaViajeDAO.buscarTarjetaExisteVolta(t); + + //Se não existe corrida de volta Vermelho + t.seteCorridaDuplicada(!existeCorridaVolta); + } + } + + } + + @Override + public List buscarTarjetaPorFiltros(Integer autoIni, + Integer autoFin, Date dataIni, Date dataFin, Comboitem empresa) { + + return tarjetaViajeDAO.buscarTarjetaPorFiltros(autoIni, autoFin, + dataIni, dataFin, empresa); + } + + @Override + public List generarArchivoNomina(Date fecIni, Date fecFin) { + Calendar c = Calendar.getInstance(); + c.setTime(fecFin); + c.add(Calendar.HOUR, 23); + c.add(Calendar.MINUTE, 59); + c.add(Calendar.SECOND, 59); + fecFin = c.getTime(); + List lsTarjetas = tarjetaViajeDAO.buscarTarjetasParaEnvioNomina(fecIni, fecFin); + + try { + for (TarjetaViaje tv : lsTarjetas) { + RhPagoConductor rh = new RhPagoConductor(); + + Corrida.Id id = new Corrida.Id(); + id.setCorridaId(tv.getNumCorrida()); + id.setFeccorrida(tv.getFecInicial()); + Corrida corrida = corridaService.obtenerID(id); + + if (tv.getAutobus() != null) { + rh.setNumautobus(Integer.parseInt(tv.getAutobus().getNumautobus())); + } + rh.setNumcorrida(tv.getNumCorrida()); + rh.setFechorsalida(tv.getFecHorSalida()); + + rh.setCantkmsoperador1(tv.getKmPagoConductor()); + rh.setCantkmsoperador2(tv.getKmPagoConductor()); + + if (tv.getConductor() != null) { + if (tv.getConductor().getEmpleado() != null) { + rh.setCveoperador1(tv.getConductor().getEmpleado().getCveEmpleado()); + rh.setNombreoperador1(tv.getConductor().getEmpleado().getNombEmpleado()); + } + } + if (tv.getConductor1() != null) { + if (tv.getConductor1().getEmpleado() != null) { + rh.setCveoperador2(tv.getConductor1().getEmpleado().getCveEmpleado()); + rh.setNombreoperador2(tv.getConductor1().getEmpleado().getNombEmpleado()); + } + } + if (tv.getMarca() != null) { + rh.setMarca(tv.getMarca().getMarcaId()); + } + if (corrida != null) { + if (corrida.getRuta() != null) { + rh.setRuta(corrida.getRuta().getRutaId()); + String descRuta = corrida.getRuta().getDescruta(); + rh.setDescruta(descRuta.length() > 29 ? descRuta.substring(0, 30) : descRuta); + rh.setCveOrigen(rutaService.getOrigem(corrida.getRuta()).getCveparada()); + rh.setCveDestino(rutaService.getDestino(corrida.getRuta()).getCveparada()); + } + + boolean pisoExtra = (corrida.getNumPiso() == null) ? false + : corrida.getNumPiso() == 2 ? true : false; + rh.setIndextra(pisoExtra); + } + log.debug("RH_SALIDAS: NUMAUTOBUS: " + rh.getNumautobus() + " NUMCORRIDA: " + rh.getNumcorrida() + + " DESCRUTA: " + rh.getDescruta() + " FECHORSALIDA: " + rh.getFechorsalida() + + " CVEOPERADOR1: " + rh.getCveoperador1() + " NOMBREOPERADOR1: " + rh.getNombreoperador1() + " CANTKMSOPERADOR1: " + rh.getCantkmsoperador1() + + " CVEOPERADOR2: " + rh.getCveoperador2() + " NOMBREOPERADOR2: " + rh.getNombreoperador2() + " CANTKMSOPERADOR2: " + rh.getCantkmsoperador2() + + " INDEXTRA: " + rh.getIndextra() + " CVEORIGEN: " + rh.getCveOrigen() + " CVEDESTINO: " + rh.getCveDestino() + " RUTA_ID: " + rh.getRuta()); + rhPagoConductorService.suscribir(rh); + } + + } catch (Exception e) { + log.error(e); + return null; + } + + return lsTarjetas; + } + + @Transactional + public void actulizarTarjetasEnviadas(List lsTarjetas) { + for (TarjetaViaje tarjeta : lsTarjetas) { + tarjeta.setFecenvionomina(new Date()); + tarjetaViajeDAO.actualizacion(tarjeta); + } + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCiudadServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCiudadServiceImpl.java new file mode 100644 index 000000000..95a68d6f8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCiudadServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoCambioCiudadDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import com.rjconsultores.ventaboletos.service.TipoCambioCiudadService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoCambioCiudadService") +public class TipoCambioCiudadServiceImpl implements TipoCambioCiudadService { + + @Autowired + private TipoCambioCiudadDAO tipoCambioCiudadDAO; + + public List obtenerTodos() { + return tipoCambioCiudadDAO.obtenerTodos(); + } + + public TipoCambioCiudad obtenerID(Integer id) { + return tipoCambioCiudadDAO.obtenerID(id); + } + + @Transactional + public TipoCambioCiudad suscribir(TipoCambioCiudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCambioCiudadDAO.suscribir(entidad); + } + + @Transactional + public TipoCambioCiudad actualizacion(TipoCambioCiudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCambioCiudadDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoCambioCiudad entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoCambioCiudadDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCtrlServiceImpl.java new file mode 100644 index 000000000..0f4ffa092 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoCambioCtrlServiceImpl.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoCambioCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; +import com.rjconsultores.ventaboletos.service.TipoCambioCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoCambioCtrlService") +public class TipoCambioCtrlServiceImpl implements TipoCambioCtrlService { + + @Autowired + private TipoCambioCtrlDAO tipoCambioCtrlDAO; + + public List obtenerTodos() { + return tipoCambioCtrlDAO.obtenerTodos(); + } + + public TipoCambioCtrl obtenerID(Integer id) { + return tipoCambioCtrlDAO.obtenerID(id); + } + + @Transactional + public TipoCambioCtrl suscribir(TipoCambioCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCambioCtrlDAO.suscribir(entidad); + } + + @Transactional + public TipoCambioCtrl actualizacion(TipoCambioCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCambioCtrlDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoCambioCtrl entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + for (TipoCambioCiudad tcc : entidad.getTipoCambioCiudadList()) { + tcc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tcc.setFecmodif(Calendar.getInstance().getTime()); + tcc.setActivo(Boolean.FALSE); + } + + tipoCambioCtrlDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoConvenioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoConvenioServiceImpl.java new file mode 100644 index 000000000..be9301e07 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoConvenioServiceImpl.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoConvenioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.service.TipoConvenioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("tipoConvenioService") +public class TipoConvenioServiceImpl implements TipoConvenioService{ + + @Autowired + private TipoConvenioDAO tcdao; + + public List obtenerTodos() { + return tcdao.obtenerTodos(); + } + + public TipoConvenio obtenerID(Integer id) { + return tcdao.obtenerID(id); + } + + @Transactional + public TipoConvenio suscribir(TipoConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tcdao.suscribir(entidad); + } + + @Transactional + public TipoConvenio actualizacion(TipoConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tcdao.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoConvenio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tcdao.actualizacion(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoCorteServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoCorteServiceImpl.java new file mode 100644 index 000000000..64f8fbdd8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoCorteServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoCorteDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import com.rjconsultores.ventaboletos.service.TipoCorteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoCorteService") +public class TipoCorteServiceImpl implements TipoCorteService { + + @Autowired + private TipoCorteDAO tipoCorteDAO; + + public List obtenerTodos() { + return tipoCorteDAO.obtenerTodos(); + } + + public TipoCorte obtenerID(Integer id) { + return tipoCorteDAO.obtenerID(id); + } + + @Transactional + public TipoCorte suscribir(TipoCorte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCorteDAO.suscribir(entidad); + } + + @Transactional + public TipoCorte actualizacion(TipoCorte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCorteDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoCorte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoCorteDAO.actualizacion(entidad); + } + + public List buscar(String desctipo) { + return tipoCorteDAO.buscar(desctipo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaDescuentoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaDescuentoServiceImpl.java new file mode 100644 index 000000000..56c6dc915 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaDescuentoServiceImpl.java @@ -0,0 +1,94 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoCortesiaDescuentoDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import com.rjconsultores.ventaboletos.service.TipoCortesiaDescuentoService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("tipoCortesiaDService") +public class TipoCortesiaDescuentoServiceImpl implements TipoCortesiaDescuentoService { + + @Autowired + private TipoCortesiaDescuentoDAO tipoCortesiaDescuentoDAO; + @Autowired + private TipoCortesiaService tcDAO; + + public List obtenerTodos() { + return tipoCortesiaDescuentoDAO.obtenerTodos(); + } + + public TipoCortesiaDescuento obtenerID(Integer id) { + return tipoCortesiaDescuentoDAO.obtenerID(id); + } + + @Transactional + public TipoCortesiaDescuento suscribir(TipoCortesiaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCortesiaDescuentoDAO.suscribir(entidad); + } + + @Transactional + public TipoCortesiaDescuento actualizacion(TipoCortesiaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCortesiaDescuentoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoCortesiaDescuento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoCortesiaDescuentoDAO.actualizacion(entidad); + } + + public List pesquisar(TipoCortesia tipoCortesia) { + + return tipoCortesiaDescuentoDAO.pesquisar(tipoCortesia); + + } + + public List Onchangue(TipoCortesia tp) { + List tc = tcDAO.obtenerTodos(); + TipoCortesia Tcselec = null; + for (TipoCortesia tpc : tc) { + + if (tpc.getTipocortesiaId().equals(tp.getTipocortesiaId())) { + Tcselec = tpc; + } + } + + return tipoCortesiaDescuentoDAO.Onchangue(Tcselec); + } + + public List buscar(BigDecimal porcentaje, + TipoCortesia tipoCortesia) { + return tipoCortesiaDescuentoDAO.buscar(porcentaje, tipoCortesia); + } + + public List obtenerTipoCortesia(int i) { + return tipoCortesiaDescuentoDAO.obtenerTipoCortesia(i); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaServiceImpl.java new file mode 100644 index 000000000..ce104fbb6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoCortesiaServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoCortesiaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Shiro + */ +@Service("tipoCortesiaService") +public class TipoCortesiaServiceImpl implements TipoCortesiaService { + + @Autowired + private TipoCortesiaDAO tipoCortesiaDAO; + + public List obtenerTodos() { + return tipoCortesiaDAO.obtenerTodos(); + } + + public TipoCortesia obtenerID(Integer id) { + return tipoCortesiaDAO.obtenerID(id); + } + + @Transactional + public TipoCortesia suscribir(TipoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCortesiaDAO.suscribir(entidad); + } + + @Transactional + public TipoCortesia actualizacion(TipoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoCortesiaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoCortesia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoCortesiaDAO.actualizacion(entidad); + } + + public List buscar(String descTipo) { + return tipoCortesiaDAO.buscar(descTipo); + } + + public List obtenerGrupoCortesia(int i) { + return tipoCortesiaDAO.obtenerGrupoCortesia(i); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoDomicilioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoDomicilioServiceImpl.java new file mode 100644 index 000000000..3df08d768 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoDomicilioServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoDomicilioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import com.rjconsultores.ventaboletos.service.TipoDomicilioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoDomicilioService") +public class TipoDomicilioServiceImpl implements TipoDomicilioService { + + @Autowired + private TipoDomicilioDAO tipoDomicilioDAO; + + public List obtenerTodos() { + return tipoDomicilioDAO.obtenerTodos(); + } + + public TipoDomicilio obtenerID(Integer id) { + return tipoDomicilioDAO.obtenerID(id); + } + + @Transactional + public TipoDomicilio suscribir(TipoDomicilio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoDomicilioDAO.suscribir(entidad); + } + + @Transactional + public TipoDomicilio actualizacion(TipoDomicilio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoDomicilioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoDomicilio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoDomicilioDAO.actualizacion(entidad); + } + + public List buscar(String desctipo, String cvetipodomicilio) { + return tipoDomicilioDAO.buscar(desctipo, cvetipodomicilio); + } + + public List buscarClave(String cvetipodomicilio) { + return tipoDomicilioDAO.buscarClave(cvetipodomicilio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java new file mode 100644 index 000000000..019b5217f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoEventoExtraDAO; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.TipoEventoExtraService; +import com.rjconsultores.ventaboletos.service.EventoExtraService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoEventoExtraService") +public class TipoEventoExtraServiceImpl implements TipoEventoExtraService { + + @Autowired + private TipoEventoExtraDAO tipoEventoExtraDAO; + @Autowired + private EventoExtraService eventoExtraService; + + public List obtenerTodos() { + return tipoEventoExtraDAO.obtenerTodos(); + } + + public TipoEventoExtra obtenerID(Integer id) { + return tipoEventoExtraDAO.obtenerID(id); + } + @Transactional + public TipoEventoExtra suscribir(TipoEventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoEventoExtraDAO.suscribir(entidad); + } + + @Transactional + public TipoEventoExtra actualizacion(TipoEventoExtra entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoEventoExtraDAO.actualizacion(entidad); + } + + @Transactional(rollbackFor=BusinessException.class) + public void borrar(TipoEventoExtra entidad) throws BusinessException { + + if (!eventoExtraService.obtenerPorTipo(entidad).isEmpty()) { + throw new BusinessException("editarTipoEventoExtraController.MSG.evento"); + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoEventoExtraDAO.actualizacion(entidad); + } + + @Override + public List buscar(String descingreso) { + return tipoEventoExtraDAO.buscar(descingreso); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoMovimientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoMovimientoServiceImpl.java new file mode 100644 index 000000000..8cae6820d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoMovimientoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoMovimientoDAO; +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import com.rjconsultores.ventaboletos.service.TipoMovimientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoMovimientoService") +public class TipoMovimientoServiceImpl implements TipoMovimientoService { + + @Autowired + private TipoMovimientoDAO tipoMovimientoDAO; + + public List obtenerTodos() { + return tipoMovimientoDAO.obtenerTodos(); + } + + public TipoMovimiento obtenerID(Integer id) { + return tipoMovimientoDAO.obtenerID(id); + } + + @Transactional + public TipoMovimiento suscribir(TipoMovimiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoMovimientoDAO.suscribir(entidad); + } + + @Transactional + public TipoMovimiento actualizacion(TipoMovimiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoMovimientoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoMovimiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoMovimientoDAO.actualizacion(entidad); + } + + public List buscar(String descmovimiento) { + return tipoMovimientoDAO.buscar(descmovimiento); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoOcupacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoOcupacionServiceImpl.java new file mode 100644 index 000000000..4ce1ccad7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoOcupacionServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import com.rjconsultores.ventaboletos.service.TipoOcupacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoOcupacionService") +public class TipoOcupacionServiceImpl implements TipoOcupacionService { + + @Autowired + private TipoOcupacionDAO tipoOcupacionDAO; + + public List obtenerTodos() { + return tipoOcupacionDAO.obtenerTodos(); + } + + public TipoOcupacion obtenerID(Integer id) { + return tipoOcupacionDAO.obtenerID(id); + } + + @Transactional + public TipoOcupacion suscribir(TipoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoOcupacionDAO.suscribir(entidad); + } + + @Transactional + public TipoOcupacion actualizacion(TipoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoOcupacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoOcupacionDAO.actualizacion(entidad); + } + + public List buscar(String desctipo, String cvetipoocupacion) { + return tipoOcupacionDAO.buscar(desctipo, cvetipoocupacion); + } + + public List buscarClave(String cvetipoocupacion) { + return tipoOcupacionDAO.buscarClave(cvetipoocupacion); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoParadaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoParadaServiceImpl.java new file mode 100644 index 000000000..713696520 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoParadaServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.ParadaDAO; +import com.rjconsultores.ventaboletos.dao.TipoParadaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import com.rjconsultores.ventaboletos.service.TipoParadaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoParadaService") +public class TipoParadaServiceImpl implements TipoParadaService { + + @Autowired + private TipoParadaDAO tipoParadaDAO; + @Autowired + private ParadaDAO paradaDAO; + + public List obtenerTodos() { + return tipoParadaDAO.obtenerTodos(); + } + + public TipoParada obtenerID(Integer id) { + return tipoParadaDAO.obtenerID(id); + } + + @Transactional + public TipoParada suscribir(TipoParada entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoParadaDAO.suscribir(entidad); + } + + @Transactional + public TipoParada actualizacion(TipoParada entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoParadaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoParada entidad) throws RegistroConDependenciaException{ + if (paradaDAO.count(entidad) > 0l) { + throw new RegistroConDependenciaException(); + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoParadaDAO.actualizacion(entidad); + } + + public List buscar(String desctipo) { + return tipoParadaDAO.buscar(desctipo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoPuntoVentaServiceImpl.java new file mode 100644 index 000000000..0e27b1d8e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoPuntoVentaServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tipoPuntoVentaService") +public class TipoPuntoVentaServiceImpl implements TipoPuntoVentaService { + + @Autowired + private TipoPuntoVentaDAO tipoPuntoVentaDAO; + + public List obtenerTodos() { + return tipoPuntoVentaDAO.obtenerTodos(); + } + + public TipoPuntoVenta obtenerID(Short id) { + return tipoPuntoVentaDAO.obtenerID(id); + } + + @Transactional + public TipoPuntoVenta suscribir(TipoPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoPuntoVentaDAO.suscribir(entidad); + } + + @Transactional + public TipoPuntoVenta actualizacion(TipoPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoPuntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoPuntoVentaDAO.actualizacion(entidad); + } + + public List buscar(String desctipo) { + return tipoPuntoVentaDAO.buscar(desctipo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoServicioServiceImpl.java new file mode 100644 index 000000000..445efeb88 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoServicioServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.service.TipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("tipoServicioService") +public class TipoServicioServiceImpl implements TipoServicioService { + + @Autowired + private TipoServicioDAO tipoServicioDAO; + + public List obtenerTodos() { + return tipoServicioDAO.obtenerTodos(); + } + + public TipoServicio obtenerID(Integer id) { + return tipoServicioDAO.obtenerID(id); + } + + @Transactional + public TipoServicio suscribir(TipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoServicioDAO.suscribir(entidad); + } + + @Transactional + public TipoServicio actualizacion(TipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoServicioDAO.actualizacion(entidad); + } + + public List buscar(String descservicio) { + return tipoServicioDAO.buscar(descservicio); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoVentaServiceImpl.java new file mode 100644 index 000000000..b4a81f639 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoVentaServiceImpl.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TipoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import com.rjconsultores.ventaboletos.service.TipoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("tipoVentaService") +public class TipoVentaServiceImpl implements TipoVentaService { + + @Autowired + private TipoVentaDAO tipoVentaDAO; + + public List obtenerTodos() { + return tipoVentaDAO.obtenerTodos(); + } + + public TipoVenta obtenerID(Integer id) { + return tipoVentaDAO.obtenerID(id); + } + + @Transactional + public TipoVenta suscribir(TipoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoVentaDAO.suscribir(entidad); + } + + @Transactional + public TipoVenta actualizacion(TipoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tipoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TipoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tipoVentaDAO.actualizacion(entidad); + } + + public List buscar(String desctipoventa) { + return tipoVentaDAO.buscar(desctipoventa); + } + + public TipoVenta obtenerID(Short tipoventaId) { + return tipoVentaDAO.obtenerID(tipoventaId); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TramoKmServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TramoKmServicioServiceImpl.java new file mode 100644 index 000000000..20fd1c281 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TramoKmServicioServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TramoKmServicioDAO; +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import com.rjconsultores.ventaboletos.service.TramoKmServicioService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Desenvolvimento + */ +@Service("tramoKmServicioService") +public class TramoKmServicioServiceImpl implements TramoKmServicioService { + + @Autowired + private TramoKmServicioDAO tramoKmServicioDAO; + @Autowired + private TramoService tramoService; + + public List obtenerTodos() { + return tramoKmServicioDAO.obtenerTodos(); + } + + public TramoKmServicio obtenerID(Integer id) { + return tramoKmServicioDAO.obtenerID(id); + } + + @Transactional + public TramoKmServicio suscribir(TramoKmServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoKmServicioDAO.suscribir(entidad); + } + + @Transactional + public TramoKmServicio actualizacion(TramoKmServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoKmServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TramoKmServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tramoKmServicioDAO.actualizacion(entidad); + } + + public List buscar(TramoKmServicio tramoKmServicio) { + return tramoKmServicioDAO.buscar(tramoKmServicio); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TramoRutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TramoRutaServiceImpl.java new file mode 100644 index 000000000..9f1f18949 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TramoRutaServiceImpl.java @@ -0,0 +1,309 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TramoRutaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.TramoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.DateUtil.Hora; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO; + +@Service("tramoRutaService") +public class TramoRutaServiceImpl implements TramoRutaService { + private static Logger log = Logger.getLogger(TramoRutaServiceImpl.class); + @Autowired + private RutaService rutaService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + @Autowired + private TramoService tramoService; + @Autowired + private TramoServicioService tramoServicioService; + + private void validarGenerarTramosRutas(RutaTramoVO rutaTramoVO) throws BusinessException { + if (rutaTramoVO.getLsSecuenciaRutaTramoVO().isEmpty()) { + throw new BusinessException("tramoRutaServiceImpl.msg.secuenciaObligatorio"); + } + if (rutaTramoVO.getLsEmpresa().isEmpty()) { + throw new BusinessException("tramoRutaServiceImpl.msg.empresaObligatoria"); + } + + if (rutaTramoVO.getLsCombinacionRutaTramoVO().isEmpty()) { + throw new BusinessException("tramoRutaServiceImpl.msg.combinacionObligatorio"); + } + for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) { + if (s.getTramoId() != null) { + continue; + } + if ((s.getOrigen() == null) || (s.getDestino() == null) || (s.getVia() == null) || (s.getKmPagoConductor() == null) + || (s.getKmReal() == null) || (s.getSecuencia() == null) || (s.getTiempoRecorrido() == null) ) { + throw new BusinessException("tramoRutaServiceImpl.msg.cambosObligatoriosCombinacion", new Object[] { s.getOrigen(), + s.getDestino() }); + } + } + for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsSecuenciaRutaTramoVO()) { + if (s.getTramoId() != null) { + continue; + } + if ((s.getOrigen() == null) || (s.getDestino() == null) || (s.getVia() == null) || (s.getKmPagoConductor() == null) + || (s.getKmReal() == null) || (s.getSecuencia() == null)|| (s.getTiempoRecorrido() == null)) { + throw new BusinessException("tramoRutaServiceImpl.msg.cambosObligatoriosSecuencia", new Object[] { s.getOrigen(), + s.getDestino() }); + } + } + } + + @Transactional(rollbackFor=BusinessException.class) + @Override + public Ruta generarTramosRutas(RutaTramoVO rutaTramoVO) throws BusinessException { + + this.validarGenerarTramosRutas(rutaTramoVO); + + List lsRutaExiste = rutaService.buscar(rutaTramoVO.getDescRuta(), rutaTramoVO.getClaseServicio(), + rutaTramoVO.getSolicitaNombrePasajero()); + + if (!lsRutaExiste.isEmpty()) { + throw new BusinessException("MSG.Registro.Existe"); + } + + // Genero los tramos y tramos servicios de la combinacion que no existen + // Aqui si genera tambien los tramos de la secuencia + for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) { + log.debug("Origen:" + s.getOrigen() + ";Destino:" + s.getDestino() + ";Via:" + s.getVia()); + boolean fueGenerado = tramoServicioService.generarTramoTiempo(s.getOrigen(), s.getDestino(), s.getVia(), s.getKmReal(), + s.getKmPagoConductor(), s.getTiempoRecorrido().getFecha(), rutaTramoVO.getClaseServicio()); + log.debug("Fue Generado:" + fueGenerado); + } + + //Genero la relacion de ruta con empresa + List lsRutaEmpresa = new ArrayList(); + for(Empresa e:rutaTramoVO.getLsEmpresa()){ + RutaEmpresa rutaEmpresa= new RutaEmpresa(); + rutaEmpresa.setEmpresa(e); + rutaEmpresa.setActivo(Boolean.TRUE); + rutaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + rutaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + lsRutaEmpresa.add(rutaEmpresa); + } + + // Genero la ruta + Ruta ruta = new Ruta(); + ruta.setDescruta(rutaTramoVO.getDescRuta()); + ruta.setClaseServicio(rutaTramoVO.getClaseServicio()); + ruta.setIndNombreObligatorio(rutaTramoVO.getSolicitaNombrePasajero()); + ruta.setVentaOffLine(rutaTramoVO.getVentaHandHeld()); + ruta.setLsRutaEmpresa(lsRutaEmpresa); + //ruta = rutaService.suscribir(ruta); + + + + // Genero la secuencia de la ruta + for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsSecuenciaRutaTramoVO()) { + RutaSecuencia rutaSecuencia = new RutaSecuencia(); + rutaSecuencia.setNumsecuencia(s.getSecuencia().shortValue()); + rutaSecuencia.setTramo(tramoService.obtenerTramotPorOrigemDestinoVia(s.getOrigen(), s.getDestino(), s.getVia())); + rutaSecuencia.setRuta(ruta); + rutaSecuencia = rutaSecuenciaService.suscribir(rutaSecuencia); + } + + for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) { + RutaCombinacion rutaCombinacion = new RutaCombinacion(); + rutaCombinacion.setIndventa(Boolean.TRUE); + rutaCombinacion.setRuta(ruta); + rutaCombinacion.setTramo(tramoService.obtenerTramotPorOrigemDestinoVia(s.getOrigen(), s.getDestino(), s.getVia())); + + rutaCombinacion = rutaCombinacionService.suscribir(rutaCombinacion); + } + + return ruta; + } + + @Override + public RutaTramoVO generarRutaRegreso(RutaTramoVO rutaTramoVO) { + RutaTramoVO rutaTramoRegresoVO = new RutaTramoVO(); + rutaTramoRegresoVO.setClaseServicio(rutaTramoVO.getClaseServicio()); + rutaTramoRegresoVO.setSolicitaNombrePasajero(rutaTramoVO.getSolicitaNombrePasajero()); + rutaTramoRegresoVO.setVentaHandHeld(rutaTramoVO.getVentaHandHeld()); + rutaTramoRegresoVO.setLsEmpresa(rutaTramoVO.getLsEmpresa()); + + List lsSecuenciaRutaTramoRegresoVO = new ArrayList(); + List lsSecuenciaRutaTramoIdaVO = new ArrayList(rutaTramoVO.getLsSecuenciaRutaTramoVO()); + Collections.sort(lsSecuenciaRutaTramoIdaVO, new Comparator() { + + @Override + public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2) { + return o2.getSecuencia().compareTo(o1.getSecuencia()); + } + }); + + int secuencia = 0; + + for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoIdaVO) { + TramoServicio tramoServicio = tramoServicioService.buscar(s.getOrigen(), s.getDestino(), s.getVia(), rutaTramoVO.getClaseServicio()); + if (tramoServicio != null) { + s.setTramoId(tramoServicio.getTramo().getTramoId()); + s.setTramoServicioId(tramoServicio.getTramoservicioId()); + + lsSecuenciaRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmPagoConductor(), s.getKmReal(), s.getTiempoRecorrido(), + s.getTramoId(), s.getTramoServicioId())); + } else { + lsSecuenciaRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmPagoConductor(), s.getKmReal(), s.getTiempoRecorrido())); + } + } + rutaTramoRegresoVO.setLsSecuenciaRutaTramoVO(lsSecuenciaRutaTramoRegresoVO); + + List lsCombinacionRutaTramoRegresoVO = new ArrayList(); + List lsCombinacionTramoIdaVO = new ArrayList(rutaTramoVO.getLsCombinacionRutaTramoVO()); + Collections.sort(lsCombinacionTramoIdaVO, new Comparator() { + + @Override + public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2) { + return o2.getSecuencia().compareTo(o1.getSecuencia()); + } + }); + + secuencia = 0; + for (SecuenciaRutaTramoVO s : lsCombinacionTramoIdaVO) { + TramoServicio tramoServicio = tramoServicioService.buscar(s.getOrigen(), s.getDestino(), s.getVia(), rutaTramoVO.getClaseServicio()); + if (tramoServicio != null) { + s.setTramoId(tramoServicio.getTramo().getTramoId()); + s.setTramoServicioId(tramoServicio.getTramoservicioId()); + + lsCombinacionRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmPagoConductor(), s.getKmReal(), s.getTiempoRecorrido(), + s.getTramoId(), s.getTramoServicioId())); + } else { + lsCombinacionRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmPagoConductor(), s.getKmReal(), s.getTiempoRecorrido())); + } + + } + rutaTramoRegresoVO.setLsCombinacionRutaTramoVO(lsCombinacionRutaTramoRegresoVO); + + return rutaTramoRegresoVO; + } + + @Override + public List generarCombinacion(RutaTramoVO rutaTramoVO) { + List lsSecuenciaRutaTramoVO = new ArrayList(rutaTramoVO.getLsSecuenciaRutaTramoVO()); + List lsSecuenciaCombinacionRutaTramoVO = new ArrayList(); + + Collections.sort(lsSecuenciaRutaTramoVO, new Comparator() { + + @Override + public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2) { + return o1.getSecuencia().compareTo(o2.getSecuencia()); + } + }); +// Collections.sort(lsSecuenciaCombinacionRutaTramoVO, new Comparator() { +// +// @Override +// public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2) { +// return o1.getSecuencia().compareTo(o2.getSecuencia()); +// } +// }); + + int qtdTramos = lsSecuenciaRutaTramoVO.size(); + int secuencia = 0; + for (int i = 0; i < qtdTramos; i++) { + SecuenciaRutaTramoVO secuenciaInicial = lsSecuenciaRutaTramoVO.get(i); + Parada origen = secuenciaInicial.getOrigen(); + BigDecimal totalKmsReal = secuenciaInicial.getKmReal(); + BigDecimal totalKmsConductor = secuenciaInicial.getKmPagoConductor(); + Hora totalTiempoRecorrido = secuenciaInicial.getTiempoRecorrido(); + boolean primeraCombinacion = true; + int j = i + 1; + for (; j < (qtdTramos); j++) { + Parada destino = lsSecuenciaRutaTramoVO.get(j).getOrigen(); + + Via via = secuenciaInicial.getVia(); +// if (primeraCombinacion) { +// via = secuenciaInicial.getVia(); +// } + + SecuenciaRutaTramoVO nuevaSecuencia = new SecuenciaRutaTramoVO(origen, destino, via, ++secuencia, totalKmsConductor, + totalKmsReal, totalTiempoRecorrido); + + if (via != null) { + TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio()); + if (tramoServicio != null) { + log.debug("TRAMO EXISTE"); + + nuevaSecuencia.setKmPagoConductor(tramoServicio.getTramo().getKmPagoConductor()); + nuevaSecuencia.setKmReal(tramoServicio.getTramo().getKmReal()); + nuevaSecuencia.setTiempoRecorrido(new Hora(tramoServicio.getTiemporecorrido())); + nuevaSecuencia.setTramoId(tramoServicio.getTramo().getTramoId()); + nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId()); + + } + } + lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia); + + totalKmsReal = totalKmsReal.add(lsSecuenciaRutaTramoVO.get(j).getKmReal()); + totalKmsConductor = totalKmsConductor.add(lsSecuenciaRutaTramoVO.get(j).getKmPagoConductor()); + totalTiempoRecorrido = totalTiempoRecorrido.sumar(lsSecuenciaRutaTramoVO.get(j).getTiempoRecorrido()); + + log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:" + + nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";KmsConductor:" + + nuevaSecuencia.getKmPagoConductor() + ";hora:" + nuevaSecuencia.getTiempoRecorrido()); + + primeraCombinacion = false; + } + Parada destino = lsSecuenciaRutaTramoVO.get(qtdTramos - 1).getDestino(); + + Via via = secuenciaInicial.getVia(); +// if (primeraCombinacion) { +// via = secuenciaInicial.getVia(); +// } + + SecuenciaRutaTramoVO nuevaSecuencia = new SecuenciaRutaTramoVO(origen, destino, via, ++secuencia, totalKmsConductor, + totalKmsReal, totalTiempoRecorrido); + if (via != null) { + TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio()); + if (tramoServicio != null) { + log.debug("TRAMO EXISTE"); + + nuevaSecuencia.setKmPagoConductor(tramoServicio.getTramo().getKmPagoConductor()); + nuevaSecuencia.setKmReal(tramoServicio.getTramo().getKmReal()); + nuevaSecuencia.setTiempoRecorrido(new Hora(tramoServicio.getTiemporecorrido())); + nuevaSecuencia.setTramoId(tramoServicio.getTramo().getTramoId()); + nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId()); + } + } + + lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia); + log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:" + + nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";KmsConductor:" + + nuevaSecuencia.getKmPagoConductor() + ";hora:" + nuevaSecuencia.getTiempoRecorrido()); + + } + + return lsSecuenciaCombinacionRutaTramoVO; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TramoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TramoServiceImpl.java new file mode 100644 index 000000000..cc5bbe2e8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TramoServiceImpl.java @@ -0,0 +1,158 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("tramoService") +public class TramoServiceImpl implements TramoService { + + @Autowired + private TramoDAO tramoDAO; + + public List obtenerTodos() { + return tramoDAO.obtenerTodos(); + } + + public Tramo obtenerID(Integer id) { + return tramoDAO.obtenerID(id); + } + + @Transactional + public Tramo suscribir(Tramo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoDAO.suscribir(entidad); + } + + @Transactional + public Tramo actualizacion(Tramo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Tramo entidad) { + entidad = tramoDAO.obtenerID(entidad.getTramoId()); + + + if (entidad.getLsTramoTiempo() != null) { + for (TramoTiempo tramo : entidad.getLsTramoTiempo()) { + tramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramo.setFecmodif(Calendar.getInstance().getTime()); + tramo.setActivo(Boolean.FALSE); + } + } + + if (entidad.getTramoServicioList() != null) { + for (TramoServicio tramo : entidad.getTramoServicioList()) { + tramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramo.setFecmodif(Calendar.getInstance().getTime()); + tramo.setActivo(Boolean.FALSE); + } + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tramoDAO.actualizacion(entidad); + } + + public Tramo obtenerPorOrigemDestino(Parada origem, Parada destino) { + return tramoDAO.obtenerPorOrigemDestino(origem, destino); + } + + public List obtenerListPorOrigemDestino(Parada origem, Parada destino) { + return tramoDAO.obtenerListPorOrigemDestino(origem, destino); + } + + public Tramo obtenerTramotPorOrigemDestinoVia(Parada origem, Parada destino, Via via) { + return tramoDAO.obtenerTramotPorOrigemDestinoVia(origem, destino, via); + } + + public Tramo buscar(Parada origem, Parada destino, Via via) { + return tramoDAO.busca(origem, destino, via); + } + + public List buscarCveParada(String origen, String destino, String via) { + return tramoDAO.buscarCveParada(origen, destino, via); + } + + public Tramo obtenerTramoUnicoRuta(Parada origem, Parada destino, Via via, ClaseServicio claseServicio) { + return tramoDAO.obtenerTramoUnicoRuta(origem, destino, via, claseServicio); + } + + public List buscar(List lsParadas, Via via) { + List respuesta = new ArrayList(); + + Parada origen = lsParadas.get(0); + Parada destino = null; + + + for (int i = 1; i < lsParadas.size(); i++) { + destino = lsParadas.get(i); + Tramo busca = tramoDAO.busca(origen, destino, via); + + if (busca!= null) { + respuesta.add(busca); + } + } + + return respuesta; + } + + @Transactional + public void guardarTramosKm(List lsTramos, Via via) { + for (Tramo tramo : lsTramos) { + Tramo busca = tramoDAO.busca(tramo.getOrigem(), tramo.getDestino(), via); + if (busca==null) { + tramo.setVia(via); + tramo.setActivo(Boolean.TRUE); + tramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramo.setFecmodif(Calendar.getInstance().getTime()); + tramo.setDesctramo(tramo.getOrigem().getCveparada().trim()+"-"+tramo.getDestino().getCveparada().trim()); + tramoDAO.suscribir(tramo); + + } else { + Tramo tramoExiste = busca; + tramoExiste.setKmPagoConductor(tramo.getKmPagoConductor()); + tramoExiste.setKmReal(tramo.getKmReal()); + tramoExiste.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoExiste.setFecmodif(Calendar.getInstance().getTime()); + } + } + } + public List obtenerViasOrigemDestino(Parada origem, Parada destino) { + return tramoDAO.obtenerViasOrigemDestino(origem, destino); + } + public List obtenerPorOrigemDestinoFetchLazy(Parada origem, Parada destino) { + return tramoDAO.obtenerPorOrigemDestinoFetchLazy(origem, destino); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TramoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TramoServicioServiceImpl.java new file mode 100644 index 000000000..b2f9a42df --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TramoServicioServiceImpl.java @@ -0,0 +1,123 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.TramoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.TramoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Rafius + */ +@Service("tramoServicioService") +public class TramoServicioServiceImpl implements TramoServicioService { + + @Autowired + private TramoServicioDAO tramoServicioDAO; + @Autowired + private TramoService tramoService; + + public List obtenerTodos() { + return tramoServicioDAO.obtenerTodos(); + } + + public TramoServicio obtenerID(Integer id) { + return tramoServicioDAO.obtenerID(id); + } + + @Transactional + public TramoServicio suscribir(TramoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoServicioDAO.suscribir(entidad); + } + + @Transactional + public TramoServicio actualizacion(TramoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TramoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tramoServicioDAO.actualizacion(entidad); + } + + public List buscarPorTramo(Tramo tramo) { + return tramoServicioDAO.buscarPorTramo(tramo); + } + + public List buscarPorTramoServico(Tramo tramo, ClaseServicio clase) { + return tramoServicioDAO.buscarPorTramo(tramo, clase); + } + + @Override + public TramoServicio buscar(Parada origen, Parada destino, Via via, ClaseServicio clase) { + return tramoServicioDAO.buscar(origen, destino, via, clase); + } + + @Override + @Transactional + public boolean generarTramoTiempo(Parada origen, Parada destino, Via via, BigDecimal kmsReal, BigDecimal kmsConductor, + Date tiempoRecorrido, ClaseServicio claseServicio) { + + TramoServicio tramoServicio = tramoServicioDAO.buscar(origen, destino, via, claseServicio); + + Tramo tramo = null; + if (tramoServicio == null) { + tramo = tramoService.buscar(origen, destino, via); + if (tramo == null) { + tramo = new Tramo(); + String descTramo = origen.getCveparada() + "-" + destino.getCveparada() + "(" + via.getNombvia() + ")"; + if (descTramo.length() > 20) { + descTramo = descTramo.substring(0, 20); + } + tramo.setDesctramo(descTramo); + tramo.setOrigem(origen); + tramo.setDestino(destino); + tramo.setKmPagoConductor(kmsConductor); + tramo.setKmReal(kmsReal); + tramo.setVia(via); + + tramo = tramoService.suscribir(tramo); + } + tramoServicio = new TramoServicio(); + tramoServicio.setClaseServicio(claseServicio); + tramoServicio.setTramo(tramo); + tramoServicio.setTiemporecorrido(tiempoRecorrido); + + tramoServicio = this.suscribir(tramoServicio); + + return true; + } + + return false; + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TramoTiempoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TramoTiempoServiceImpl.java new file mode 100644 index 000000000..8c528eb3f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TramoTiempoServiceImpl.java @@ -0,0 +1,84 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.TramoTiempoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.TramoTiempoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +/** + * + * @author Administrador + */ +@Service("tramoTiempoService") +public class TramoTiempoServiceImpl implements TramoTiempoService { + + @Autowired + private TramoTiempoDAO tramoTiempoDAO; + @Autowired + private TramoService tramoService; + + + public List obtenerTodos() { + return tramoTiempoDAO.obtenerTodos(); + } + + public TramoTiempo obtenerID(Integer id) { + return tramoTiempoDAO.obtenerID(id); + } + + @Transactional + public TramoTiempo suscribir(TramoTiempo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoTiempoDAO.suscribir(entidad); + } + + @Transactional + public TramoTiempo actualizacion(TramoTiempo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return tramoTiempoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(TramoTiempo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + tramoTiempoDAO.actualizacion(entidad); + } + + public List buscarPorTramo(Tramo tramo) { + return tramoTiempoDAO.buscarPorTramo(tramo); + } + + public List buscarPorTramo(Tramo tramo,ClaseServicio clase) { + return tramoTiempoDAO.buscarPorTramo(tramo, clase); + } + + + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TurnoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TurnoServiceImpl.java new file mode 100644 index 000000000..c8509c966 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TurnoServiceImpl.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TurnoDAO; +import com.rjconsultores.ventaboletos.entidad.Turno; +import com.rjconsultores.ventaboletos.service.TurnoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("turnoService") +public class TurnoServiceImpl implements TurnoService { + + @Autowired + private TurnoDAO turnoDAO; + + public List obtenerTodos() { + return turnoDAO.obtenerTodos(); + } + + public Turno obtenerID(Integer id) { + return turnoDAO.obtenerID(id); + } + + @Transactional + public Turno suscribir(Turno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return turnoDAO.suscribir(entidad); + } + + @Transactional + public Turno actualizacion(Turno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return turnoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Turno entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + turnoDAO.actualizacion(entidad); + } + + public List buscar(String descturno) { + return turnoDAO.buscar(descturno); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioBancarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioBancarioServiceImpl.java new file mode 100644 index 000000000..436c2c27e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioBancarioServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.UsuarioBancarioDAO; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.service.UsuarioBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("usuarioBancarioService") +public class UsuarioBancarioServiceImpl implements UsuarioBancarioService { + + @Autowired + private UsuarioBancarioDAO usuarioBancarioDAO; + + public List obtenerTodos() { + return usuarioBancarioDAO.obtenerTodos(); + } + + public UsuarioBancario obtenerID(Integer id) { + return usuarioBancarioDAO.obtenerID(id); + } + + @Transactional + public UsuarioBancario suscribir(UsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioBancarioDAO.suscribir(entidad); + } + + @Transactional + public UsuarioBancario actualizacion(UsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioBancarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(UsuarioBancario entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + usuarioBancarioDAO.actualizacion(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioPerfilServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioPerfilServiceImpl.java new file mode 100644 index 000000000..9eadb8fa9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioPerfilServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.UsuarioPerfilDAO; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import com.rjconsultores.ventaboletos.service.UsuarioPerfilService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Rafius + */ +@Service("usuarioPerfilService") +public class UsuarioPerfilServiceImpl implements UsuarioPerfilService { + + @Autowired + private UsuarioPerfilDAO usuarioPerfilDAO; + + public List obtenerTodos() { + return usuarioPerfilDAO.obtenerTodos(); + } + + public UsuarioPerfil obtenerID(Integer id) { + return usuarioPerfilDAO.obtenerID(id); + } + + @Transactional + public UsuarioPerfil suscribir(UsuarioPerfil entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioPerfilDAO.suscribir(entidad); + } + + @Transactional + public UsuarioPerfil actualizacion(UsuarioPerfil entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioPerfilDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(UsuarioPerfil entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + usuarioPerfilDAO.actualizacion(entidad); + } + + public List obtenerPorUsuario(Usuario usuario) { + return usuarioPerfilDAO.obtenerPorUsuario(usuario); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java new file mode 100644 index 000000000..933e5a275 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java @@ -0,0 +1,104 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.UsuarioDAO; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import com.rjconsultores.ventaboletos.service.UsuarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("usuarioService") +public class UsuarioServiceImpl implements UsuarioService, UserDetailsService { + + @Autowired + private UsuarioDAO usuarioDAO; + + public List buscarPeloNome(String nome) { + return usuarioDAO.buscarPeloNome(nome); + } + + public String encriptarSenha(String login, String senha) { + org.springframework.security.authentication.encoding.Md5PasswordEncoder a = + new org.springframework.security.authentication.encoding.Md5PasswordEncoder(); + + return a.encodePassword(senha, login); + } + + public List obtenerTodos() { + return usuarioDAO.obtenerTodos(); + } + + public Usuario obtenerID(Integer id) { + return usuarioDAO.obtenerID(id); + } + + @Transactional + public Usuario suscribir(Usuario entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioDAO.suscribir(entidad); + } + + @Transactional + public Usuario actualizacion(Usuario entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Usuario entidad) { + + entidad = obtenerID(entidad.getUsuarioId()); + + for (UsuarioPerfil up : entidad.getUsuarioPerfilList()) { + up.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + up.setFecmodif(Calendar.getInstance().getTime()); + up.setActivo(Boolean.FALSE); + } + + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + usuarioDAO.actualizacion(entidad); + } + + public Usuario buscarPeloNomeSenha(String stUsuario, String senha) { + return usuarioDAO.buscarPeloNomeSenha(stUsuario, senha); + } + + public UserDetails loadUserByUsername(String string) + throws UsernameNotFoundException, DataAccessException { + return UsuarioLogado.getUsuarioLogado(); + } + + public List buscarPorEmpleado(Empleado empleado) { + return usuarioDAO.buscarPorEmpleado(empleado); + } + + public List buscarPelaCveUsuario(String cveUsuario) { + return usuarioDAO.buscarPelaCveUsuario(cveUsuario); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioUbicacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioUbicacionServiceImpl.java new file mode 100644 index 000000000..13ff272cd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioUbicacionServiceImpl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.UsuarioUbicacionDAO; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import com.rjconsultores.ventaboletos.service.UsuarioUbicacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import org.springframework.stereotype.Service; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("usuarioUbicacionService") +public class UsuarioUbicacionServiceImpl implements UsuarioUbicacionService { + + @Autowired + private UsuarioUbicacionDAO usuarioUbicacionDAO; + + public List obtenerTodos() { + return usuarioUbicacionDAO.obtenerTodos(); + } + + public UsuarioUbicacion obtenerID(Integer id) { + return usuarioUbicacionDAO.obtenerID(id); + } + + @Transactional + public UsuarioUbicacion suscribir(UsuarioUbicacion entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioUbicacionDAO.suscribir(entidad); + } + + @Transactional + public UsuarioUbicacion actualizacion(UsuarioUbicacion entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return usuarioUbicacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(UsuarioUbicacion entidad) { + entidad.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + usuarioUbicacionDAO.actualizacion(entidad); + } + + public List buscarPorUsuario(Usuario usuario) { + return usuarioUbicacionDAO.buscarPorUsuario(usuario); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ViaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ViaServiceImpl.java new file mode 100644 index 000000000..64c6024e0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ViaServiceImpl.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.dao.ViaDAO; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author Administrador + */ +@Service("viaService") +public class ViaServiceImpl implements ViaService { + + @Autowired + private ViaDAO viaDAO; + @Autowired + private TramoDAO tramoDAO; + + public List obtenerTodos() { + return viaDAO.obtenerTodos(); + } + + public Via obtenerID(Integer id) { + return viaDAO.obtenerID(id); + } + + @Transactional + public Via suscribir(Via entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return viaDAO.suscribir(entidad); + } + + @Transactional + public Via actualizacion(Via entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return viaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(Via entidad) throws RegistroConDependenciaException { + if (tramoDAO.count("via", entidad) > 0l) { + throw new RegistroConDependenciaException(); + } + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + viaDAO.actualizacion(entidad); + } + + public List buscar(String nombvia) { + return viaDAO.buscar(nombvia); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/VigenciaTarifaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/VigenciaTarifaServiceImpl.java new file mode 100644 index 000000000..0a119855e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/VigenciaTarifaServiceImpl.java @@ -0,0 +1,71 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service.impl; + +import com.rjconsultores.ventaboletos.dao.VigenciaTarifaDAO; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * + * @author rodrigo + */ +@Service("vigenciaTarifaService") +public class VigenciaTarifaServiceImpl implements VigenciaTarifaService { + + @Autowired + private VigenciaTarifaDAO vigenciaTarifaDAO; + + public List obtenerTodos() { + return vigenciaTarifaDAO.obtenerTodos(); + } + + public VigenciaTarifa obtenerID(Integer id) { + return vigenciaTarifaDAO.obtenerID(id); + } + + @Transactional + public VigenciaTarifa suscribir(VigenciaTarifa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return vigenciaTarifaDAO.suscribir(entidad); + } + + @Transactional + public VigenciaTarifa actualizacion(VigenciaTarifa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return vigenciaTarifaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(VigenciaTarifa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + vigenciaTarifaDAO.actualizacion(entidad); + } + + public List pesquisar(Date inicio, Date fim) { + return vigenciaTarifaDAO.pesquisar(inicio, fim); + } + + + public List buscarVigenciasIntervalo(VigenciaTarifa vigenciaTarifa) { + return vigenciaTarifaDAO.buscarVigenciasIntervalo(vigenciaTarifa); + } +} diff --git a/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java b/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java new file mode 100644 index 000000000..0afcd4b2f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java @@ -0,0 +1,98 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.utilerias; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import org.apache.log4j.Logger; +import org.springframework.core.io.ClassPathResource; + +/** + * Clase con las propriedad especificas de los clientes + * @author Administrador + */ +public class ApplicationProperties { + + private static Logger log = Logger.getLogger(ApplicationProperties.class); + private static ApplicationProperties INSTANCE; + private static Properties p; + + private ApplicationProperties() { + p = new Properties(); + this.readConfiguration(); + } + + private void readConfiguration() { + try { + + InputStream is = new ClassPathResource("/com/rjconsultores/ventaboletos/web/cliente/conf/application.properties").getInputStream(); + p.load(is); + is.close(); + } catch (IOException e) { + log.error(e); + } + } + + public static ApplicationProperties getInstance() { + if (INSTANCE == null) { + INSTANCE = new ApplicationProperties(); + } + + return INSTANCE; + } + + /** + * Indica se la informacion de equivalencia es visible + * @return + */ + public boolean mostrarEquivalencia(){ + String property = p.getProperty("equivalencia.mostrar", "0"); + return property.equals("1"); + } + /** + * Indica se es gerado o campo equivalencia corrida na tabela de corrida + * @return + */ + public boolean gerarCampoEquivalenciaCorrida(){ + String property = p.getProperty("corrida.gerarCampoEquivalencia", "0"); + return property.equals("1"); + } + /** + * Indica exibe o combo de Division na Gera��o de Corridas do Esquema Operacional. + * @return + */ + public boolean exibirDivisionConfiguracionCorrida(){ + String property = p.getProperty("esquemaOperacional.configuracionCorrida.exibeDivision", "0"); + return property.equals("1"); + } + /** + * Indica se va a exhibir la cuenta contable en el catalogo de tipos de eventos + * @return + */ + public boolean exhibirCuentaContableTiposEventos(){ + String property = p.getProperty("eventosExtras.tiposEventos.exhibirCuentaContable", "1"); + return property.equals("1"); + } + /** + * Indica se va a exhibir la "aba" de excepciones de tramo_km en la pantalla de tramos + * @return + */ + public boolean exhibirExcepcionesTramoKm(){ + String property = p.getProperty("tramos.exhibirExcepcionesTramoKm", "0"); + return property.equals("1"); + } + /** + * Indica se vai exibir botão na modificação massiva de tarifa de + * geração automatica de tarifas + * @return + */ + public boolean generarTarifasAutomatica(){ + String property = p.getProperty("tarifa.generarTarifasAutomatica", "0"); + return property.equals("1"); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/utilerias/DateUtil.java b/src/com/rjconsultores/ventaboletos/utilerias/DateUtil.java new file mode 100644 index 000000000..0022875f5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/DateUtil.java @@ -0,0 +1,577 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.utilerias; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.logging.Level; +import java.util.logging.Logger; + +public final class DateUtil { + + /** + * No need for an instance + */ + private DateUtil() { + } + + /** + * Elapsed days based on current time + * + * @param date + * Date + * + * @return int number of days + */ + public static int getElapsedDias(Date date) { + return elapsed(date, Calendar.DATE); + } + + /** + * Elapsed days based on two Date objects + * + * @param d1 + * Date + * @param d2 + * Date + * + * @return int number of days + */ + public static int getElapsedDias(Date d1, Date d2) { + return elapsed(d1, d2, Calendar.DATE); + } + + /** + * Elapsed months based on current time + * + * @param date + * Date + * + * @return int number of months + */ + public static int getElapsedMeses(Date date) { + return elapsed(date, Calendar.MONTH); + } + + /** + * Elapsed months based on two Date objects + * + * @param d1 + * Date + * @param d2 + * Date + * + * @return int number of months + */ + public static int getElapsedMeses(Date d1, Date d2) { + return elapsed(d1, d2, Calendar.MONTH); + } + + /** + * Elapsed years based on current time + * + * @param date + * Date + * + * @return int number of years + */ + public static int getElapsedAnos(Date date) { + return elapsed(date, Calendar.YEAR); + } + + /** + * Elapsed years based on two Date objects + * + * @param d1 + * Date + * @param d2 + * Date + * + * @return int number of years + */ + public static int getElapsedAnos(Date d1, Date d2) { + return elapsed(d1, d2, Calendar.YEAR); + } + + /** + * All elaspsed types + * + * @param g1 + * GregorianCalendar + * @param g2 + * GregorianCalendar + * @param type + * int (Calendar.FIELD_NAME) + * + * @return int number of elapsed "type" + */ + private static int elapsed(GregorianCalendar g1, GregorianCalendar g2, int type) { + GregorianCalendar gc1, gc2; + int elapsed = 0; + // Create copies since we will be clearing/adding + if (g2.after(g1)) { + gc2 = (GregorianCalendar) g2.clone(); + gc1 = (GregorianCalendar) g1.clone(); + } else { + gc2 = (GregorianCalendar) g1.clone(); + gc1 = (GregorianCalendar) g2.clone(); + } + if (type == Calendar.MONTH || type == Calendar.YEAR) { + gc1.clear(Calendar.DATE); + gc2.clear(Calendar.DATE); + } + if (type == Calendar.YEAR) { + gc1.clear(Calendar.MONTH); + gc2.clear(Calendar.MONTH); + } + while (gc1.before(gc2)) { + gc1.add(type, 1); + elapsed++; + } + return elapsed; + } + + /** + * All elaspsed types based on date and current Date + * + * @param date + * Date + * @param type + * int (Calendar.FIELD_NAME) + * + * @return int number of elapsed "type" + */ + private static int elapsed(Date date, int type) { + return elapsed(date, new Date(), type); + } + + /** + * All elaspsed types + * + * @param d1 + * Date + * @param d2 + * Date + * @param type + * int (Calendar.FIELD_NAME) + * + * @return int number of elapsed "type" + */ + private static int elapsed(Date d1, Date d2, int type) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d1); + GregorianCalendar g1 = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); + cal.setTime(d2); + GregorianCalendar g2 = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); + return elapsed(g1, g2, type); + } + + public static Date getDateFromString(String data, String formato) throws java.text.ParseException { + Date d = new Date(); + DateFormat df = new SimpleDateFormat(formato); + + d = df.parse(data); + return d; + } + + public static int compareDate(java.util.Date d1) { + return compareDate(d1, new java.util.Date()); + } + + public static int compareOnlyDate(java.util.Date d1) { + return compareOnlyDate(d1, new java.util.Date()); + } + + /** + * Não leva em consideração os segundos + */ + public static int compareOnlyDate(java.util.Date d1, java.util.Date d2) { + java.util.Calendar cal = Calendar.getInstance(); + cal.setTime(d1); + GregorianCalendar g1 = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); + + java.util.Calendar cal2 = Calendar.getInstance(); + cal2.setTime(d2); + GregorianCalendar g2 = new GregorianCalendar(cal2.get(Calendar.YEAR), cal2.get(Calendar.MONTH), cal2.get(Calendar.DATE)); + return g1.compareTo(g2); + // return cal.compareTo(cal2); + } + + /** + * Retorna : - 0 se igual
+ * - < 0 se d1 < d2
+ * - > 0 se d1 > d2
+ */ + public static int compareDate(java.util.Date d1, java.util.Date d2) { + java.util.Calendar cal = Calendar.getInstance(); + cal.setTime(d1); + java.util.Calendar cal2 = Calendar.getInstance(); + cal2.setTime(d2); + + return cal.compareTo(cal2); + } + + public static Integer getIntegerDate(java.util.Date d, String formato) { + if (formato.contains("/")) { + throw new IllegalArgumentException("O formato não deve conter o simbolo \\ "); + } + + String s = getStringDate(d, formato); + return Integer.parseInt(s); + } + + public static String getStringDate(java.util.Date d, String formato) { + DateFormat df = new SimpleDateFormat(formato); + return df.format(d); + } + + public static String getStringDate(java.util.Date d) { + return getStringDate(d, "dd/MM/yyyy"); + } + + public static String getStringDate(java.sql.Date d) { + return getStringDate(new java.util.Date(d.getTime())); + } + + public static String getStringCurrentDate(String formato) { + return getStringDate(new java.util.Date(), formato); + } + + public static String changeFormatStringDate(String date, String currentFormat, String newFormat) { + + try { + return DateUtil.getStringDate(DateUtil.getDateFromString(date, currentFormat), newFormat); + } catch (ParseException ex) { + Logger.getLogger(DateUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + public static Integer changeFormatIntDate(Integer date, String currentFormat, String newFormat) { + + try { + return DateUtil.getIntegerDate(DateUtil.getDateFromString(String.valueOf(date), currentFormat), newFormat); + } catch (ParseException ex) { + Logger.getLogger(DateUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + /** + * Retorna uma array onde [0] é hora, [1] é minuto + * + * @param hora + * @return + */ + private static int[] getArrayHora(Integer hora) { + + String strHora = String.valueOf(hora); + + int[] array = new int[2]; + + if (strHora.length() <= 2) { + array[0] = 0; + array[1] = Integer.parseInt(strHora); + } else if (strHora.length() == 3) { + array[0] = Integer.parseInt(strHora.substring(0, 1)); + array[1] = Integer.parseInt(strHora.substring(1)); + } else if (strHora.length() == 4) { + array[0] = Integer.parseInt(strHora.substring(0, 2)); + array[1] = Integer.parseInt(strHora.substring(2)); + } + + return array; + } + + public static java.util.Date changeFormatIntDate(Integer date, String currentFormat, Integer hora) { + + try { + if (currentFormat.equals("yMMdd") || currentFormat.equals("yyMMdd")) { + + currentFormat = "yyyyMMdd"; + String strData = String.valueOf(date); + + if (strData.length() == 5) { + strData = "200" + strData; + } else if (strData.length() == 6) { + strData = "20" + strData; + } + + date = Integer.parseInt(strData); + } + Date data = DateUtil.getDateFromString(String.valueOf(date), currentFormat); + + if (hora == null) { + return data; + } + + int horaArray[] = DateUtil.getArrayHora(hora); + Calendar c = Calendar.getInstance(); + c.setTime(data); + c.set(Calendar.HOUR_OF_DAY, horaArray[0]); + c.set(Calendar.MINUTE, horaArray[1]); + + return c.getTime(); + + } catch (ParseException ex) { + Logger.getLogger(DateUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + public static java.util.Date changeFormatStringDate(String date, String currentFormat, Integer hora) { + + try { + if (currentFormat.equals("yMMdd") || currentFormat.equals("yyMMdd")) { + + currentFormat = "yyyyMMdd"; + + if (date.length() == 5) { + date = "200" + date; + } else if (date.length() == 6) { + date = "20" + date; + } + } + Date data = DateUtil.getDateFromString(String.valueOf(date), currentFormat); + + if (hora == null) { + return data; + } + + int horaArray[] = DateUtil.getArrayHora(hora); + Calendar c = Calendar.getInstance(); + c.setTime(data); + c.set(Calendar.HOUR_OF_DAY, horaArray[0]); + c.set(Calendar.MINUTE, horaArray[1]); + + return c.getTime(); + + } catch (ParseException ex) { + Logger.getLogger(DateUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + public static int getIntHoraSRVP(Date data) { + Calendar c = Calendar.getInstance(); + c.setTime(data); + + String hora = String.valueOf(c.get(Calendar.HOUR_OF_DAY)); + hora = (hora.length() < 2) ? "0" + hora : hora; + + String minuto = String.valueOf(c.get(Calendar.MINUTE)); + minuto = (minuto.length() < 2) ? "0" + minuto : minuto; + + return Integer.parseInt(hora + minuto); + } + + public static long getElapsedHoras(Date dtInic, Date dtFim) { + return (dtFim.getTime() - dtInic.getTime()) / (1000 * 60 * 60); + } + + public static long getElapsedMinutos(Date dtInic, Date dtFim) { + return (dtFim.getTime() - dtInic.getTime()) / (1000 * 60); + } + + /** + * Regresa los minutos pela hora inicial del sistema + * + * @param dtInic + * @param dtFim + * @return + */ + public static Hora getHorasMinutosByInicio(Date dtFim) { + return new Hora(dtFim); + } + + /** + * Verifica se o intervalo de datas dtStartCompare e dtEndCompare estão + * dentro do intervalo dtStart dtEnd + * + * @param dtStart + * @param dtEnd + * @param dtStartCompare + * @param dtEndCompare + * @return + */ + public static boolean intersectDate(Date dtStart, Date dtEnd, Date dtStartCompare, Date dtEndCompare) { + return TraslaparUtil.intersectDate(dtStart, dtEnd, dtStartCompare, dtEndCompare); + } + + public static void main(String ar[]) { + // System.out.println(DateUtil.intersectNum(0, 100, 50, 150)); + } + + public static void main2(String args[]) { + java.util.Date agora = new java.util.Date(); + + System.out.println(agora); + + Calendar c = Calendar.getInstance(); + c.setTime(agora); + + System.out.println(DateUtil.getIntHoraSRVP(agora)); + // c.add(Calendar.MINUTE, 60); + + System.out.println("final " + c.getTime()); + System.out.println("1 " + c.get(Calendar.HOUR_OF_DAY)); + + } + + /** + * Es la fecInicial del sistema para campos de horas + * + * @return + */ + public static Calendar getFecInicio() { + Calendar c = Calendar.getInstance(); + c.set(Calendar.YEAR, 1970); + c.set(Calendar.DAY_OF_MONTH, 1); + c.set(Calendar.MONTH, 0); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.SECOND, 0); + + return c; + } + /** + * Es la fecInicial del sistema con los campos de hora y minutos del parametro informado + * + * @return + */ + public static Calendar getFecInicio(Date horaMinuto) { + Calendar tmp = Calendar.getInstance(); + tmp.setTime(horaMinuto); + Calendar c = getFecInicio(); + c.set(Calendar.HOUR_OF_DAY, tmp.get(Calendar.HOUR_OF_DAY)); + c.set(Calendar.MINUTE, tmp.get(Calendar.MINUTE)); + + + return c; + } + /** + * Es la fecInicial del sistema con los campos de hora y minutos del parametro informado + * + * @return + */ + public static Calendar getFecInicio(Integer hora,Integer minuto) { + + Calendar c = getFecInicio(); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + + return c; + } + + /** + * Quita los segundos y milesegundos de la fecha + * + * @param fecha + * @return + */ + public static Date normalizar(Date fecha) { + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(fecha); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 0); + + return gcalendar.getTime(); + } + /** + * Quita los segundos, milesegundos, hora y minuto de la fecha + * + * @param fecha + * @return + */ + public static Date normalizarToFecha(Date fecha) { + GregorianCalendar gcalendar = new GregorianCalendar(); + gcalendar.setTime(fecha); + gcalendar.set(Calendar.SECOND, 0); + gcalendar.set(Calendar.MILLISECOND, 0); + gcalendar.set(Calendar.HOUR_OF_DAY, 0); + gcalendar.set(Calendar.MINUTE, 0); + + return gcalendar.getTime(); + } + + public static class Hora { + private Integer hora; + private Integer minuto; + + public Hora() { + this.hora = 0; + this.minuto = 0; + } + + public Hora(Date fecha) { + conf(fecha); + } + + private void conf(Date fecha) { + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), fecha); + + long minutos = (tempo % 60); + int horas = (tempo.intValue() / 60); + + hora = horas; + minuto = (int) minutos; + + } + + @Override + public String toString() { + + return (hora + ":" + ((String.valueOf(minuto).length() < 2) ? "0" + minuto : minuto)); + } + + public Integer getHora() { + return hora; + } + + public Integer getMinuto() { + return minuto; + } + + public void setMinuto(Integer minuto) { + this.minuto = minuto; + } + + public void setHora(Integer hora) { + this.hora = hora; + } + + public Date getFecha() { + Calendar c = getFecInicio(); + c.add(Calendar.HOUR_OF_DAY, hora); + c.add(Calendar.MINUTE, minuto); + + return c.getTime(); + } + + public Hora sumar(Hora horaAdicao) { + Calendar horaAtual = Calendar.getInstance(); + horaAtual.setTime(getFecha()); + + Calendar horaSomar = Calendar.getInstance(); + horaSomar.setTime(horaAdicao.getFecha()); + + int horaTotal = horaAtual.get(Calendar.HOUR) + horaSomar.get(Calendar.HOUR); + int minutoTotal = horaAtual.get(Calendar.MINUTE) + horaSomar.get(Calendar.MINUTE); + + Calendar fecInicio = getFecInicio(); + fecInicio.add(Calendar.HOUR_OF_DAY, horaTotal); + fecInicio.add(Calendar.MINUTE, minutoTotal); + + return new Hora(fecInicio.getTime()); + } + + } +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/utilerias/RegistroConDependenciaException.java b/src/com/rjconsultores/ventaboletos/utilerias/RegistroConDependenciaException.java new file mode 100644 index 000000000..05d080742 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/RegistroConDependenciaException.java @@ -0,0 +1,18 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.utilerias; + +import org.zkoss.util.resource.Labels; + +/** + * + * @author gleimar + */ +public class RegistroConDependenciaException extends RuntimeException { + + public RegistroConDependenciaException() { + super(Labels.getLabel("MSG.exception.RegistroConDependenciaException")); + } +} diff --git a/src/com/rjconsultores/ventaboletos/utilerias/TraslaparUtil.java b/src/com/rjconsultores/ventaboletos/utilerias/TraslaparUtil.java new file mode 100644 index 000000000..ac81c5e1b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/TraslaparUtil.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.utilerias; + +import java.math.BigDecimal; +import java.util.Date; + + +/** + * Classe que ajuda na verificação se os dados se sobrepõe + * @author gleimar + */ +public class TraslaparUtil { + /** + * Verifica se o intervalo de datas dtStartCompare e dtEndCompare estão dentro do intervalo dtStart dtEnd + * + * @param dtStart + * @param dtEnd + * @param dtStartCompare + * @param dtEndCompare + * @return + */ + public static boolean intersectDate(Date dtStart, Date dtEnd, Date dtStartCompare, Date dtEndCompare) { + if (((DateUtil.compareDate(dtStart, dtStartCompare) >= 0) && (DateUtil.compareDate(dtEnd, dtEndCompare) <= 0)) + || ((DateUtil.compareDate(dtEnd, dtStartCompare) >= 0) && (DateUtil.compareDate(dtEnd, dtEndCompare) <= 0)) + || ((DateUtil.compareDate(dtStart, dtStartCompare) >= 0) && (DateUtil.compareDate(dtStart, dtEndCompare) <= 0)) + || ((DateUtil.compareDate(dtStart, dtStartCompare) <= 0) && (DateUtil.compareDate(dtEnd, dtEndCompare) >= 0))) { + + return true; + } + + return false; + } + + /** + * + * @param numStart + * @param numEnd + * @param numStartCompare + * @param numEndCompare + * @return + */ + public static boolean intersectNum(Long numStart, Long numEnd, Long numStartCompare, Long numEndCompare) { + if (((numStart.compareTo(numStartCompare) >= 0) && (numEnd.compareTo(numEndCompare) <= 0)) + || ((numEnd.compareTo(numStartCompare) >= 0) && (numEnd.compareTo(numEndCompare) <= 0)) + || ((numStart.compareTo(numStartCompare) >= 0) && (numStart.compareTo(numEndCompare) <= 0)) + || ((numStart.compareTo(numStartCompare) <= 0) && (numEnd.compareTo(numEndCompare) >= 0))) { + + return true; + } + + return false; + } + public static boolean intersectNum(BigDecimal numStart, BigDecimal numEnd, BigDecimal numStartCompare, BigDecimal numEndCompare) { + if (((numStart.compareTo(numStartCompare) >= 0) && (numEnd.compareTo(numEndCompare) <= 0)) + || ((numEnd.compareTo(numStartCompare) >= 0) && (numEnd.compareTo(numEndCompare) <= 0)) + || ((numStart.compareTo(numStartCompare) >= 0) && (numStart.compareTo(numEndCompare) <= 0)) + || ((numStart.compareTo(numStartCompare) <= 0) && (numEnd.compareTo(numEndCompare) >= 0))) { + + return true; + } + + return false; + } +} diff --git a/src/com/rjconsultores/ventaboletos/utilerias/UsuarioLogado.java b/src/com/rjconsultores/ventaboletos/utilerias/UsuarioLogado.java new file mode 100644 index 000000000..ccf0a9092 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/UsuarioLogado.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.utilerias; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; + +/** + * + * @author rodrigo + */ +public class UsuarioLogado { + + private static Usuario usuario; + + public static Usuario getUsuarioLogado() { + SecurityContext sc = SecurityContextHolder.getContext(); + if (sc != null) { + Authentication authentication = (Authentication) SecurityContextHolder.getContext().getAuthentication(); + + if (authentication instanceof Usuario) { + usuario = (Usuario) authentication.getPrincipal(); + } else { + usuario = null; + } + } + + return usuario; + } + + public static void setUsuarioLogado(Usuario usuario) { + SecurityContext sc = SecurityContextHolder.getContext(); + sc.setAuthentication(usuario); + } +} diff --git a/src/com/rjconsultores/ventaboletos/version/model/entidadesAdmVta.version b/src/com/rjconsultores/ventaboletos/version/model/entidadesAdmVta.version new file mode 100644 index 000000000..78d70ae1d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/version/model/entidadesAdmVta.version @@ -0,0 +1 @@ +entidadesAdmVta_20120227_1RC17 \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/RutaTramoVO.java b/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/RutaTramoVO.java new file mode 100644 index 000000000..5b0539e91 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/RutaTramoVO.java @@ -0,0 +1,87 @@ +package com.rjconsultores.ventaboletos.vo.esquemaoperacional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; + +public class RutaTramoVO { + private Boolean ventaHandHeld; + private Boolean solicitaNombrePasajero; + private ClaseServicio claseServicio; + private List lsSecuenciaRutaTramoVO; + private List lsCombinacionRutaTramoVO; + private List lsEmpresa; + + public RutaTramoVO() { + lsSecuenciaRutaTramoVO = new ArrayList(); + lsEmpresa = new ArrayList(); + lsCombinacionRutaTramoVO = new ArrayList(); + } + + public Boolean getVentaHandHeld() { + return ventaHandHeld; + } + + public void setVentaHandHeld(Boolean ventaHandHeld) { + this.ventaHandHeld = ventaHandHeld; + } + + public Boolean getSolicitaNombrePasajero() { + return solicitaNombrePasajero; + } + + public void setSolicitaNombrePasajero(Boolean solicitaNombrePasajero) { + this.solicitaNombrePasajero = solicitaNombrePasajero; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + /** + * Regresa una unmodifiable list + * @return + */ + public List getLsSecuenciaRutaTramoVO() { + return Collections.unmodifiableList(lsSecuenciaRutaTramoVO); + } + + public void setLsSecuenciaRutaTramoVO(List lsSecuenciaRutaTramoVO) { + this.lsSecuenciaRutaTramoVO = lsSecuenciaRutaTramoVO; + } + + public String getDescRuta() { + Parada origen = lsSecuenciaRutaTramoVO.get(0).getOrigen(); + Parada destinoFinal = lsSecuenciaRutaTramoVO.get(lsSecuenciaRutaTramoVO.size() -1).getDestino(); + + return origen.getCveparada() + " - " + destinoFinal.getCveparada() + " ("+ claseServicio.getDescclase()+")"; + } + + /** + * Regresa una unmodifiable list + * @return + */ + public List getLsCombinacionRutaTramoVO() { + return Collections.unmodifiableList(lsCombinacionRutaTramoVO); + } + + public void setLsCombinacionRutaTramoVO(List lsCombinacionRutaTramoVO) { + this.lsCombinacionRutaTramoVO = lsCombinacionRutaTramoVO; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } +} diff --git a/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/SecuenciaRutaTramoVO.java b/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/SecuenciaRutaTramoVO.java new file mode 100644 index 000000000..cb69bbaf8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/esquemaoperacional/SecuenciaRutaTramoVO.java @@ -0,0 +1,138 @@ +package com.rjconsultores.ventaboletos.vo.esquemaoperacional; + +import java.math.BigDecimal; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.utilerias.DateUtil.Hora; + +public class SecuenciaRutaTramoVO { + + private Parada origen; + private Parada destino; + private Via via; + private Integer secuencia; + private BigDecimal kmPagoConductor; + private BigDecimal kmReal; + private Hora tiempoRecorrido; + private Integer tramoId; + private Integer tramoServicioId; + + public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmPagoConductor, BigDecimal kmReal, + Hora tiempoRecorrido) { + super(); + this.origen = origen; + this.destino = destino; + this.via = via; + this.secuencia = secuencia; + this.kmPagoConductor = kmPagoConductor; + this.kmReal = kmReal; + this.setTiempoRecorrido(tiempoRecorrido); + } + + public SecuenciaRutaTramoVO(Parada origen, Parada destino, Integer secuencia, Via via) { + super(); + this.origen = origen; + this.destino = destino; + this.secuencia = secuencia; + this.via = via; + this.setTiempoRecorrido(null); + } + + public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmPagoConductor, BigDecimal kmReal, + Hora tiempoRecorrido, Integer tramoId, Integer tramoServicioId) { + super(); + this.origen = origen; + this.destino = destino; + this.via = via; + this.secuencia = secuencia; + this.kmPagoConductor = kmPagoConductor; + this.kmReal = kmReal; + this.setTiempoRecorrido(tiempoRecorrido); + this.tramoId = tramoId; + this.tramoServicioId = tramoId; + } + + public Parada getOrigen() { + return origen; + } + + public void setOrigen(Parada origen) { + this.origen = origen; + } + + public Parada getDestino() { + return destino; + } + + public Hora getTiempoRecorrido() { + return tiempoRecorrido; + } + + public void setTiempoRecorrido(Hora tiempoRecorrido) { + if (tiempoRecorrido == null){ + tiempoRecorrido = new Hora(); + } + this.tiempoRecorrido = tiempoRecorrido; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Via getVia() { + return via; + } + + public void setVia(Via via) { + this.via = via; + } + + public Integer getSecuencia() { + return secuencia; + } + + public void setSecuencia(Integer secuencia) { + this.secuencia = secuencia; + } + + public BigDecimal getKmPagoConductor() { + return kmPagoConductor; + } + + public void setKmPagoConductor(BigDecimal kmPagoConductor) { + this.kmPagoConductor = kmPagoConductor; + } + + public BigDecimal getKmReal() { + return kmReal; + } + + public void setKmReal(BigDecimal kmReal) { + this.kmReal = kmReal; + } + + public Integer getTramoId() { + return tramoId; + } + + public void setTramoId(Integer tramoId) { + this.tramoId = tramoId; + } + + public Integer getTramoServicioId() { + return tramoServicioId; + } + + public void setTramoServicioId(Integer tramoServicioId) { + this.tramoServicioId = tramoServicioId; + } + + @Override + public String toString() { + Hora hora = getTiempoRecorrido(); + + return secuencia + ";" + origen + ";" + destino + ";" + via + ";" + kmReal + ";" + kmPagoConductor + ";" + + ((hora != null) ? hora.getHora() : "-") + ";" + ((hora != null) ? hora.getMinuto() : "-"); + } +} diff --git a/src/com/rjconsultores/ventaboletos/web/utilerias/spring/AppContext.java b/src/com/rjconsultores/ventaboletos/web/utilerias/spring/AppContext.java new file mode 100644 index 000000000..f90b46633 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/web/utilerias/spring/AppContext.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.spring; + +import org.springframework.context.ApplicationContext; + +/** + * This class provides application-wide access to the Spring ApplicationContext. + * The ApplicationContext is injected by the class "ApplicationContextProvider". + * + * @author Siegfried Bolz + */ +public class AppContext { + + private static ApplicationContext ctx; + + /** + * Injected from the class "ApplicationContextProvider" which is automatically + * loaded during Spring-Initialization. + */ + public static void setApplicationContext(ApplicationContext applicationContext) { + ctx = applicationContext; + } + + /** + * Get access to the Spring ApplicationContext from everywhere in your Application. + * + * @return + */ + public static ApplicationContext getApplicationContext() { + return ctx; + } +} diff --git a/src/com/rjconsultores/ventaboletos/web/utilerias/spring/ApplicationContextProvider.java b/src/com/rjconsultores/ventaboletos/web/utilerias/spring/ApplicationContextProvider.java new file mode 100644 index 000000000..4210b4f91 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/web/utilerias/spring/ApplicationContextProvider.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.spring; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +/** + * This class provides an application-wide access to the + * Spring ApplicationContext! The ApplicationContext is + * injected in a static method of the class "AppContext". + * + * Use AppContext.getApplicationContext() to get access + * to all Spring Beans. + * + * @author Siegfried Bolz + */ +public class ApplicationContextProvider implements ApplicationContextAware { + + public void setApplicationContext(ApplicationContext ctx) throws BeansException { + // Wiring the ApplicationContext into a static method + AppContext.setApplicationContext(ctx); + } +}