Compare commits
6 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
a1d837b5a5 | |
|
|
28adc5863b | |
|
|
b27c54dd2e | |
|
|
ee1bcefc9f | |
|
|
dc4b0143e0 | |
|
|
53176657d1 |
442
.editorconfig
442
.editorconfig
|
|
@ -1,442 +0,0 @@
|
|||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 1000
|
||||
tab_width = 4
|
||||
ij_continuation_indent_size = 8
|
||||
ij_formatter_off_tag = @formatter:off
|
||||
ij_formatter_on_tag = @formatter:on
|
||||
ij_formatter_tags_enabled = true
|
||||
ij_smart_tabs = false
|
||||
ij_visual_guides =
|
||||
ij_wrap_on_typing = false
|
||||
|
||||
[*.java]
|
||||
ij_java_align_consecutive_assignments = false
|
||||
ij_java_align_consecutive_variable_declarations = false
|
||||
ij_java_align_group_field_declarations = false
|
||||
ij_java_align_multiline_annotation_parameters = false
|
||||
ij_java_align_multiline_array_initializer_expression = false
|
||||
ij_java_align_multiline_assignment = false
|
||||
ij_java_align_multiline_binary_operation = false
|
||||
ij_java_align_multiline_chained_methods = false
|
||||
ij_java_align_multiline_deconstruction_list_components = true
|
||||
ij_java_align_multiline_extends_list = false
|
||||
ij_java_align_multiline_for = true
|
||||
ij_java_align_multiline_method_parentheses = false
|
||||
ij_java_align_multiline_parameters = true
|
||||
ij_java_align_multiline_parameters_in_calls = false
|
||||
ij_java_align_multiline_parenthesized_expression = false
|
||||
ij_java_align_multiline_records = true
|
||||
ij_java_align_multiline_resources = true
|
||||
ij_java_align_multiline_ternary_operation = false
|
||||
ij_java_align_multiline_text_blocks = false
|
||||
ij_java_align_multiline_throws_list = false
|
||||
ij_java_align_subsequent_simple_methods = false
|
||||
ij_java_align_throws_keyword = false
|
||||
ij_java_align_types_in_multi_catch = true
|
||||
ij_java_annotation_new_line_in_record_component = false
|
||||
ij_java_annotation_parameter_wrap = off
|
||||
ij_java_array_initializer_new_line_after_left_brace = false
|
||||
ij_java_array_initializer_right_brace_on_new_line = false
|
||||
ij_java_array_initializer_wrap = off
|
||||
ij_java_assert_statement_colon_on_next_line = false
|
||||
ij_java_assert_statement_wrap = off
|
||||
ij_java_assignment_wrap = off
|
||||
ij_java_binary_operation_sign_on_next_line = false
|
||||
ij_java_binary_operation_wrap = off
|
||||
ij_java_blank_lines_after_anonymous_class_header = 0
|
||||
ij_java_blank_lines_after_class_header = 0
|
||||
ij_java_blank_lines_after_imports = 1
|
||||
ij_java_blank_lines_after_package = 1
|
||||
ij_java_blank_lines_around_class = 1
|
||||
ij_java_blank_lines_around_field = 0
|
||||
ij_java_blank_lines_around_field_in_interface = 0
|
||||
ij_java_blank_lines_around_field_with_annotations = 0
|
||||
ij_java_blank_lines_around_initializer = 1
|
||||
ij_java_blank_lines_around_method = 1
|
||||
ij_java_blank_lines_around_method_in_interface = 1
|
||||
ij_java_blank_lines_before_class_end = 0
|
||||
ij_java_blank_lines_before_imports = 1
|
||||
ij_java_blank_lines_before_method_body = 0
|
||||
ij_java_blank_lines_before_package = 0
|
||||
ij_java_blank_lines_between_record_components = 0
|
||||
ij_java_block_brace_style = end_of_line
|
||||
ij_java_block_comment_add_space = true
|
||||
ij_java_block_comment_at_first_column = false
|
||||
ij_java_builder_methods =
|
||||
ij_java_call_parameters_new_line_after_left_paren = false
|
||||
ij_java_call_parameters_right_paren_on_new_line = false
|
||||
ij_java_call_parameters_wrap = off
|
||||
ij_java_case_statement_on_separate_line = true
|
||||
ij_java_catch_on_new_line = false
|
||||
ij_java_class_annotation_wrap = split_into_lines
|
||||
ij_java_class_brace_style = end_of_line
|
||||
ij_java_class_count_to_use_import_on_demand = 5
|
||||
ij_java_class_names_in_javadoc = 1
|
||||
ij_java_deconstruction_list_wrap = normal
|
||||
ij_java_delete_unused_module_imports = false
|
||||
ij_java_do_not_indent_top_level_class_members = false
|
||||
ij_java_do_not_wrap_after_single_annotation = false
|
||||
ij_java_do_not_wrap_after_single_annotation_in_parameter = false
|
||||
ij_java_do_while_brace_force = never
|
||||
ij_java_doc_add_blank_line_after_description = true
|
||||
ij_java_doc_add_blank_line_after_param_comments = false
|
||||
ij_java_doc_add_blank_line_after_return = false
|
||||
ij_java_doc_add_p_tag_on_empty_lines = true
|
||||
ij_java_doc_align_exception_comments = true
|
||||
ij_java_doc_align_param_comments = true
|
||||
ij_java_doc_do_not_wrap_if_one_line = false
|
||||
ij_java_doc_enable_formatting = true
|
||||
ij_java_doc_enable_leading_asterisks = true
|
||||
ij_java_doc_indent_on_continuation = false
|
||||
ij_java_doc_keep_empty_lines = true
|
||||
ij_java_doc_keep_empty_parameter_tag = true
|
||||
ij_java_doc_keep_empty_return_tag = true
|
||||
ij_java_doc_keep_empty_throws_tag = true
|
||||
ij_java_doc_keep_invalid_tags = true
|
||||
ij_java_doc_param_description_on_new_line = false
|
||||
ij_java_doc_preserve_line_breaks = false
|
||||
ij_java_doc_use_throws_not_exception_tag = true
|
||||
ij_java_else_on_new_line = false
|
||||
ij_java_entity_dd_prefix =
|
||||
ij_java_entity_dd_suffix = EJB
|
||||
ij_java_entity_eb_prefix =
|
||||
ij_java_entity_eb_suffix = Bean
|
||||
ij_java_entity_hi_prefix =
|
||||
ij_java_entity_hi_suffix = Home
|
||||
ij_java_entity_lhi_prefix = Local
|
||||
ij_java_entity_lhi_suffix = Home
|
||||
ij_java_entity_li_prefix = Local
|
||||
ij_java_entity_li_suffix =
|
||||
ij_java_entity_pk_class = java.lang.String
|
||||
ij_java_entity_ri_prefix =
|
||||
ij_java_entity_ri_suffix =
|
||||
ij_java_entity_vo_prefix =
|
||||
ij_java_entity_vo_suffix = VO
|
||||
ij_java_enum_constants_wrap = off
|
||||
ij_java_enum_field_annotation_wrap = off
|
||||
ij_java_extends_keyword_wrap = off
|
||||
ij_java_extends_list_wrap = off
|
||||
ij_java_field_annotation_wrap = split_into_lines
|
||||
ij_java_field_name_prefix =
|
||||
ij_java_field_name_suffix =
|
||||
ij_java_filter_class_prefix =
|
||||
ij_java_filter_class_suffix =
|
||||
ij_java_filter_dd_prefix =
|
||||
ij_java_filter_dd_suffix =
|
||||
ij_java_finally_on_new_line = false
|
||||
ij_java_for_brace_force = never
|
||||
ij_java_for_statement_new_line_after_left_paren = false
|
||||
ij_java_for_statement_right_paren_on_new_line = false
|
||||
ij_java_for_statement_wrap = off
|
||||
ij_java_generate_final_locals = false
|
||||
ij_java_generate_final_parameters = false
|
||||
ij_java_generate_use_type_annotation_before_type = true
|
||||
ij_java_if_brace_force = never
|
||||
ij_java_imports_layout = *, |, javax.**, java.**, |, $*
|
||||
ij_java_indent_case_from_switch = true
|
||||
ij_java_insert_inner_class_imports = false
|
||||
ij_java_insert_override_annotation = true
|
||||
ij_java_keep_blank_lines_before_right_brace = 2
|
||||
ij_java_keep_blank_lines_between_package_declaration_and_header = 2
|
||||
ij_java_keep_blank_lines_in_code = 2
|
||||
ij_java_keep_blank_lines_in_declarations = 2
|
||||
ij_java_keep_builder_methods_indents = false
|
||||
ij_java_keep_control_statement_in_one_line = true
|
||||
ij_java_keep_first_column_comment = true
|
||||
ij_java_keep_indents_on_empty_lines = false
|
||||
ij_java_keep_line_breaks = true
|
||||
ij_java_keep_multiple_expressions_in_one_line = false
|
||||
ij_java_keep_simple_blocks_in_one_line = false
|
||||
ij_java_keep_simple_classes_in_one_line = false
|
||||
ij_java_keep_simple_lambdas_in_one_line = false
|
||||
ij_java_keep_simple_methods_in_one_line = false
|
||||
ij_java_label_indent_absolute = false
|
||||
ij_java_label_indent_size = 0
|
||||
ij_java_lambda_brace_style = end_of_line
|
||||
ij_java_layout_on_demand_import_from_same_package_first = true
|
||||
ij_java_layout_static_imports_separately = true
|
||||
ij_java_line_comment_add_space = true
|
||||
ij_java_line_comment_add_space_on_reformat = true
|
||||
ij_java_line_comment_at_first_column = false
|
||||
ij_java_listener_class_prefix =
|
||||
ij_java_listener_class_suffix =
|
||||
ij_java_local_variable_name_prefix =
|
||||
ij_java_local_variable_name_suffix =
|
||||
ij_java_message_dd_prefix =
|
||||
ij_java_message_dd_suffix = EJB
|
||||
ij_java_message_eb_prefix =
|
||||
ij_java_message_eb_suffix = Bean
|
||||
ij_java_method_annotation_wrap = split_into_lines
|
||||
ij_java_method_brace_style = end_of_line
|
||||
ij_java_method_call_chain_wrap = off
|
||||
ij_java_method_parameters_new_line_after_left_paren = false
|
||||
ij_java_method_parameters_right_paren_on_new_line = false
|
||||
ij_java_method_parameters_wrap = off
|
||||
ij_java_modifier_list_wrap = false
|
||||
ij_java_multi_catch_types_wrap = normal
|
||||
ij_java_names_count_to_use_import_on_demand = 3
|
||||
ij_java_new_line_after_lparen_in_annotation = false
|
||||
ij_java_new_line_after_lparen_in_deconstruction_pattern = true
|
||||
ij_java_new_line_after_lparen_in_record_header = false
|
||||
ij_java_new_line_when_body_is_presented = false
|
||||
ij_java_packages_to_use_import_on_demand = java.awt.*, javax.swing.*
|
||||
ij_java_parameter_annotation_wrap = off
|
||||
ij_java_parameter_name_prefix =
|
||||
ij_java_parameter_name_suffix =
|
||||
ij_java_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_java_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_java_place_assignment_sign_on_next_line = false
|
||||
ij_java_prefer_longer_names = true
|
||||
ij_java_prefer_parameters_wrap = false
|
||||
ij_java_preserve_module_imports = true
|
||||
ij_java_record_components_wrap = normal
|
||||
ij_java_repeat_annotations =
|
||||
ij_java_repeat_synchronized = true
|
||||
ij_java_replace_instanceof_and_cast = false
|
||||
ij_java_replace_null_check = true
|
||||
ij_java_replace_sum_lambda_with_method_ref = true
|
||||
ij_java_resource_list_new_line_after_left_paren = false
|
||||
ij_java_resource_list_right_paren_on_new_line = false
|
||||
ij_java_resource_list_wrap = off
|
||||
ij_java_rparen_on_new_line_in_annotation = false
|
||||
ij_java_rparen_on_new_line_in_deconstruction_pattern = true
|
||||
ij_java_rparen_on_new_line_in_record_header = false
|
||||
ij_java_servlet_class_prefix =
|
||||
ij_java_servlet_class_suffix =
|
||||
ij_java_servlet_dd_prefix =
|
||||
ij_java_servlet_dd_suffix =
|
||||
ij_java_session_dd_prefix =
|
||||
ij_java_session_dd_suffix = EJB
|
||||
ij_java_session_eb_prefix =
|
||||
ij_java_session_eb_suffix = Bean
|
||||
ij_java_session_hi_prefix =
|
||||
ij_java_session_hi_suffix = Home
|
||||
ij_java_session_lhi_prefix = Local
|
||||
ij_java_session_lhi_suffix = Home
|
||||
ij_java_session_li_prefix = Local
|
||||
ij_java_session_li_suffix =
|
||||
ij_java_session_ri_prefix =
|
||||
ij_java_session_ri_suffix =
|
||||
ij_java_session_si_prefix =
|
||||
ij_java_session_si_suffix = Service
|
||||
ij_java_space_after_closing_angle_bracket_in_type_argument = false
|
||||
ij_java_space_after_colon = true
|
||||
ij_java_space_after_comma = true
|
||||
ij_java_space_after_comma_in_type_arguments = true
|
||||
ij_java_space_after_for_semicolon = true
|
||||
ij_java_space_after_quest = true
|
||||
ij_java_space_after_type_cast = true
|
||||
ij_java_space_before_annotation_array_initializer_left_brace = false
|
||||
ij_java_space_before_annotation_parameter_list = false
|
||||
ij_java_space_before_array_initializer_left_brace = false
|
||||
ij_java_space_before_catch_keyword = true
|
||||
ij_java_space_before_catch_left_brace = true
|
||||
ij_java_space_before_catch_parentheses = true
|
||||
ij_java_space_before_class_left_brace = true
|
||||
ij_java_space_before_colon = true
|
||||
ij_java_space_before_colon_in_foreach = true
|
||||
ij_java_space_before_comma = false
|
||||
ij_java_space_before_deconstruction_list = false
|
||||
ij_java_space_before_do_left_brace = true
|
||||
ij_java_space_before_else_keyword = true
|
||||
ij_java_space_before_else_left_brace = true
|
||||
ij_java_space_before_finally_keyword = true
|
||||
ij_java_space_before_finally_left_brace = true
|
||||
ij_java_space_before_for_left_brace = true
|
||||
ij_java_space_before_for_parentheses = true
|
||||
ij_java_space_before_for_semicolon = false
|
||||
ij_java_space_before_if_left_brace = true
|
||||
ij_java_space_before_if_parentheses = true
|
||||
ij_java_space_before_method_call_parentheses = false
|
||||
ij_java_space_before_method_left_brace = true
|
||||
ij_java_space_before_method_parentheses = false
|
||||
ij_java_space_before_opening_angle_bracket_in_type_parameter = false
|
||||
ij_java_space_before_quest = true
|
||||
ij_java_space_before_switch_left_brace = true
|
||||
ij_java_space_before_switch_parentheses = true
|
||||
ij_java_space_before_synchronized_left_brace = true
|
||||
ij_java_space_before_synchronized_parentheses = true
|
||||
ij_java_space_before_try_left_brace = true
|
||||
ij_java_space_before_try_parentheses = true
|
||||
ij_java_space_before_type_parameter_list = false
|
||||
ij_java_space_before_while_keyword = true
|
||||
ij_java_space_before_while_left_brace = true
|
||||
ij_java_space_before_while_parentheses = true
|
||||
ij_java_space_inside_one_line_enum_braces = false
|
||||
ij_java_space_within_empty_array_initializer_braces = false
|
||||
ij_java_space_within_empty_method_call_parentheses = false
|
||||
ij_java_space_within_empty_method_parentheses = false
|
||||
ij_java_spaces_around_additive_operators = true
|
||||
ij_java_spaces_around_annotation_eq = true
|
||||
ij_java_spaces_around_assignment_operators = true
|
||||
ij_java_spaces_around_bitwise_operators = true
|
||||
ij_java_spaces_around_equality_operators = true
|
||||
ij_java_spaces_around_lambda_arrow = true
|
||||
ij_java_spaces_around_logical_operators = true
|
||||
ij_java_spaces_around_method_ref_dbl_colon = false
|
||||
ij_java_spaces_around_multiplicative_operators = true
|
||||
ij_java_spaces_around_relational_operators = true
|
||||
ij_java_spaces_around_shift_operators = true
|
||||
ij_java_spaces_around_type_bounds_in_type_parameters = true
|
||||
ij_java_spaces_around_unary_operator = false
|
||||
ij_java_spaces_inside_block_braces_when_body_is_present = false
|
||||
ij_java_spaces_within_angle_brackets = false
|
||||
ij_java_spaces_within_annotation_parentheses = false
|
||||
ij_java_spaces_within_array_initializer_braces = false
|
||||
ij_java_spaces_within_braces = false
|
||||
ij_java_spaces_within_brackets = false
|
||||
ij_java_spaces_within_cast_parentheses = false
|
||||
ij_java_spaces_within_catch_parentheses = false
|
||||
ij_java_spaces_within_deconstruction_list = false
|
||||
ij_java_spaces_within_for_parentheses = false
|
||||
ij_java_spaces_within_if_parentheses = false
|
||||
ij_java_spaces_within_method_call_parentheses = false
|
||||
ij_java_spaces_within_method_parentheses = false
|
||||
ij_java_spaces_within_parentheses = false
|
||||
ij_java_spaces_within_record_header = false
|
||||
ij_java_spaces_within_switch_parentheses = false
|
||||
ij_java_spaces_within_synchronized_parentheses = false
|
||||
ij_java_spaces_within_try_parentheses = false
|
||||
ij_java_spaces_within_while_parentheses = false
|
||||
ij_java_special_else_if_treatment = true
|
||||
ij_java_static_field_name_prefix =
|
||||
ij_java_static_field_name_suffix =
|
||||
ij_java_subclass_name_prefix =
|
||||
ij_java_subclass_name_suffix = Impl
|
||||
ij_java_switch_expressions_wrap = normal
|
||||
ij_java_ternary_operation_signs_on_next_line = false
|
||||
ij_java_ternary_operation_wrap = off
|
||||
ij_java_test_name_prefix =
|
||||
ij_java_test_name_suffix = Test
|
||||
ij_java_throws_keyword_wrap = off
|
||||
ij_java_throws_list_wrap = off
|
||||
ij_java_use_external_annotations = false
|
||||
ij_java_use_fq_class_names = false
|
||||
ij_java_use_relative_indents = false
|
||||
ij_java_use_single_class_imports = true
|
||||
ij_java_variable_annotation_wrap = off
|
||||
ij_java_visibility = public
|
||||
ij_java_while_brace_force = never
|
||||
ij_java_while_on_new_line = false
|
||||
ij_java_wrap_comments = false
|
||||
ij_java_wrap_first_method_in_call_chain = false
|
||||
ij_java_wrap_long_lines = false
|
||||
ij_java_wrap_semicolon_after_call_chain = false
|
||||
|
||||
[.editorconfig]
|
||||
ij_editorconfig_align_group_field_declarations = false
|
||||
ij_editorconfig_space_after_colon = false
|
||||
ij_editorconfig_space_after_comma = true
|
||||
ij_editorconfig_space_before_colon = false
|
||||
ij_editorconfig_space_before_comma = false
|
||||
ij_editorconfig_spaces_around_assignment_operators = true
|
||||
|
||||
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
|
||||
ij_xml_align_attributes = true
|
||||
ij_xml_align_text = false
|
||||
ij_xml_attribute_wrap = normal
|
||||
ij_xml_block_comment_add_space = true
|
||||
ij_xml_block_comment_at_first_column = false
|
||||
ij_xml_keep_blank_lines = 2
|
||||
ij_xml_keep_indents_on_empty_lines = false
|
||||
ij_xml_keep_line_breaks = true
|
||||
ij_xml_keep_line_breaks_in_text = true
|
||||
ij_xml_keep_whitespaces = false
|
||||
ij_xml_keep_whitespaces_around_cdata = preserve
|
||||
ij_xml_keep_whitespaces_inside_cdata = false
|
||||
ij_xml_line_comment_at_first_column = false
|
||||
ij_xml_space_after_tag_name = false
|
||||
ij_xml_space_around_equals_in_attribute = false
|
||||
ij_xml_space_inside_empty_tag = false
|
||||
ij_xml_text_wrap = normal
|
||||
|
||||
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config}]
|
||||
indent_size = 2
|
||||
ij_json_array_wrapping = split_into_lines
|
||||
ij_json_keep_blank_lines_in_code = 0
|
||||
ij_json_keep_indents_on_empty_lines = false
|
||||
ij_json_keep_line_breaks = true
|
||||
ij_json_keep_trailing_comma = false
|
||||
ij_json_object_wrapping = split_into_lines
|
||||
ij_json_property_alignment = do_not_align
|
||||
ij_json_space_after_colon = true
|
||||
ij_json_space_after_comma = true
|
||||
ij_json_space_before_colon = false
|
||||
ij_json_space_before_comma = false
|
||||
ij_json_spaces_within_braces = false
|
||||
ij_json_spaces_within_brackets = false
|
||||
ij_json_wrap_long_lines = false
|
||||
|
||||
[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
|
||||
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
|
||||
ij_html_align_attributes = true
|
||||
ij_html_align_text = false
|
||||
ij_html_attribute_wrap = normal
|
||||
ij_html_block_comment_add_space = false
|
||||
ij_html_block_comment_at_first_column = true
|
||||
ij_html_do_not_align_children_of_min_lines = 0
|
||||
ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p
|
||||
ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot
|
||||
ij_html_enforce_quotes = false
|
||||
ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
|
||||
ij_html_keep_blank_lines = 2
|
||||
ij_html_keep_indents_on_empty_lines = false
|
||||
ij_html_keep_line_breaks = true
|
||||
ij_html_keep_line_breaks_in_text = true
|
||||
ij_html_keep_whitespaces = false
|
||||
ij_html_keep_whitespaces_inside = span, pre, textarea
|
||||
ij_html_line_comment_at_first_column = true
|
||||
ij_html_new_line_after_last_attribute = never
|
||||
ij_html_new_line_before_first_attribute = never
|
||||
ij_html_quote_style = double
|
||||
ij_html_remove_new_line_before_tags = br
|
||||
ij_html_space_after_tag_name = false
|
||||
ij_html_space_around_equality_in_attribute = false
|
||||
ij_html_space_inside_empty_tag = false
|
||||
ij_html_text_wrap = normal
|
||||
|
||||
[{*.http,*.rest}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_http-request_call_parameters_wrap = normal
|
||||
ij_http-request_method_parameters_wrap = split_into_lines
|
||||
ij_http-request_space_before_comma = true
|
||||
ij_http-request_spaces_around_assignment_operators = true
|
||||
|
||||
[{*.markdown,*.md}]
|
||||
ij_markdown_force_one_space_after_blockquote_symbol = true
|
||||
ij_markdown_force_one_space_after_header_symbol = true
|
||||
ij_markdown_force_one_space_after_list_bullet = true
|
||||
ij_markdown_force_one_space_between_words = true
|
||||
ij_markdown_format_tables = true
|
||||
ij_markdown_insert_quote_arrows_on_wrap = true
|
||||
ij_markdown_keep_indents_on_empty_lines = false
|
||||
ij_markdown_keep_line_breaks_inside_text_blocks = true
|
||||
ij_markdown_max_lines_around_block_elements = 1
|
||||
ij_markdown_max_lines_around_header = 1
|
||||
ij_markdown_max_lines_between_paragraphs = 1
|
||||
ij_markdown_min_lines_around_block_elements = 1
|
||||
ij_markdown_min_lines_around_header = 1
|
||||
ij_markdown_min_lines_between_paragraphs = 1
|
||||
ij_markdown_wrap_text_if_long = true
|
||||
ij_markdown_wrap_text_inside_blockquotes = true
|
||||
|
||||
[{*.yaml,*.yml}]
|
||||
indent_size = 2
|
||||
ij_yaml_align_values_properties = do_not_align
|
||||
ij_yaml_autoinsert_sequence_marker = true
|
||||
ij_yaml_block_mapping_on_new_line = false
|
||||
ij_yaml_indent_sequence_value = true
|
||||
ij_yaml_keep_indents_on_empty_lines = false
|
||||
ij_yaml_keep_line_breaks = true
|
||||
ij_yaml_line_comment_add_space = false
|
||||
ij_yaml_line_comment_add_space_on_reformat = false
|
||||
ij_yaml_line_comment_at_first_column = true
|
||||
ij_yaml_sequence_on_new_line = false
|
||||
ij_yaml_space_before_colon = false
|
||||
ij_yaml_spaces_within_braces = true
|
||||
ij_yaml_spaces_within_brackets = true
|
||||
|
|
@ -2,10 +2,11 @@ package com.njzscloud.common.localizer;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.njzscloud.common.localizer.contant.LocalizerType;
|
||||
import com.njzscloud.common.mqtt.util.Mqtt;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
|
@ -18,10 +19,10 @@ public class DeviceStore {
|
|||
private static final Lock localizersReadLock = localizersLock.readLock();
|
||||
|
||||
public static void init() {
|
||||
Mqtt.publish("localizer/loader");
|
||||
// Mqtt.publish("localizer/loader");
|
||||
}
|
||||
|
||||
public static void setLocalizers(LinkedList<Localizer> list) {
|
||||
public static void setLocalizers(List<Localizer> list) {
|
||||
localizersWriteLock.lock();
|
||||
try {
|
||||
log.info("重新加载设备:{}", list.size());
|
||||
|
|
@ -60,4 +61,8 @@ public class DeviceStore {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static Collection<Localizer> list() {
|
||||
return CollUtil.unmodifiable(localizers);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ public class Localizer {
|
|||
@Getter
|
||||
@Setter
|
||||
protected String terminalId;
|
||||
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private String licensePlate;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class Htzj {
|
||||
private static HtzjListeners htzjListeners = new HtzjListeners();
|
||||
private static HtzjListeners htzjListeners;
|
||||
|
||||
public static void init() {
|
||||
htzjListeners = new HtzjListeners();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import lombok.AccessLevel;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
|
@ -150,8 +151,7 @@ public final class JT808 {
|
|||
|
||||
public static JT808Message parseMessage(ByteBuf buf) {
|
||||
JT808Message jt808Message = new JT808Message();
|
||||
|
||||
byte[] h_b = ByteBufUtil.getBytes(buf);
|
||||
byte[] bytes = ByteBufUtil.getBytes(buf);
|
||||
|
||||
try {
|
||||
// 1. 消息ID (2字节)
|
||||
|
|
@ -186,22 +186,20 @@ public final class JT808 {
|
|||
jt808Message.setMessageBody(array);
|
||||
|
||||
// 7. 校验码 (1字节)
|
||||
byte checkCode = buf.readByte();
|
||||
jt808Message.setCheckCode(checkCode);
|
||||
jt808Message.setCheckCode(buf.readByte());
|
||||
|
||||
|
||||
if (jt808Message.getMessageId() == 0x704) {
|
||||
log.info("报文:{}", h_b);
|
||||
// 验证校验码
|
||||
if (!verifyCheckCode(jt808Message, buf)) {
|
||||
log.error("校验码错误: {}", jt808Message);
|
||||
return null;
|
||||
}
|
||||
int messageId = jt808Message.getMessageId();
|
||||
if (messageId == 0x0200
|
||||
|| messageId == 0x704
|
||||
|| messageId == 0x0201) {
|
||||
log.info("{},{},报文:{}", terminalPhone, MessageType.getMessageType(messageId), Arrays.toString(bytes));
|
||||
}
|
||||
|
||||
int code = 0;
|
||||
for (int i = 0; i < h_b.length - 1; i++) {
|
||||
code = code ^ h_b[i];
|
||||
}
|
||||
if (code != checkCode) {
|
||||
log.error("校验码错误: {} {}", code, checkCode);
|
||||
// return null;
|
||||
}
|
||||
return jt808Message;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,6 @@ import lombok.Setter;
|
|||
import lombok.experimental.Accessors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* JT808协议消息实体类
|
||||
* 用于存储解析后的JT808协议消息内容
|
||||
|
|
@ -34,7 +31,6 @@ public class JT808Message {
|
|||
private byte[] messageBody;
|
||||
// 校验码 (1字节)
|
||||
private byte checkCode;
|
||||
|
||||
public JT808Message() {
|
||||
}
|
||||
|
||||
|
|
@ -43,17 +39,6 @@ public class JT808Message {
|
|||
return messageBodyProps & 0x3FF;
|
||||
}
|
||||
|
||||
public List<Integer> getBodyBytes() {
|
||||
if (messageBody == null || messageBody.length == 0) {
|
||||
return null;
|
||||
}
|
||||
ArrayList<Integer> integers = new ArrayList<>(messageBody.length);
|
||||
for (byte b : messageBody) {
|
||||
integers.add((int) b);
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
// 从消息体属性中获取是否分包
|
||||
public boolean isPackaged() {
|
||||
return (messageBodyProps & 0x4000) != 0;
|
||||
|
|
|
|||
|
|
@ -31,10 +31,6 @@ public class JT808MessageCenter {
|
|||
|
||||
Map<MessageType, Consumer<TerminalMessageBody>> m = listeners.computeIfPresent(localizerType, (k, v) -> {
|
||||
MessageType messageType = MessageType.getMessageType(messageId);
|
||||
if (messageType == MessageType.TerminalLocationBatchReport) {
|
||||
log.info("批量上报:{}", message);
|
||||
}
|
||||
|
||||
if (messageType == null) {
|
||||
log.error("未找到消息类型,设备号:{},消息 Id:0x{}", terminalId, Integer.toHexString(messageId));
|
||||
return v;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.njzscloud.common.localizer.jt808.support;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.njzscloud.common.localizer.DeviceStore;
|
||||
import com.njzscloud.common.localizer.Localizer;
|
||||
import com.njzscloud.common.localizer.contant.LocalizerType;
|
||||
|
|
@ -10,11 +11,13 @@ import com.njzscloud.common.localizer.contant.MessageType;
|
|||
import com.njzscloud.common.localizer.jt808.JT808;
|
||||
import com.njzscloud.common.localizer.jt808.message.*;
|
||||
import com.njzscloud.common.localizer.mqtt.result.RealtimeLocationResult;
|
||||
import com.njzscloud.common.localizer.service.LocalizerService;
|
||||
import com.njzscloud.common.mqtt.util.Mqtt;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Slf4j
|
||||
|
|
@ -105,9 +108,12 @@ public abstract class JT808MessageListener {
|
|||
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf);
|
||||
double speed = locationReportMsg.getSpeed();
|
||||
int speedThreshold = localizer.getSpeedThreshold();
|
||||
String licensePlate = localizer.getLicensePlate();
|
||||
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
||||
.setLicensePlate(licensePlate)
|
||||
.setTerminalId(terminalId)
|
||||
.setOverspeed(speed > speedThreshold);
|
||||
saveData(realtimeLocationResult);
|
||||
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
||||
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
||||
} finally {
|
||||
|
|
@ -134,26 +140,35 @@ public abstract class JT808MessageListener {
|
|||
int speedThreshold = localizer.getSpeedThreshold();
|
||||
for (int i = 0; i < count; i++) {
|
||||
int length = byteBuf.readUnsignedShort();
|
||||
/* if (length > 28) { // 有扩展信息
|
||||
|
||||
} */
|
||||
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf.slice(byteBuf.readerIndex(), length));
|
||||
byteBuf.skipBytes(length);
|
||||
double speed = locationReportMsg.getSpeed();
|
||||
String licensePlate = localizer.getLicensePlate();
|
||||
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
||||
.setLicensePlate(licensePlate)
|
||||
.setTerminalId(terminalId)
|
||||
.setOverspeed(speed > speedThreshold)
|
||||
.setType(type);
|
||||
saveData(realtimeLocationResult);
|
||||
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
||||
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量上报处理失败:{} {}", terminalId, message.getFlowId());
|
||||
} finally {
|
||||
byteBuf.release();
|
||||
}
|
||||
}
|
||||
|
||||
protected void saveData(RealtimeLocationResult realtimeLocationResult) {
|
||||
try {
|
||||
LocalizerService localizerService = SpringUtil.getBean(LocalizerService.class);
|
||||
if (localizerService != null) {
|
||||
localizerService.save(Collections.singletonList(realtimeLocationResult));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("数据保存失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询位置响应消息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,11 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
public class RealtimeLocationResult {
|
||||
private String terminalId;
|
||||
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String licensePlate;
|
||||
private int type;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.njzscloud.common.localizer.service;
|
||||
|
||||
|
||||
import com.njzscloud.common.localizer.mqtt.result.RealtimeLocationResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LocalizerService {
|
||||
void save(List<RealtimeLocationResult> data);
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ public class AccessDeniedExceptionHandler implements AccessDeniedHandler {
|
|||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
} else {
|
||||
log.error("暂无权限: {}", request.getRequestURI(), accessDeniedException);
|
||||
r = R.failed(ExceptionMsg.CLI_ERR_MSG, "暂无权限");
|
||||
r = R.failed(ExceptionMsg.CLI_ERR_MSG, accessDeniedException.getMessage());
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
}
|
||||
ServletUtil.write(response, Jackson.toJsonStr(r), Mime.u8Val(Mime.JSON));
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class TokenHandshakeInterceptor implements HandshakeInterceptor {
|
|||
}
|
||||
|
||||
private Tuple2<Long, String> resolve(String tokenStr) {
|
||||
if (StrUtil.isBlank(tokenStr)) return Tuple2.create(1L, IdUtil.fastSimpleUUID());
|
||||
if (StrUtil.isBlank(tokenStr)) return Tuple2.create(0L, IdUtil.fastSimpleUUID());
|
||||
UserDetail userDetail = SecurityUtil.parseToken(tokenStr);
|
||||
if (userDetail == null) return null;
|
||||
Token token = userDetail.getToken();
|
||||
|
|
|
|||
|
|
@ -21,6 +21,19 @@
|
|||
<artifactId>njzscloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njzscloud</groupId>
|
||||
<artifactId>njzscloud-common-mvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njzscloud</groupId>
|
||||
<artifactId>njzscloud-common-ws</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njzscloud</groupId>
|
||||
<artifactId>njzscloud-common-mp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njzscloud</groupId>
|
||||
<artifactId>njzscloud-common-localizer</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,226 @@
|
|||
package com.njzscloud.localizer.config;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.common.core.ex.ExceptionMsg;
|
||||
import com.njzscloud.common.core.thread.ThreadPool;
|
||||
import com.njzscloud.common.core.tuple.Tuple2;
|
||||
import com.njzscloud.common.core.utils.CoordinateConverter;
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.ws.support.Websocket;
|
||||
import com.njzscloud.common.ws.support.WsMsg;
|
||||
import com.njzscloud.localizer.device.service.LocalizerDeviceService;
|
||||
import com.njzscloud.localizer.track.pojo.entity.TruckLocationTrackEntity;
|
||||
import com.njzscloud.localizer.track.pojo.param.LocationTrackSearchParam;
|
||||
import com.njzscloud.localizer.track.service.TruckLocationTrackService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OnStarted {
|
||||
private final LocalizerDeviceService localizerDeviceService;
|
||||
private final TruckLocationTrackService truckLocationTrackService;
|
||||
ThreadPoolExecutor threadPoolExecutor = ThreadPool.createThreadPool(
|
||||
"GPS 数据",
|
||||
10,
|
||||
200,
|
||||
60,
|
||||
1,
|
||||
1,
|
||||
new ThreadPoolExecutor.CallerRunsPolicy()
|
||||
);
|
||||
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void onApplicationReady() {
|
||||
localizerDeviceService.loadDevice();
|
||||
Websocket.subscribe("up/truck_location_track/history", msg -> {
|
||||
WsMsg.User from = msg.getFrom();
|
||||
String cid = from.getCid();
|
||||
LocationTrackSearchParam param = msg.extractData(LocationTrackSearchParam.class);
|
||||
// String terminalId = param.getTerminalId();
|
||||
String licensePlate = param.getLicensePlate();
|
||||
LocalDateTime startTime = param.getStartTime();
|
||||
LocalDateTime endTime = param.getEndTime();
|
||||
Integer speed = param.getSpeed();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
int currentPage = 1;
|
||||
// 分页查询,每次500条
|
||||
while (true) {
|
||||
// 检查是否被取消
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
}
|
||||
|
||||
Page<TruckLocationTrackEntity> page = new Page<>(currentPage, 500);
|
||||
page.addOrder(OrderItem.asc("location_time"));
|
||||
|
||||
// 分页查询当前页数据
|
||||
IPage<TruckLocationTrackEntity> resultPage = truckLocationTrackService.page(page, Wrappers.lambdaQuery(TruckLocationTrackEntity.class)
|
||||
.eq(TruckLocationTrackEntity::getLicensePlate, licensePlate)
|
||||
.ge(startTime != null, TruckLocationTrackEntity::getLocationTime, startTime)
|
||||
.le(endTime != null, TruckLocationTrackEntity::getLocationTime, endTime));
|
||||
|
||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||
if (records.isEmpty()) {
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/history")
|
||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "数据发送完成"))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理当前页数据,按时间间隔推送
|
||||
for (TruckLocationTrackEntity record : records) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
}
|
||||
if (speed > 100) {
|
||||
if (!ThreadUtil.sleep(speed)) {
|
||||
log.info("任务被取消");
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/history")
|
||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "数据发送完成"))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Tuple2<Double, Double> doubles = CoordinateConverter.wgs84ToGcj02(record.getLatitude(), record.getLongitude());
|
||||
record.setLatitude(doubles.get_0())
|
||||
.setLongitude(doubles.get_1());
|
||||
boolean publish = Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/history")
|
||||
.setData(R.success(record))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
if (!publish) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否为最后一页
|
||||
if (currentPage >= resultPage.getPages()) {
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/history")
|
||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "数据发送完成"))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// 继续查询下一页
|
||||
currentPage++;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// 其他异常
|
||||
log.error("查询历史轨迹异常", e);
|
||||
}
|
||||
}, threadPoolExecutor);
|
||||
});
|
||||
|
||||
Websocket.subscribe("up/truck_location_track/realtime", msg -> {
|
||||
WsMsg.User from = msg.getFrom();
|
||||
String cid = from.getCid();
|
||||
LocationTrackSearchParam param = msg.extractData(LocationTrackSearchParam.class);
|
||||
// String terminalId = param.getTerminalId();
|
||||
String licensePlate = param.getLicensePlate();
|
||||
Integer speed = param.getSpeed();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
LocalDateTime startTime = LocalDateTime.now().minusSeconds(60 * 30);
|
||||
int errCount = 0;
|
||||
while (true) {
|
||||
// 检查是否被取消
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
}
|
||||
|
||||
Page<TruckLocationTrackEntity> page = new Page<>(1, 10);
|
||||
page.addOrder(OrderItem.asc("location_time"));
|
||||
|
||||
// 分页查询当前页数据
|
||||
IPage<TruckLocationTrackEntity> resultPage = truckLocationTrackService.page(page, Wrappers.lambdaQuery(TruckLocationTrackEntity.class)
|
||||
.eq(TruckLocationTrackEntity::getLicensePlate, licensePlate)
|
||||
.gt(TruckLocationTrackEntity::getLocationTime, startTime));
|
||||
|
||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||
if (records.isEmpty()) {
|
||||
if (errCount >= 3600) {
|
||||
log.error("暂无实时数据, 车牌号: {}, 时间: {}", licensePlate, startTime);
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/realtime")
|
||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "暂无实时数据"))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
errCount++;
|
||||
if (!ThreadUtil.sleep(1000)) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
} else {
|
||||
// startTime = startTime.plusSeconds(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
errCount = 0;
|
||||
|
||||
// 处理当前页数据,按时间间隔推送
|
||||
for (TruckLocationTrackEntity record : records) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
}
|
||||
if (speed > 100) {
|
||||
if (!ThreadUtil.sleep(speed)) {
|
||||
log.info("任务被取消");
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/realtime")
|
||||
.setData(R.failed(ExceptionMsg.SYS_ERR_MSG, "数据发送完成"))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
startTime = record.getLocationTime();
|
||||
Tuple2<Double, Double> doubles = CoordinateConverter.wgs84ToGcj02(record.getLatitude(), record.getLongitude());
|
||||
record.setLatitude(doubles.get_0())
|
||||
.setLongitude(doubles.get_1());
|
||||
boolean publish = Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/realtime")
|
||||
.setData(R.success(record))
|
||||
.setTo(Collections.singletonList(new WsMsg.User().setCid(cid)))
|
||||
);
|
||||
if (!publish) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 其他异常
|
||||
log.error("查询历史轨迹异常", e);
|
||||
}
|
||||
}, threadPoolExecutor);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.njzscloud.localizer.device.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.localizer.DeviceStore;
|
||||
import com.njzscloud.common.localizer.tuqiang.Tuqiang;
|
||||
import com.njzscloud.localizer.device.service.LocalizerDeviceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/localizer_device")
|
||||
@RequiredArgsConstructor
|
||||
public class LocalizerDeviceController {
|
||||
private final LocalizerDeviceService localizerDeviceService;
|
||||
|
||||
@GetMapping("/load_device")
|
||||
public R<?> loadDevice() {
|
||||
localizerDeviceService.loadDevice();
|
||||
return R.success();
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<?> list() {
|
||||
return R.success(DeviceStore.list());
|
||||
}
|
||||
|
||||
@GetMapping("/current")
|
||||
public R<?> current(String terminalId) {
|
||||
Tuqiang.currentLocation(terminalId);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.njzscloud.localizer.device.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.localizer.device.pojo.entity.LocalizerDeviceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface LocalizerDeviceMapper extends BaseMapper<LocalizerDeviceEntity> {
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.njzscloud.localizer.device.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njzscloud.common.localizer.contant.LocalizerType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("localizer_device")
|
||||
public class LocalizerDeviceEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String licensePlate;
|
||||
/**
|
||||
* 设备 Id
|
||||
*/
|
||||
protected String terminalId;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
protected LocalizerType localizerType;
|
||||
|
||||
/**
|
||||
* 速度阈值
|
||||
*/
|
||||
private Integer speedThreshold;
|
||||
/**
|
||||
* 是否可用; 0-->否、1-->是
|
||||
*/
|
||||
private Boolean canuse;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.njzscloud.localizer.device.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.localizer.DeviceStore;
|
||||
import com.njzscloud.common.localizer.Localizer;
|
||||
import com.njzscloud.localizer.device.mapper.LocalizerDeviceMapper;
|
||||
import com.njzscloud.localizer.device.pojo.entity.LocalizerDeviceEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class LocalizerDeviceService extends ServiceImpl<LocalizerDeviceMapper, LocalizerDeviceEntity> implements IService<LocalizerDeviceEntity> {
|
||||
|
||||
public void loadDevice() {
|
||||
List<LocalizerDeviceEntity> list = this.list();
|
||||
List<Localizer> localizers = list.stream().map(it -> BeanUtil.copyProperties(it, Localizer.class)).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(localizers)) return;
|
||||
DeviceStore.setLocalizers(localizers);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.njzscloud.localizer.track.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.localizer.tuqiang.Tuqiang;
|
||||
import com.njzscloud.localizer.track.service.TruckLocationTrackService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 车辆定位数据
|
||||
*/
|
||||
@Slf4j
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/truck_location_track")
|
||||
@RequiredArgsConstructor
|
||||
public class TruckLocationTrackController {
|
||||
|
||||
private final TruckLocationTrackService truckLocationTrackService;
|
||||
|
||||
@GetMapping("/start")
|
||||
public R<?> startTrack(@RequestParam("licensePlate") String licensePlate) {
|
||||
truckLocationTrackService.startTrack(licensePlate);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
@GetMapping("/stop")
|
||||
public R<?> stopTrack(@RequestParam("licensePlate") String licensePlate) {
|
||||
truckLocationTrackService.stopTrack(licensePlate);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
@GetMapping("/send")
|
||||
public R<?> send(@RequestParam("terminalId") String terminalId,
|
||||
@RequestParam("directive") String directive) {
|
||||
Tuqiang.sendDirective(terminalId, directive);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.njzscloud.localizer.track.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.localizer.track.pojo.entity.TruckLocationTrackEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 车辆定位数据
|
||||
*/
|
||||
@Mapper
|
||||
public interface TruckLocationTrackMapper extends BaseMapper<TruckLocationTrackEntity> {
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.njzscloud.localizer.track.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 车辆定位数据
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("truck_location_track")
|
||||
public class TruckLocationTrackEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String licensePlate;
|
||||
/**
|
||||
* 设备号
|
||||
*/
|
||||
private String terminalId;
|
||||
|
||||
/**
|
||||
* 经度; 单位:度
|
||||
*/
|
||||
private Double longitude;
|
||||
|
||||
/**
|
||||
* 纬度; 单位:度
|
||||
*/
|
||||
private Double latitude;
|
||||
|
||||
/**
|
||||
* 海拔; 米
|
||||
*/
|
||||
private Integer altitude;
|
||||
|
||||
/**
|
||||
* 速度; 千米/小时
|
||||
*/
|
||||
private Double speed;
|
||||
|
||||
/**
|
||||
* 定位时间
|
||||
*/
|
||||
private LocalDateTime locationTime;
|
||||
|
||||
/**
|
||||
* 方向; 正北为 0 度
|
||||
*/
|
||||
private Integer direction;
|
||||
|
||||
/**
|
||||
* 是否超速; 0-->否、1-->是
|
||||
*/
|
||||
private Boolean overspeed;
|
||||
|
||||
/**
|
||||
* 是否为补偿数据; 0-->否、1-->是
|
||||
*/
|
||||
private Boolean compensate;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.njzscloud.localizer.track.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class LocationTrackSearchParam {
|
||||
private String terminalId;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String licensePlate;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private Integer speed;
|
||||
|
||||
public Integer getSpeed() {
|
||||
return speed == null || speed <= 0 ? 1000 : speed;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.njzscloud.localizer.track.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.localizer.mqtt.result.RealtimeLocationResult;
|
||||
import com.njzscloud.common.localizer.service.LocalizerService;
|
||||
import com.njzscloud.localizer.track.mapper.TruckLocationTrackMapper;
|
||||
import com.njzscloud.localizer.track.pojo.entity.TruckLocationTrackEntity;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 车辆定位数据
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMapper, TruckLocationTrackEntity> implements LocalizerService, IService<TruckLocationTrackEntity> {
|
||||
|
||||
private static final ConcurrentHashMap<String, Boolean> TRACK_FLAG = new ConcurrentHashMap<>();
|
||||
@Value("${trackFlag}")
|
||||
boolean trackFlag = false;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(List<RealtimeLocationResult> dataList) {
|
||||
for (RealtimeLocationResult realtimeLocationResult : dataList) {
|
||||
if (realtimeLocationResult == null) {
|
||||
return;
|
||||
}
|
||||
String licensePlate = realtimeLocationResult.getLicensePlate();
|
||||
if (trackFlag && !TRACK_FLAG.getOrDefault(licensePlate, Boolean.FALSE)) {
|
||||
return;
|
||||
}
|
||||
String time = realtimeLocationResult.getTime();
|
||||
double latitude = realtimeLocationResult.getLatitude();
|
||||
double longitude = realtimeLocationResult.getLongitude();
|
||||
|
||||
if (latitude <= 0 && longitude <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TruckLocationTrackEntity entity = new TruckLocationTrackEntity()
|
||||
.setLicensePlate(licensePlate)
|
||||
.setTerminalId(realtimeLocationResult.getTerminalId())
|
||||
.setLatitude(latitude)
|
||||
.setLongitude(longitude)
|
||||
.setAltitude(realtimeLocationResult.getAltitude())
|
||||
.setSpeed(realtimeLocationResult.getSpeed())
|
||||
.setLocationTime(DateUtil.parseLocalDateTime(time))
|
||||
.setDirection(realtimeLocationResult.getDirection())
|
||||
.setOverspeed(realtimeLocationResult.isOverspeed())
|
||||
.setCompensate(realtimeLocationResult.getType() == 1);
|
||||
this.save(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public void startTrack(String licensePlate) {
|
||||
TRACK_FLAG.put(licensePlate, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public void stopTrack(String licensePlate) {
|
||||
TRACK_FLAG.put(licensePlate, Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,24 @@
|
|||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
location: D:\ProJects\gov_manage\njzscloud-supervisory-svr\logs\temp
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:33061/green_frog?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: dbard01
|
||||
password: mik9uvNZ
|
||||
trackFlag: false
|
||||
mybatis-plus:
|
||||
tunnel:
|
||||
enable: false
|
||||
ssh:
|
||||
host: 121.43.155.83
|
||||
port: 22
|
||||
user: root
|
||||
credentials: D:/W/首炬/dzsj.pem
|
||||
localPort: 33061
|
||||
db:
|
||||
host: rm-bp1w3397b718u1882.mysql.rds.aliyuncs.com
|
||||
port: 3306
|
||||
mqtt:
|
||||
enabled: true
|
||||
broker: tcp://139.224.54.144:1883
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
spring:
|
||||
application:
|
||||
name: localizer
|
||||
servlet:
|
||||
multipart:
|
||||
location: D:\ProJects\gov_manage\njzscloud-supervisory-svr\logs\temp
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:33061/green_frog?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: dbard01
|
||||
password: mik9uvNZ
|
||||
|
||||
trackFlag: false
|
||||
|
||||
mqtt:
|
||||
enabled: true
|
||||
|
|
|
|||
|
|
@ -125,11 +125,6 @@
|
|||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.9.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.volcengine</groupId>
|
||||
<artifactId>volcengine-java-sdk-ark-runtime</artifactId>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
package com.njzscloud.supervisory.biz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.BizDriverEntity;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.DriverCantDelResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司机信息
|
||||
*/
|
||||
|
|
@ -34,5 +30,4 @@ public interface BizDriverMapper extends BaseMapper<BizDriverEntity> {
|
|||
@Select("SELECT id,uscc,company_name FROM biz_company WHERE id = #{companyId}")
|
||||
SearchCompanyResult selectCompanyById(@Param("companyId") Long companyId);
|
||||
|
||||
List<DriverCantDelResult> driverCantDel(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,13 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.TruckCantDelResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*/
|
||||
|
|
@ -29,6 +26,4 @@ public interface BizTruckMapper extends BaseMapper<BizTruckEntity> {
|
|||
* 根据ID查询预警详情(包含关联信息)
|
||||
*/
|
||||
SearchTruckResult selectDetailById(@Param("id") Long id);
|
||||
|
||||
List<TruckCantDelResult> truckCantDel(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,13 +62,11 @@ public class BizCompanyEntity {
|
|||
/**
|
||||
* 营业执照有效期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenseStartTime;
|
||||
|
||||
/**
|
||||
* 营业执照有效期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,8 @@ public class BizDriverEntity {
|
|||
*/
|
||||
private String drivingLicence;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenceStartTime;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenceEndTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.result;
|
||||
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class DriverCantDelResult {
|
||||
private String driverName;
|
||||
private String sn;
|
||||
private OrderStatus orderStatus;
|
||||
}
|
||||
|
|
@ -147,10 +147,4 @@ public class SearchCompanyResult {
|
|||
|
||||
private BigDecimal money;
|
||||
|
||||
private String idcard;
|
||||
private String idcardStartTime;
|
||||
private String idcardEndTime;
|
||||
private String idcardFront;
|
||||
private String idcardBack;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.result;
|
||||
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class TruckCantDelResult {
|
||||
private String licensePlate;
|
||||
private String sn;
|
||||
private OrderStatus orderStatus;
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ package com.njzscloud.supervisory.biz.service;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
|
@ -20,7 +19,6 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizDriverEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.AddDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.AuditDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.ModifyDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.DriverCantDelResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
import com.njzscloud.supervisory.sys.user.pojo.param.AddUserAccountParam;
|
||||
|
|
@ -33,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 司机信息
|
||||
|
|
@ -104,18 +101,6 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
Assert.notEmpty(ids, () -> Exceptions.clierr("未指定要删除的数据"));
|
||||
List<BizDriverEntity> bizDriverEntities = this.listByIds(ids);
|
||||
Assert.isTrue(bizDriverEntities.size() == ids.size(), () -> Exceptions.clierr("未找到要删除的数据"));
|
||||
List<DriverCantDelResult> idList = baseMapper.driverCantDel(Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.in("b.id", ids));
|
||||
Assert.isTrue(idList.isEmpty(), () -> Exceptions.clierr(MapUtil.builder()
|
||||
.put("reason", "存在已关联的订单")
|
||||
.put("details", idList)
|
||||
.build()));
|
||||
List<Long> userIds = bizDriverEntities.stream().map(BizDriverEntity::getUserId).collect(Collectors.toList());
|
||||
sysUserService.del(userIds);
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.njzscloud.supervisory.biz.service;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -23,7 +22,6 @@ import com.njzscloud.supervisory.biz.pojo.param.ModifyBizTruckParam;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.SearchTruckParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.TruckCantDelResult;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
|
|
@ -106,16 +104,6 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
Assert.notEmpty(ids, () -> Exceptions.clierr("未指定要删除的数据"));
|
||||
long count = this.count(Wrappers.<BizTruckEntity>query().in("id", ids));
|
||||
Assert.isTrue(count == ids.size(), () -> Exceptions.clierr("未找到要删除的数据"));
|
||||
List<TruckCantDelResult> idList = baseMapper.truckCantDel(Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.in("b.id", ids));
|
||||
Assert.isTrue(idList.isEmpty(), () -> Exceptions.clierr(MapUtil.builder()
|
||||
.put("reason", "存在已关联的订单")
|
||||
.put("details", idList)
|
||||
.build()));
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
|
||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||
if (records.isEmpty()) {
|
||||
if (errCount >= 300) {
|
||||
if (errCount >= 200) {
|
||||
log.error("暂无实时数据, 订单ID: {}, 时间: {}", orderId, startTime);
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/realtime")
|
||||
|
|
@ -585,10 +585,11 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
return;
|
||||
}
|
||||
errCount++;
|
||||
if (!ThreadUtil.sleep(1000)) {
|
||||
if (!ThreadUtil.sleep(300)) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
} else {
|
||||
startTime = LocalDateTime.now();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,15 +64,4 @@ public interface SupervisionStatisticsMapper {
|
|||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> dataTable();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> todayAuditPassStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> stationStatistics();
|
||||
|
||||
Integer getTotalCarCount();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> getKehuList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,13 +47,11 @@ public class SupervisionStatisticsService {
|
|||
|
||||
CarSummary carSummary = supervisionStatisticsMapper.getCarSummary();
|
||||
Integer todayCarCount = supervisionStatisticsMapper.getTodayCarCount();
|
||||
Integer totalCarCount = supervisionStatisticsMapper.getTotalCarCount();
|
||||
List<RegionSummary> regionSummary = supervisionStatisticsMapper.getRegionSummary();
|
||||
List<CompanySummary> companySummary = supervisionStatisticsMapper.getCompanySummary();
|
||||
List<StationInfo> stationInfo = supervisionStatisticsMapper.getStationInfo();
|
||||
List<Order> orders = supervisionStatisticsMapper.getOrders();
|
||||
List<Project> projects = supervisionStatisticsMapper.getProjects();
|
||||
List<Map<String, Object>> kehu = supervisionStatisticsMapper.getKehuList();
|
||||
|
||||
return MapUtil.<String, Object>builder()
|
||||
.put("dispatchSummary", dispatchSummary == null ? new DispatchSummary() : dispatchSummary)
|
||||
|
|
@ -61,13 +59,11 @@ public class SupervisionStatisticsService {
|
|||
.put("disposeTotalWeight", disposeTotalWeight == null ? 0 : disposeTotalWeight)
|
||||
.put("carSummary", carSummary == null ? new CarSummary() : carSummary)
|
||||
.put("todayCarCount", todayCarCount == null ? 0 : todayCarCount)
|
||||
.put("totalCarCount", totalCarCount == null ? 0 : totalCarCount)
|
||||
.put("regionSummary", regionSummary == null ? new ArrayList<>() : regionSummary)
|
||||
.put("companySummary", companySummary == null ? new ArrayList<>() : companySummary)
|
||||
.put("stationInfo", stationInfo == null ? new ArrayList<>() : stationInfo)
|
||||
.put("orders", orders == null ? new ArrayList<>() : orders)
|
||||
.put("projects", projects == null ? new ArrayList<>() : projects)
|
||||
.put("kehu", kehu == null ? new ArrayList<>() : kehu)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -96,23 +92,12 @@ public class SupervisionStatisticsService {
|
|||
double warnRate = todayTotalCount == 0 ? 0 : todayWarnCount / todayTotalCount * 100;
|
||||
double incWarnRate = yesterdayWarnCount == 0 ? 0 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 100;
|
||||
|
||||
|
||||
Double yesterdayTotalCount = MapUtil.getDouble(dataStatistics, "yesterdayTotalCount", 0.0);
|
||||
double incDayCountRate = yesterdayTotalCount == 0 ? 0 : (todayTotalCount - yesterdayTotalCount) / yesterdayTotalCount * 100;
|
||||
|
||||
Double currentMonthTotalCount = MapUtil.getDouble(dataStatistics, "currentMonthTotalCount", 0.0);
|
||||
Double lastMonthTotalCount = MapUtil.getDouble(dataStatistics, "lastMonthTotalCount", 0.0);
|
||||
double incMonthCountRate = lastMonthTotalCount == 0 ? 0 : (currentMonthTotalCount - lastMonthTotalCount) / lastMonthTotalCount * 100;
|
||||
|
||||
|
||||
dataStatistics.put("dayRate", NumberUtil.decimalFormat("#.##", dayRate));
|
||||
dataStatistics.put("monthRate", NumberUtil.decimalFormat("#.##", monthRate));
|
||||
dataStatistics.put("finishRate", NumberUtil.decimalFormat("#.##", todayFinishRate));
|
||||
dataStatistics.put("incFinishRate", NumberUtil.decimalFormat("#.##", incFinishRate));
|
||||
dataStatistics.put("warnRate", NumberUtil.decimalFormat("#.##", warnRate));
|
||||
dataStatistics.put("incWarnRate", NumberUtil.decimalFormat("#.##", incWarnRate));
|
||||
dataStatistics.put("incDayCountRate", NumberUtil.decimalFormat("#.##", incDayCountRate));
|
||||
dataStatistics.put("incMonthCountRate", NumberUtil.decimalFormat("#.##", incMonthCountRate));
|
||||
return dataStatistics;
|
||||
})
|
||||
.exceptionally(ex -> {
|
||||
|
|
@ -254,16 +239,6 @@ public class SupervisionStatisticsService {
|
|||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
CompletableFuture<Map<String, Object>> todayAuditPassStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::todayAuditPassStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
CompletableFuture<List<Map<String, Object>>> stationStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::stationStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
try {
|
||||
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
||||
|
|
@ -278,8 +253,6 @@ public class SupervisionStatisticsService {
|
|||
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
||||
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
||||
List<Map<String, Object>> dataTable = dataTableFuture.get();
|
||||
Map<String, Object> todayAuditPassStatistics = todayAuditPassStatisticsFuture.get();
|
||||
List<Map<String, Object>> stationStatistics = stationStatisticsFuture.get();
|
||||
return MapUtil.<String, Object>builder()
|
||||
.put("dataStatistics", dataStatistics)
|
||||
.put("warnTruck", warnTruck)
|
||||
|
|
@ -293,8 +266,6 @@ public class SupervisionStatisticsService {
|
|||
.put("userStatistics", userStatistics)
|
||||
.put("weightStatistics", weightStatistics)
|
||||
.put("dataTable", dataTable)
|
||||
.put("todayAuditPassStatistics", todayAuditPassStatistics)
|
||||
.put("stationStatistics", stationStatistics)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
throw Exceptions.exception(e, "数据获取失败");
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
package com.njzscloud.supervisory.config;
|
||||
|
||||
import com.njzscloud.supervisory.hsoa.HsoaProperties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({HsoaProperties.class})
|
||||
public class HsoaAutoConfiguration {
|
||||
|
||||
/* public HsoaAutoConfiguration(){
|
||||
log.info("HsoaAutoConfiguration");
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(HttpClientDecorator.class)
|
||||
public HsoaApi hsoaApi(HttpClientDecorator httpClientDecorator) {
|
||||
return httpClientDecorator.decorate(HsoaApi.class);
|
||||
} */
|
||||
|
||||
}
|
||||
|
|
@ -102,11 +102,4 @@ public class SearchCompanyResult {
|
|||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
|
||||
|
||||
private String idcard;
|
||||
private String idcardStartTime;
|
||||
private String idcardEndTime;
|
||||
private String idcardFront;
|
||||
private String idcardBack;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,4 @@ public class SearchCustomerResult {
|
|||
private SearchCompanyResult company;
|
||||
|
||||
private String settlementWay;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import com.njzscloud.supervisory.device.pojo.entity.DeviceInfoEntity;
|
|||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
||||
import com.njzscloud.supervisory.order.contant.SettlementWay;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderCarInOutEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||
|
|
@ -471,10 +470,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
BigDecimal weight_ = new BigDecimal(weight);
|
||||
BigDecimal v = weight_.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP);
|
||||
try {
|
||||
String settlementWay = orderPagingResult.getSettlementWay();
|
||||
if (SettlementWay.CASH.getTxt().equals(settlementWay)) {
|
||||
playVoice(sn, cid, "{}请先支付", licensePlate);
|
||||
}
|
||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
|
|
|
|||
|
|
@ -1,69 +0,0 @@
|
|||
package com.njzscloud.supervisory.discount.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.discount.pojo.DiscountManageEntity;
|
||||
import com.njzscloud.supervisory.discount.service.DiscountManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/discount")
|
||||
@RequiredArgsConstructor
|
||||
public class DiscountManageController {
|
||||
|
||||
private final DiscountManageService discountManageService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody DiscountManageEntity discountManageEntity) {
|
||||
discountManageService.add(discountManageEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody DiscountManageEntity discountManageEntity) {
|
||||
discountManageService.modify(discountManageEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
discountManageService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<DiscountManageEntity> detail(@RequestParam Long id) {
|
||||
return R.success(discountManageService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<DiscountManageEntity>> paging(PageParam pageParam, DiscountManageEntity discountManageEntity) {
|
||||
return R.success(discountManageService.paging(pageParam, discountManageEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.njzscloud.supervisory.discount.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.supervisory.discount.pojo.DiscountManageEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface DiscountManageMapper extends BaseMapper<DiscountManageEntity> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
package com.njzscloud.supervisory.discount.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "discount_manage", autoResultMap = true)
|
||||
public class DiscountManageEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 费用类型:goods 产品 service 服务费
|
||||
*/
|
||||
private String feeType;
|
||||
|
||||
/**
|
||||
* 服务费id
|
||||
*/
|
||||
private Long expenseId;
|
||||
|
||||
/**
|
||||
* 产品ids
|
||||
*/
|
||||
@TableField(value = "goods_ids", typeHandler = JsonTypeHandler.class)
|
||||
private List<String> goodsIds;
|
||||
|
||||
/**
|
||||
* 优惠类型:discount 优惠 raise加价
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 变化金额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 预警信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
package com.njzscloud.supervisory.discount.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.discount.pojo.DiscountManageEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
public interface DiscountManageService extends IService<DiscountManageEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(DiscountManageEntity discountManageEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(DiscountManageEntity discountManageEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
DiscountManageEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<DiscountManageEntity> paging(PageParam pageParam, DiscountManageEntity discountManageEntity);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
package com.njzscloud.supervisory.discount.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
|
||||
import com.njzscloud.supervisory.biz.service.BizCompanyService;
|
||||
import com.njzscloud.supervisory.discount.mapper.DiscountManageMapper;
|
||||
import com.njzscloud.supervisory.discount.pojo.DiscountManageEntity;
|
||||
import com.njzscloud.supervisory.discount.service.DiscountManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DiscountManageServiceImpl extends ServiceImpl<DiscountManageMapper, DiscountManageEntity> implements DiscountManageService {
|
||||
|
||||
private final BizCompanyService bizCompanyService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
public void add(DiscountManageEntity discountManageEntity) {
|
||||
this.save(discountManageEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
public void modify(DiscountManageEntity discountManageEntity) {
|
||||
this.updateById(discountManageEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
public void del(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Override
|
||||
public DiscountManageEntity detail(Long id) {
|
||||
DiscountManageEntity entity = this.getById(id);
|
||||
BizCompanyEntity companyEntity = bizCompanyService.getById(entity.getCompanyId());
|
||||
if (null != companyEntity) {
|
||||
entity.setCompanyName(companyEntity.getCompanyName());
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public PageResult<DiscountManageEntity> paging(PageParam pageParam, DiscountManageEntity discountManageEntity) {
|
||||
Page<DiscountManageEntity> page = this.page(pageParam.toPage(), Wrappers.<DiscountManageEntity>lambdaQuery()
|
||||
.eq(discountManageEntity.getCompanyId() != null, DiscountManageEntity::getCompanyId, discountManageEntity.getCompanyId())
|
||||
.eq(StrUtil.isNotBlank(discountManageEntity.getFeeType()), DiscountManageEntity::getFeeType, discountManageEntity.getFeeType())
|
||||
.eq(discountManageEntity.getExpenseId() != null, DiscountManageEntity::getExpenseId, discountManageEntity.getExpenseId())
|
||||
.eq(StrUtil.isNotBlank(discountManageEntity.getType()), DiscountManageEntity::getType, discountManageEntity.getType())
|
||||
.eq(discountManageEntity.getDeleted() != null, DiscountManageEntity::getDeleted, Boolean.FALSE)
|
||||
.orderByDesc(DiscountManageEntity::getCreateTime));
|
||||
for (DiscountManageEntity entity: page.getRecords()) {
|
||||
BizCompanyEntity companyEntity = bizCompanyService.getById(entity.getCompanyId());
|
||||
if (null != companyEntity) {
|
||||
entity.setCompanyName(companyEntity.getCompanyName());
|
||||
}
|
||||
}
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,520 +0,0 @@
|
|||
# 豆包垃圾分析接口文档
|
||||
|
||||
## 接口概述
|
||||
|
||||
本接口基于火山引擎豆包AI模型,提供垃圾车辆图片分析功能。通过上传多张垃圾车辆图片,AI会自动识别车棚状态、垃圾类型、轻物质和重物质占比等信息。
|
||||
|
||||
**接口路径:** `/douBao/analyzeGarbage`
|
||||
**请求方式:** `POST`
|
||||
**Content-Type:** `application/json`
|
||||
|
||||
---
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体(GarbageAnalysisParam)
|
||||
|
||||
| 参数名 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| imageUrls | List<String> | 是 | 图片URL列表,支持多张图片,至少需要一张 |
|
||||
| orderSn | String | 否 | 订单号,用于关联订单信息 |
|
||||
| remark | String | 否 | 备注信息,可提供额外的分析上下文 |
|
||||
|
||||
### 参数说明
|
||||
|
||||
- **imageUrls**:图片URL列表,支持HTTP/HTTPS协议的图片链接。建议使用可公开访问的图片URL。
|
||||
- **orderSn**:订单号,用于在分析结果中关联订单信息,便于后续查询和追踪。
|
||||
- **remark**:备注信息,可以包含订单相关的额外信息,如装货地点、卸货地点等,有助于AI更准确地进行分析。
|
||||
|
||||
---
|
||||
|
||||
## 响应结果
|
||||
|
||||
### 响应体(GarbageAnalysisResult)
|
||||
|
||||
| 字段名 | 类型 | 说明 |
|
||||
|--------|------|------|
|
||||
| isShedOpened | Boolean | 车棚是否完全打开。true表示已打开,false表示未打开 |
|
||||
| details | String | 明细信息,车厢内包含的物品列表。格式:物品1(数量描述),物品2(数量描述),例如:石块(多),木材(少) |
|
||||
| lightMaterialPercentage | BigDecimal | 轻物质占比(百分比,0-100) |
|
||||
| heavyMaterialPercentage | BigDecimal | 重物质占比(百分比,0-100) |
|
||||
| garbageType | String | 垃圾类型,可能的值:拆除垃圾、装修垃圾、抛货 |
|
||||
| judgmentBasis | String | 判断依据,说明AI判断垃圾类型的原因 |
|
||||
| analysisTime | Long | 分析时间戳(毫秒) |
|
||||
| rawResponse | String | AI原始响应内容,用于调试和问题排查 |
|
||||
| garbageTypes | List<GarbageTypeInfo> | 垃圾类型分析列表(保留字段,用于兼容) |
|
||||
| totalWeight | BigDecimal | 总重量(单位:千克)(保留字段,用于兼容) |
|
||||
|
||||
### GarbageTypeInfo 对象结构(保留字段)
|
||||
|
||||
| 字段名 | 类型 | 说明 |
|
||||
|--------|------|------|
|
||||
| typeName | String | 垃圾类型名称 |
|
||||
| category | String | 具体垃圾种类 |
|
||||
| judgmentBasis | String | 判断依据 |
|
||||
| percentage | BigDecimal | 占比(百分比,0-100) |
|
||||
| weight | BigDecimal | 估算重量(单位:千克) |
|
||||
|
||||
---
|
||||
|
||||
## 请求示例
|
||||
|
||||
### 场景一:最小参数(仅图片URL)
|
||||
|
||||
**适用场景:** 快速测试,仅提供必要的图片URL
|
||||
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 命令:**
|
||||
```bash
|
||||
curl -X POST "http://localhost:8080/douBao/analyzeGarbage" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 场景二:单张图片 + 订单号
|
||||
|
||||
**适用场景:** 关联订单信息
|
||||
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001"
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 命令:**
|
||||
```bash
|
||||
curl -X POST "http://localhost:8080/douBao/analyzeGarbage" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001"
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 场景三:多张图片(推荐)
|
||||
|
||||
**适用场景:** 从不同角度拍摄,提高分析准确性
|
||||
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-front.jpg",
|
||||
"https://example.com/garbage-truck-side.jpg",
|
||||
"https://example.com/garbage-truck-back.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "装货地点:南京市建邺区,卸货地点:南京市江宁区"
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 命令:**
|
||||
```bash
|
||||
curl -X POST "http://localhost:8080/douBao/analyzeGarbage" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-front.jpg",
|
||||
"https://example.com/garbage-truck-side.jpg",
|
||||
"https://example.com/garbage-truck-back.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "装货地点:南京市建邺区,卸货地点:南京市江宁区"
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 场景四:完整参数示例
|
||||
|
||||
**适用场景:** 生产环境,包含所有可选信息
|
||||
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://cdn.example.com/orders/2024/01/01/truck-front-001.jpg",
|
||||
"https://cdn.example.com/orders/2024/01/01/truck-side-001.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "订单编号:ORD20240101001;装货地点:南京市建邺区奥体中心;卸货地点:南京市江宁区垃圾处理厂;装货时间:2024-01-01 10:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
**cURL 命令:**
|
||||
```bash
|
||||
curl -X POST "http://localhost:8080/douBao/analyzeGarbage" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"imageUrls": [
|
||||
"https://cdn.example.com/orders/2024/01/01/truck-front-001.jpg",
|
||||
"https://cdn.example.com/orders/2024/01/01/truck-side-001.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "订单编号:ORD20240101001;装货地点:南京市建邺区奥体中心;卸货地点:南京市江宁区垃圾处理厂;装货时间:2024-01-01 10:00:00"
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Java 示例
|
||||
|
||||
#### 方式一:使用链式调用(推荐)
|
||||
|
||||
```java
|
||||
import com.njzscloud.supervisory.doubao.param.GarbageAnalysisParam;
|
||||
import com.njzscloud.supervisory.doubao.result.GarbageAnalysisResult;
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import java.util.Arrays;
|
||||
|
||||
// 最小参数
|
||||
GarbageAnalysisParam param1 = new GarbageAnalysisParam()
|
||||
.setImageUrls(Arrays.asList("https://example.com/garbage-truck-1.jpg"));
|
||||
|
||||
// 完整参数
|
||||
GarbageAnalysisParam param2 = new GarbageAnalysisParam()
|
||||
.setImageUrls(Arrays.asList(
|
||||
"https://example.com/garbage-truck-front.jpg",
|
||||
"https://example.com/garbage-truck-side.jpg"
|
||||
))
|
||||
.setOrderSn("ORD20240101001")
|
||||
.setRemark("装货地点:南京市建邺区,卸货地点:南京市江宁区");
|
||||
|
||||
R<GarbageAnalysisResult> result = douBaoController.analyzeGarbage(param2);
|
||||
if (result.getCode() == 200) {
|
||||
GarbageAnalysisResult data = result.getData();
|
||||
System.out.println("车棚状态:" + (data.getIsShedOpened() ? "已打开" : "未打开"));
|
||||
System.out.println("垃圾类型:" + data.getGarbageType());
|
||||
System.out.println("轻物质占比:" + data.getLightMaterialPercentage() + "%");
|
||||
System.out.println("重物质占比:" + data.getHeavyMaterialPercentage() + "%");
|
||||
}
|
||||
```
|
||||
|
||||
#### 方式二:传统方式
|
||||
|
||||
```java
|
||||
GarbageAnalysisParam param = new GarbageAnalysisParam();
|
||||
param.setImageUrls(Arrays.asList(
|
||||
"https://example.com/garbage-truck-1.jpg",
|
||||
"https://example.com/garbage-truck-2.jpg"
|
||||
));
|
||||
param.setOrderSn("ORD20240101001");
|
||||
param.setRemark("装货地点:南京市建邺区,卸货地点:南京市江宁区");
|
||||
|
||||
R<GarbageAnalysisResult> result = douBaoController.analyzeGarbage(param);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JavaScript/Axios 示例
|
||||
|
||||
```javascript
|
||||
// 使用 fetch
|
||||
fetch('http://localhost:8080/douBao/analyzeGarbage', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
imageUrls: [
|
||||
'https://example.com/garbage-truck-1.jpg',
|
||||
'https://example.com/garbage-truck-2.jpg'
|
||||
],
|
||||
orderSn: 'ORD20240101001',
|
||||
remark: '装货地点:南京市建邺区,卸货地点:南京市江宁区'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.code === 200) {
|
||||
console.log('分析成功:', data.data);
|
||||
console.log('车棚状态:', data.data.isShedOpened ? '已打开' : '未打开');
|
||||
console.log('垃圾类型:', data.data.garbageType);
|
||||
} else {
|
||||
console.error('分析失败:', data.msg);
|
||||
}
|
||||
})
|
||||
.catch(error => console.error('请求错误:', error));
|
||||
|
||||
// 使用 axios
|
||||
import axios from 'axios';
|
||||
|
||||
const analyzeGarbage = async () => {
|
||||
try {
|
||||
const response = await axios.post('http://localhost:8080/douBao/analyzeGarbage', {
|
||||
imageUrls: [
|
||||
'https://example.com/garbage-truck-1.jpg',
|
||||
'https://example.com/garbage-truck-2.jpg'
|
||||
],
|
||||
orderSn: 'ORD20240101001',
|
||||
remark: '装货地点:南京市建邺区,卸货地点:南京市江宁区'
|
||||
});
|
||||
|
||||
if (response.data.code === 200) {
|
||||
console.log('分析结果:', response.data.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求失败:', error);
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Postman/Apifox 测试配置
|
||||
|
||||
#### 请求配置
|
||||
- **请求方式:** `POST`
|
||||
- **请求URL:** `http://localhost:8080/douBao/analyzeGarbage`
|
||||
- **Headers:**
|
||||
- `Content-Type: application/json`
|
||||
|
||||
#### Body(raw JSON)示例
|
||||
|
||||
**示例1:最小参数**
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**示例2:完整参数**
|
||||
```json
|
||||
{
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-front.jpg",
|
||||
"https://example.com/garbage-truck-side.jpg",
|
||||
"https://example.com/garbage-truck-back.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "装货地点:南京市建邺区奥体中心;卸货地点:南京市江宁区垃圾处理厂"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Python 示例
|
||||
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
url = "http://localhost:8080/douBao/analyzeGarbage"
|
||||
|
||||
# 最小参数
|
||||
payload1 = {
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-1.jpg"
|
||||
]
|
||||
}
|
||||
|
||||
# 完整参数
|
||||
payload2 = {
|
||||
"imageUrls": [
|
||||
"https://example.com/garbage-truck-front.jpg",
|
||||
"https://example.com/garbage-truck-side.jpg"
|
||||
],
|
||||
"orderSn": "ORD20240101001",
|
||||
"remark": "装货地点:南京市建邺区,卸货地点:南京市江宁区"
|
||||
}
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, data=json.dumps(payload2))
|
||||
result = response.json()
|
||||
|
||||
if result.get("code") == 200:
|
||||
data = result.get("data")
|
||||
print(f"车棚状态:{'已打开' if data.get('isShedOpened') else '未打开'}")
|
||||
print(f"垃圾类型:{data.get('garbageType')}")
|
||||
print(f"轻物质占比:{data.get('lightMaterialPercentage')}%")
|
||||
print(f"重物质占比:{data.get('heavyMaterialPercentage')}%")
|
||||
else:
|
||||
print(f"分析失败:{result.get('msg')}")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 测试图片URL说明
|
||||
|
||||
**注意:** 实际测试时,请替换为真实可访问的图片URL。图片URL需要满足以下条件:
|
||||
|
||||
1. **可公开访问**:图片URL必须可以通过HTTP/HTTPS协议直接访问
|
||||
2. **支持格式**:建议使用 JPG、PNG 等常见图片格式
|
||||
3. **图片质量**:建议图片清晰,能够清楚看到车辆和垃圾内容
|
||||
4. **推荐来源**:
|
||||
- OSS对象存储(如阿里云OSS、腾讯云COS等)
|
||||
- CDN加速域名
|
||||
- 公网可访问的图片服务器
|
||||
|
||||
**测试用占位图片(仅供参考,实际使用时请替换):**
|
||||
```
|
||||
https://via.placeholder.com/800x600.jpg?text=Garbage+Truck+Front
|
||||
https://via.placeholder.com/800x600.jpg?text=Garbage+Truck+Side
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 本地开发环境测试
|
||||
|
||||
如果是在本地开发环境测试,请确保:
|
||||
|
||||
1. **服务已启动**:确保Spring Boot应用已启动
|
||||
2. **端口正确**:默认端口通常是 `8080`,请根据实际配置调整
|
||||
3. **跨域配置**:如果前端调用,可能需要配置CORS
|
||||
4. **完整URL示例**:
|
||||
- 本地:`http://localhost:8080/douBao/analyzeGarbage`
|
||||
- 开发环境:`http://dev.example.com:8080/douBao/analyzeGarbage`
|
||||
- 生产环境:`https://api.example.com/douBao/analyzeGarbage`
|
||||
|
||||
---
|
||||
|
||||
## 响应示例
|
||||
|
||||
### 成功响应(车棚已打开)
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
"isShedOpened": true,
|
||||
"details": "石块(多),木材(少)",
|
||||
"lightMaterialPercentage": 10.00,
|
||||
"heavyMaterialPercentage": 90.00,
|
||||
"garbageType": "拆除垃圾",
|
||||
"judgmentBasis": "车厢内主要为石块,这类垃圾多来自建筑物拆除等工程",
|
||||
"analysisTime": 1704067200000,
|
||||
"rawResponse": "明细:石块(多),木材(少);轻物质:10%;重物质:90%;垃圾类型:拆除垃圾;判断依据:车厢内主要为石块,这类垃圾多来自建筑物拆除等工程",
|
||||
"garbageTypes": null,
|
||||
"totalWeight": null
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 成功响应(车棚未打开)
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
"isShedOpened": false,
|
||||
"details": "未打开车棚",
|
||||
"lightMaterialPercentage": null,
|
||||
"heavyMaterialPercentage": null,
|
||||
"garbageType": null,
|
||||
"judgmentBasis": null,
|
||||
"analysisTime": 1704067200000,
|
||||
"rawResponse": "未打开车棚",
|
||||
"garbageTypes": null,
|
||||
"totalWeight": null
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 错误响应
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 500,
|
||||
"msg": "垃圾分析失败:垃圾分析参数不能为空,且必须包含至少一张图片URL",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 错误码说明
|
||||
|
||||
| 错误码 | 说明 |
|
||||
|--------|------|
|
||||
| 200 | 请求成功 |
|
||||
| 400 | 请求参数错误(如:图片URL列表为空) |
|
||||
| 500 | 服务器内部错误(如:AI服务调用失败、解析失败等) |
|
||||
|
||||
---
|
||||
|
||||
## 业务逻辑说明
|
||||
|
||||
### 分析流程
|
||||
|
||||
1. **车棚状态检测**:AI首先判断车棚是否完全打开
|
||||
- 如果车棚未完全打开,直接返回"未打开车棚",不进行后续分析
|
||||
- 如果车棚已打开,继续执行垃圾分析
|
||||
|
||||
2. **垃圾识别**(仅当车棚已打开时):
|
||||
- 识别车厢内包含的物品类型和数量
|
||||
- 如果有多辆车,只分析画面中间的车辆
|
||||
- 分析轻物质和重物质的占比(百分比,0-100,两者之和应为100%)
|
||||
- 判断垃圾类型:拆除垃圾、装修垃圾或抛货
|
||||
- 提供判断依据说明
|
||||
|
||||
### 垃圾类型说明
|
||||
|
||||
- **拆除垃圾**:主要来自建筑物拆除等工程,通常包含大量石块、混凝土块等重物质
|
||||
- **装修垃圾**:主要来自室内装修,通常包含白色板材、泡沫、木棍等轻物质
|
||||
- **抛货**:其他类型的垃圾
|
||||
|
||||
---
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **图片要求**:
|
||||
- 图片URL必须可公开访问
|
||||
- 支持HTTP/HTTPS协议
|
||||
- 建议图片清晰,能够清楚看到车辆和垃圾内容
|
||||
- 支持多张图片,建议从不同角度拍摄
|
||||
|
||||
2. **性能考虑**:
|
||||
- AI分析需要一定时间,建议设置合理的超时时间
|
||||
- 图片数量越多,分析时间可能越长
|
||||
|
||||
3. **数据准确性**:
|
||||
- AI分析结果仅供参考,建议结合人工审核
|
||||
- 如果分析结果不准确,可以通过 `rawResponse` 字段查看AI原始响应进行排查
|
||||
|
||||
4. **字段说明**:
|
||||
- `garbageTypes` 和 `totalWeight` 为保留字段,当前版本可能为null
|
||||
- `isShedOpened` 为false时,其他分析字段(如 `garbageType`、`lightMaterialPercentage` 等)可能为null
|
||||
|
||||
5. **格式要求**:
|
||||
- AI返回的格式为固定格式,解析失败时会记录警告日志
|
||||
- 如果解析结果不完整,建议查看 `rawResponse` 字段获取原始响应
|
||||
|
||||
---
|
||||
|
||||
## 更新日志
|
||||
|
||||
| 版本 | 日期 | 更新内容 |
|
||||
|------|------|----------|
|
||||
| 1.0.0 | 2024-01-01 | 初始版本,支持垃圾车辆图片分析功能 |
|
||||
|
||||
---
|
||||
|
||||
## 联系方式
|
||||
|
||||
如有问题或建议,请联系开发团队。
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.config;
|
||||
|
||||
import com.volcengine.ark.runtime.service.ArkService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.Dispatcher;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 火山引擎豆包配置类
|
||||
*/
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
@EnableConfigurationProperties(DouBaoProperties.class)
|
||||
public class DouBaoConfiguration {
|
||||
|
||||
private final DouBaoProperties properties;
|
||||
|
||||
@Bean(destroyMethod = "shutdownExecutor")
|
||||
@ConditionalOnMissingBean
|
||||
public ArkService arkService() {
|
||||
String apiKey = properties.getApiKey();
|
||||
if (!StringUtils.hasText(apiKey)) {
|
||||
throw new IllegalStateException("豆包API Key未配置,请设置环境变量 ARK_API_KEY 或在配置文件中设置 doubao.api-key");
|
||||
}
|
||||
|
||||
ConnectionPool connectionPool = new ConnectionPool(
|
||||
properties.getConnectionPoolSize(),
|
||||
properties.getConnectionKeepAliveSeconds(),
|
||||
TimeUnit.SECONDS
|
||||
);
|
||||
Dispatcher dispatcher = new Dispatcher();
|
||||
|
||||
return ArkService.builder()
|
||||
.dispatcher(dispatcher)
|
||||
.connectionPool(connectionPool)
|
||||
.baseUrl(properties.getBaseUrl())
|
||||
.apiKey(apiKey)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* 火山引擎豆包配置
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@ConfigurationProperties(prefix = "doubao")
|
||||
public class DouBaoProperties {
|
||||
|
||||
/**
|
||||
* API Key,优先从环境变量 ARK_API_KEY 获取,如果环境变量不存在则使用配置值
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 基础URL,默认为 https://ark.cn-beijing.volces.com/api/v3
|
||||
*/
|
||||
private String baseUrl = "https://ark.cn-beijing.volces.com/api/v3";
|
||||
|
||||
/**
|
||||
* 模型ID,默认为 doubao-seed-1-6-vision-250815
|
||||
*/
|
||||
private String model = "doubao-seed-1-6-vision-250815";
|
||||
|
||||
/**
|
||||
* 连接池大小,默认5
|
||||
*/
|
||||
private Integer connectionPoolSize = 5;
|
||||
|
||||
/**
|
||||
* 连接保持时间(秒),默认1
|
||||
*/
|
||||
private Long connectionKeepAliveSeconds = 1L;
|
||||
|
||||
/**
|
||||
* 获取API Key,优先从环境变量获取
|
||||
*/
|
||||
public String getApiKey() {
|
||||
String envApiKey = System.getenv("ARK_API_KEY");
|
||||
return envApiKey != null ? envApiKey : apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.supervisory.doubao.param.GarbageAnalysisParam;
|
||||
import com.njzscloud.supervisory.doubao.result.GarbageAnalysisResult;
|
||||
import com.njzscloud.supervisory.doubao.sevice.DouBaoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 豆包
|
||||
* 使用豆包官方SDK的生产级实现
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/douBao")
|
||||
@RequiredArgsConstructor
|
||||
public class DouBaoController {
|
||||
|
||||
private final DouBaoService douBaoService;
|
||||
|
||||
@PostMapping("/analyzeGarbage")
|
||||
public R<GarbageAnalysisResult> analyzeGarbage(@RequestBody GarbageAnalysisParam param) {
|
||||
return R.success(douBaoService.analyzeGarbage(param));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 垃圾分析请求参数
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class GarbageAnalysisParam {
|
||||
|
||||
/**
|
||||
* 图片URL列表(支持多张图片)
|
||||
*/
|
||||
private List<String> imageUrls;
|
||||
|
||||
/**
|
||||
* 订单号(可选)
|
||||
*/
|
||||
private String orderSn;
|
||||
|
||||
/**
|
||||
* 备注信息(可选)
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 垃圾分析结果
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class GarbageAnalysisResult {
|
||||
|
||||
/**
|
||||
* 车棚是否完全打开
|
||||
*/
|
||||
private Boolean isShedOpened;
|
||||
|
||||
/**
|
||||
* 明细:车厢内包含的物品列表,格式:物品1(数量描述),物品2(数量描述)
|
||||
* 例如:石块(多),木材(少)
|
||||
*/
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 轻物质占比(百分比,0-100)
|
||||
*/
|
||||
private BigDecimal lightMaterialPercentage;
|
||||
|
||||
/**
|
||||
* 重物质占比(百分比,0-100)
|
||||
*/
|
||||
private BigDecimal heavyMaterialPercentage;
|
||||
|
||||
/**
|
||||
* 垃圾类型:拆除垃圾、装修垃圾、抛货
|
||||
*/
|
||||
private String garbageType;
|
||||
|
||||
/**
|
||||
* 判断依据:说明判断垃圾类型的原因
|
||||
*/
|
||||
private String judgmentBasis;
|
||||
|
||||
/**
|
||||
* 分析时间戳
|
||||
*/
|
||||
private Long analysisTime;
|
||||
|
||||
/**
|
||||
* 原始响应内容
|
||||
*/
|
||||
private String rawResponse;
|
||||
|
||||
/**
|
||||
* 垃圾类型分析列表(保留用于兼容)
|
||||
*/
|
||||
private List<GarbageTypeInfo> garbageTypes;
|
||||
|
||||
/**
|
||||
* 总重量(单位:千克)(保留用于兼容)
|
||||
*/
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
/**
|
||||
* 垃圾类型信息(保留用于兼容)
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class GarbageTypeInfo {
|
||||
/**
|
||||
* 垃圾类型名称(如:可回收垃圾、有害垃圾、厨余垃圾、其他垃圾等)
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 具体垃圾种类(如:塑料瓶、废纸、电池等)
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 判断依据(AI识别该垃圾类型的理由)
|
||||
*/
|
||||
private String judgmentBasis;
|
||||
|
||||
/**
|
||||
* 占比(百分比,0-100)
|
||||
*/
|
||||
private BigDecimal percentage;
|
||||
|
||||
/**
|
||||
* 估算重量(单位:千克)
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.sevice;
|
||||
|
||||
import com.njzscloud.supervisory.doubao.param.GarbageAnalysisParam;
|
||||
import com.njzscloud.supervisory.doubao.result.GarbageAnalysisResult;
|
||||
|
||||
/**
|
||||
* 火山引擎豆包服务接口
|
||||
*/
|
||||
public interface DouBaoService {
|
||||
|
||||
/**
|
||||
* 垃圾分析 - 分析多张图片中的垃圾类型、占比和重量
|
||||
*
|
||||
* @param param 垃圾分析请求参数,包含多张图片URL
|
||||
* @return 垃圾分析结果,包含垃圾类型、判断依据、占比、重量等信息
|
||||
*/
|
||||
GarbageAnalysisResult analyzeGarbage(GarbageAnalysisParam param);
|
||||
}
|
||||
|
|
@ -1,242 +0,0 @@
|
|||
package com.njzscloud.supervisory.doubao.sevice.impl;
|
||||
|
||||
import com.njzscloud.supervisory.doubao.config.DouBaoProperties;
|
||||
import com.njzscloud.supervisory.doubao.param.GarbageAnalysisParam;
|
||||
import com.njzscloud.supervisory.doubao.result.GarbageAnalysisResult;
|
||||
import com.njzscloud.supervisory.doubao.sevice.DouBaoService;
|
||||
import com.volcengine.ark.runtime.model.completion.chat.ChatCompletionContentPart;
|
||||
import com.volcengine.ark.runtime.model.completion.chat.ChatCompletionRequest;
|
||||
import com.volcengine.ark.runtime.model.completion.chat.ChatMessage;
|
||||
import com.volcengine.ark.runtime.model.completion.chat.ChatMessageRole;
|
||||
import com.volcengine.ark.runtime.service.ArkService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 火山引擎豆包服务实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DouBaoServiceImpl implements DouBaoService {
|
||||
|
||||
private final ArkService arkService;
|
||||
private final DouBaoProperties douBaoProperties;
|
||||
|
||||
/**
|
||||
* 垃圾分析 - 分析多张图片中的垃圾类型、占比和重量
|
||||
*
|
||||
* @param param 垃圾分析请求参数,包含多张图片URL
|
||||
* @return 垃圾分析结果,包含垃圾类型、判断依据、占比、重量等信息
|
||||
*/
|
||||
@Override
|
||||
public GarbageAnalysisResult analyzeGarbage(GarbageAnalysisParam param) {
|
||||
try {
|
||||
log.info("开始调用火山引擎豆包API进行垃圾分析,订单号:{},图片数量:{}",
|
||||
param != null ? param.getOrderSn() : "未知",
|
||||
param != null && param.getImageUrls() != null ? param.getImageUrls().size() : 0);
|
||||
|
||||
// 参数校验
|
||||
if (param == null || CollectionUtils.isEmpty(param.getImageUrls())) {
|
||||
throw new IllegalArgumentException("垃圾分析参数不能为空,且必须包含至少一张图片URL");
|
||||
}
|
||||
|
||||
// 构建消息列表
|
||||
final List<ChatMessage> messages = new ArrayList<>();
|
||||
final List<ChatCompletionContentPart> multiParts = new ArrayList<>();
|
||||
|
||||
// 添加所有图片URL
|
||||
for (String imageUrl : param.getImageUrls()) {
|
||||
if (StringUtils.hasText(imageUrl)) {
|
||||
multiParts.add(ChatCompletionContentPart.builder()
|
||||
.type("image_url")
|
||||
.imageUrl(new ChatCompletionContentPart.ChatCompletionContentPartImageURL(imageUrl))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
// 添加文本提示词,要求返回JSON格式
|
||||
String textPrompt = buildGarbageAnalysisPrompt(param);
|
||||
multiParts.add(ChatCompletionContentPart.builder()
|
||||
.type("text")
|
||||
.text(textPrompt)
|
||||
.build());
|
||||
|
||||
// 构建用户消息
|
||||
final ChatMessage userMessage = ChatMessage.builder()
|
||||
.role(ChatMessageRole.USER)
|
||||
.multiContent(multiParts)
|
||||
.build();
|
||||
messages.add(userMessage);
|
||||
|
||||
// 构建请求
|
||||
ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest.builder()
|
||||
.model(douBaoProperties.getModel())
|
||||
.messages(messages)
|
||||
.build();
|
||||
|
||||
// 调用API并获取响应
|
||||
String response = arkService.createChatCompletion(chatCompletionRequest)
|
||||
.getChoices()
|
||||
.stream()
|
||||
.map(choice -> String.valueOf(choice.getMessage().getContent()))
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
log.info("火山引擎豆包API调用成功,原始响应内容:{}", response);
|
||||
|
||||
// 解析响应并转换为结果对象
|
||||
GarbageAnalysisResult result = parseGarbageAnalysisResponse(response);
|
||||
result.setRawResponse(response);
|
||||
result.setAnalysisTime(System.currentTimeMillis());
|
||||
|
||||
log.info("垃圾分析完成,车棚状态:{},垃圾类型:{},轻物质占比:{}%,重物质占比:{}%",
|
||||
result.getIsShedOpened() != null && result.getIsShedOpened() ? "已打开" : "未打开",
|
||||
result.getGarbageType(),
|
||||
result.getLightMaterialPercentage(),
|
||||
result.getHeavyMaterialPercentage());
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("调用火山引擎豆包API进行垃圾分析失败,订单号:{}",
|
||||
param != null ? param.getOrderSn() : "未知", e);
|
||||
throw new RuntimeException("垃圾分析失败:" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建垃圾分析提示词
|
||||
* 要求AI返回指定格式的文本
|
||||
*/
|
||||
private String buildGarbageAnalysisPrompt(GarbageAnalysisParam param) {
|
||||
StringBuilder prompt = new StringBuilder();
|
||||
prompt.append("请仔细分析这些图片中的垃圾内容。\n\n");
|
||||
|
||||
// 添加订单信息(如果有)
|
||||
if (StringUtils.hasText(param.getOrderSn())) {
|
||||
prompt.append("订单号:").append(param.getOrderSn()).append("\n");
|
||||
}
|
||||
if (StringUtils.hasText(param.getRemark())) {
|
||||
prompt.append("备注:").append(param.getRemark()).append("\n");
|
||||
}
|
||||
|
||||
prompt.append("\n请按照以下要求进行分析:\n");
|
||||
prompt.append("1. 首先判断图片中是否有垃圾运输车辆:\n");
|
||||
prompt.append(" - 如果图片中没有车辆(直接是垃圾堆、垃圾场等场景),请直接跳到第3步分析垃圾内容\n");
|
||||
prompt.append(" - 如果图片中有车辆,请继续第2步判断车棚状态\n");
|
||||
prompt.append("2. 如果图片中有车辆,判断车棚是否完全打开:\n");
|
||||
prompt.append(" - 如果车棚没有完全打开,无法看到车厢内的垃圾内容,直接回答:未打开车棚\n");
|
||||
prompt.append(" - 如果车棚完全打开,可以看到车厢内的垃圾,请继续第3步分析\n");
|
||||
prompt.append("3. 分析垃圾内容(适用于:无车辆的场景,或有车辆且车棚已打开的场景):\n");
|
||||
prompt.append(" - 识别垃圾中包含哪几种物品(如果有多辆车,只分析画面中间的车辆或主要垃圾堆)\n");
|
||||
prompt.append(" - 说明哪种物品占比最多\n");
|
||||
prompt.append(" - 给出轻物质和重物质的大概占比(使用百分比数值,0-100)\n");
|
||||
prompt.append(" - 判断垃圾类型:拆除垃圾、装修垃圾或抛货\n");
|
||||
prompt.append(" - 说明判断垃圾类型的原因\n\n");
|
||||
|
||||
prompt.append("请严格按照以下格式返回结果,不要添加任何其他文字说明:\n");
|
||||
prompt.append("如果图片中有车辆且车棚未打开,直接回答:未打开车棚\n");
|
||||
prompt.append("如果图片中没有车辆,或者有车辆且车棚已打开,按照以下格式回答:\n");
|
||||
prompt.append("明细:物品1(数量描述),物品2(数量描述);轻物质:x%;重物质:x%;垃圾类型:x;判断依据:x\n\n");
|
||||
prompt.append("格式说明:\n");
|
||||
prompt.append("- 明细:列出垃圾中包含的所有物品,用逗号分隔,每个物品后标注数量(多、少、较多、较少等)\n");
|
||||
prompt.append("- 轻物质:轻物质的占比百分比(0-100)\n");
|
||||
prompt.append("- 重物质:重物质的占比百分比(0-100),轻物质和重物质占比之和应为100%\n");
|
||||
prompt.append("- 垃圾类型:拆除垃圾、装修垃圾或抛货\n");
|
||||
prompt.append("- 判断依据:详细说明为什么判断为该垃圾类型\n\n");
|
||||
prompt.append("示例:\n");
|
||||
prompt.append("明细:石块(多);轻物质:0%;重物质:100%;垃圾类型:拆除垃圾;判断依据:主要为石块,这类垃圾多来自建筑物拆除等工程\n");
|
||||
prompt.append("明细:白色板材(多),白色泡沫(少),木棍(少);轻物质:90%;重物质:10%;垃圾类型:装修垃圾;判断依据:主要是白色板材、泡沫等装修常见废弃物\n");
|
||||
prompt.append("明细:纸箱(多),塑料瓶(少),泡沫箱(少);轻物质:95%;重物质:5%;垃圾类型:抛货;判断依据:主要是轻质包装材料,属于抛货类垃圾\n\n");
|
||||
prompt.append("注意:必须严格按照上述格式返回,不要添加任何其他文字说明。");
|
||||
|
||||
return prompt.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析垃圾分析响应
|
||||
* 从AI响应中提取信息并转换为结果对象
|
||||
* 格式:明细:xx(x),xx(x);轻物质:x%;重物质:x%;垃圾类型:x;判断依据:x
|
||||
* 或者:未打开车棚
|
||||
*/
|
||||
private GarbageAnalysisResult parseGarbageAnalysisResponse(String response) {
|
||||
if (!StringUtils.hasText(response)) {
|
||||
throw new RuntimeException("AI响应为空,无法解析");
|
||||
}
|
||||
|
||||
try {
|
||||
GarbageAnalysisResult result = new GarbageAnalysisResult();
|
||||
String trimmed = response.trim();
|
||||
|
||||
// 检查是否是"未打开车棚"的情况
|
||||
if (trimmed.contains("未打开车棚")) {
|
||||
result.setIsShedOpened(false);
|
||||
result.setDetails("未打开车棚");
|
||||
result.setLightMaterialPercentage(BigDecimal.ZERO);
|
||||
result.setHeavyMaterialPercentage(BigDecimal.ZERO);
|
||||
result.setGarbageType("无");
|
||||
result.setJudgmentBasis("车棚未完全打开,无法进行分析");
|
||||
return result;
|
||||
}
|
||||
|
||||
// 车棚已打开,解析详细格式
|
||||
result.setIsShedOpened(true);
|
||||
|
||||
// 提取明细
|
||||
Pattern detailsPattern = Pattern.compile("明细[::]([^;]+)");
|
||||
Matcher detailsMatcher = detailsPattern.matcher(trimmed);
|
||||
if (detailsMatcher.find()) {
|
||||
result.setDetails(detailsMatcher.group(1).trim());
|
||||
}
|
||||
|
||||
// 提取轻物质占比
|
||||
Pattern lightPattern = Pattern.compile("轻物质[::](\\d+(?:\\.\\d+)?)%");
|
||||
Matcher lightMatcher = lightPattern.matcher(trimmed);
|
||||
if (lightMatcher.find()) {
|
||||
result.setLightMaterialPercentage(new BigDecimal(lightMatcher.group(1)));
|
||||
}
|
||||
|
||||
// 提取重物质占比
|
||||
Pattern heavyPattern = Pattern.compile("重物质[::](\\d+(?:\\.\\d+)?)%");
|
||||
Matcher heavyMatcher = heavyPattern.matcher(trimmed);
|
||||
if (heavyMatcher.find()) {
|
||||
result.setHeavyMaterialPercentage(new BigDecimal(heavyMatcher.group(1)));
|
||||
}
|
||||
|
||||
// 提取垃圾类型
|
||||
Pattern typePattern = Pattern.compile("垃圾类型[::]([^;]+)");
|
||||
Matcher typeMatcher = typePattern.matcher(trimmed);
|
||||
if (typeMatcher.find()) {
|
||||
result.setGarbageType(typeMatcher.group(1).trim());
|
||||
}
|
||||
|
||||
// 提取判断依据
|
||||
Pattern basisPattern = Pattern.compile("判断依据[::](.+)");
|
||||
Matcher basisMatcher = basisPattern.matcher(trimmed);
|
||||
if (basisMatcher.find()) {
|
||||
result.setJudgmentBasis(basisMatcher.group(1).trim());
|
||||
}
|
||||
|
||||
// 验证必要字段
|
||||
if (result.getDetails() == null || result.getGarbageType() == null) {
|
||||
log.warn("解析结果不完整,响应内容:{}", response);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("解析垃圾分析响应失败,响应内容:{}", response, e);
|
||||
throw new RuntimeException("解析AI响应失败:" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.njzscloud.supervisory.expense.contant;
|
||||
|
||||
import com.njzscloud.common.core.ienum.DictStr;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 字典代码:stations_scope
|
||||
* 字典名称:站点范围
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum StationsScope implements DictStr {
|
||||
ALL("all", "所有站点"),
|
||||
STATIONS("stations", "指定站点"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
|||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
||||
import com.njzscloud.supervisory.expense.contant.Scope;
|
||||
import com.njzscloud.supervisory.expense.contant.StationsScope;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -93,17 +92,6 @@ public class ExpenseItemsConfigEntity {
|
|||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> goodsIds;
|
||||
|
||||
/**
|
||||
* 站点范围;字典代码:station_scope all -->所有站点 stations -->指定站点
|
||||
*/
|
||||
private StationsScope stationScope;
|
||||
|
||||
/**
|
||||
* 站点ids
|
||||
*/
|
||||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> stationIds;
|
||||
|
||||
/**
|
||||
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.njzscloud.common.http.HttpClientDecorator;
|
||||
import com.njzscloud.supervisory.config.AppProperties;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@Slf4j
|
||||
public class Hsoa {
|
||||
public static final HsoaApi API;
|
||||
private static final HsoaProperties hsoaProperties;
|
||||
private static final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
|
||||
private static final ReentrantReadWriteLock.ReadLock rlock = rwLock.readLock();
|
||||
private static final ReentrantReadWriteLock.WriteLock wlock = rwLock.writeLock();
|
||||
private static String refTnt = "";
|
||||
private static String tnt = "";
|
||||
private static long lastLoginTime = 0;
|
||||
private static AppProperties appProperties;
|
||||
|
||||
static {
|
||||
HttpClientDecorator httpClientDecorator = SpringUtil.getBean(HttpClientDecorator.class);
|
||||
appProperties = SpringUtil.getBean(AppProperties.class);
|
||||
API = httpClientDecorator.decorate(HsoaApi.class);
|
||||
hsoaProperties = SpringUtil.getBean(HsoaProperties.class);
|
||||
}
|
||||
|
||||
public static HsoaResult<?> pushVehicleTrajectory(PushVehicleTrajectoryParam param) {
|
||||
login();
|
||||
try {
|
||||
rlock.lock();
|
||||
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
|
||||
param.setCityCode(defaultPlace.getCity())
|
||||
.setCityName(defaultPlace.getCityName())
|
||||
;
|
||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
||||
return new HsoaResult<>()
|
||||
.setSuccess(false);
|
||||
}
|
||||
return API.pushVehicleTrajectory(param, new TokenParam().setTnt(tnt).setRefTnt(refTnt));
|
||||
} finally {
|
||||
rlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void login() {
|
||||
try {
|
||||
wlock.lock();
|
||||
long now = System.currentTimeMillis() / 1000;
|
||||
if (StrUtil.isBlank(refTnt) || StrUtil.isBlank(tnt)) {
|
||||
HsoaResult<LoginResult> loginResult = API.login(new LoginParam()
|
||||
.setUserName(hsoaProperties.getUsername())
|
||||
.setPassword(hsoaProperties.getPassword())
|
||||
);
|
||||
if (loginResult.isSuccess()) {
|
||||
LoginResult data = loginResult.getData();
|
||||
refTnt = data.getRefTnt();
|
||||
tnt = data.getTnt();
|
||||
lastLoginTime = now;
|
||||
} else {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败");
|
||||
}
|
||||
} else if (now - lastLoginTime > hsoaProperties.getExpire() - 60) {
|
||||
HsoaResult<LoginResult> loginResult = API.refreshToken(new RefreshTokenParam().setRefTnt(refTnt));
|
||||
if (loginResult.isSuccess()) {
|
||||
LoginResult data = loginResult.getData();
|
||||
refTnt = data.getRefTnt();
|
||||
tnt = data.getTnt();
|
||||
lastLoginTime = now;
|
||||
} else {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败", e);
|
||||
} finally {
|
||||
wlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void relogin() {
|
||||
try {
|
||||
wlock.lock();
|
||||
log.info("重置登录TOKEN");
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
login();
|
||||
} finally {
|
||||
wlock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import com.njzscloud.common.http.annotation.*;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
|
||||
@RemoteServer(value = "${hsoa.base-url}")
|
||||
public interface HsoaApi {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
@PostEndpoint("/garbage/mLoginApi/login")
|
||||
HsoaResult<LoginResult> login(@FormBodyParam LoginParam apram);
|
||||
|
||||
/**
|
||||
* 刷新 TOKEN
|
||||
*/
|
||||
@GetEndpoint("/garbage/mLoginApi/refreshToken")
|
||||
HsoaResult<LoginResult> refreshToken(@QueryParam RefreshTokenParam apram);
|
||||
|
||||
/**
|
||||
* 发送定位数据
|
||||
*/
|
||||
@PostEndpoint("/garbage/commonApi/pushVehicleTrajectory")
|
||||
HsoaResult<Object> pushVehicleTrajectory(@JsonBodyParam PushVehicleTrajectoryParam apram, @QueryParam TokenParam tokenParam);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@ConfigurationProperties(prefix = "hsoa")
|
||||
public class HsoaProperties {
|
||||
private String baseUrl;
|
||||
private String username;
|
||||
private String password;
|
||||
private int expire = 3 * 3600;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.service.HsoaService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hsoa")
|
||||
public class HsoaController {
|
||||
|
||||
private final HsoaService hsoaService;
|
||||
|
||||
@PostMapping("/push")
|
||||
public R<?> push(@RequestBody PushVehicleTrajectoryParam pushVehicleTrajectoryParam) {
|
||||
HsoaResult<?> objectHsoaResult = Hsoa.pushVehicleTrajectory(pushVehicleTrajectoryParam);
|
||||
if (objectHsoaResult.isSuccess()) {
|
||||
return R.success(objectHsoaResult);
|
||||
}
|
||||
return R.failed();
|
||||
}
|
||||
|
||||
@GetMapping("/push_order")
|
||||
public R<?> pushOrder(@RequestParam Long orderId, @RequestParam Integer count) {
|
||||
return R.success(hsoaService.pushOrder(orderId, count));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class LoginParam {
|
||||
private String userName;
|
||||
private String password;
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class PushVehicleTrajectoryParam {
|
||||
@JsonProperty("cityCode")
|
||||
private String cityCode;
|
||||
@JsonProperty("cityName")
|
||||
private String cityName;
|
||||
@JsonProperty("districtCode")
|
||||
private String districtCode;
|
||||
@JsonProperty("districtName")
|
||||
private String districtName;
|
||||
@JsonProperty("companyName")
|
||||
private String companyName;
|
||||
@JsonProperty("transportLicense")
|
||||
private String transportLicense;
|
||||
@JsonProperty("plateNumber")
|
||||
private String plateNumber;
|
||||
@JsonProperty("vehicleType")
|
||||
private String vehicleType;
|
||||
@JsonProperty("longitude")
|
||||
private String longitude;
|
||||
@JsonProperty("latitude")
|
||||
private String latitude;
|
||||
@JsonProperty("speed")
|
||||
private Double speed;
|
||||
@JsonProperty("loadWeight")
|
||||
private Double loadWeight;
|
||||
@JsonProperty("loadStatus")
|
||||
private String loadStatus;
|
||||
@JsonProperty("sealedStatus")
|
||||
private String sealedStatus;
|
||||
@JsonProperty("liftStatus")
|
||||
private String liftStatus;
|
||||
@JsonProperty("direction")
|
||||
private Double direction;
|
||||
@JsonProperty("directionDesc")
|
||||
private String directionDesc;
|
||||
@JsonProperty("altitude")
|
||||
private Double altitude;
|
||||
@JsonProperty("locationDesc")
|
||||
private String locationDesc;
|
||||
@JsonProperty("address")
|
||||
private String address;
|
||||
@JsonProperty("gpsTime")
|
||||
private String gpsTime;
|
||||
@JsonProperty("receiveTime")
|
||||
private String receiveTime;
|
||||
@JsonProperty("accStatus")
|
||||
private Integer accStatus;
|
||||
@JsonProperty("onlineStatus")
|
||||
private Integer onlineStatus;
|
||||
@JsonProperty("locationMode")
|
||||
private String locationMode;
|
||||
@JsonProperty("stateType")
|
||||
private String stateType;
|
||||
@JsonProperty("alarmType")
|
||||
private String alarmType;
|
||||
@JsonProperty("alarmDesc")
|
||||
private String alarmDesc;
|
||||
@JsonProperty("todayMileage")
|
||||
private Double todayMileage;
|
||||
@JsonProperty("totalMileage")
|
||||
private Double totalMileage;
|
||||
@JsonProperty("temperature")
|
||||
private String temperature;
|
||||
@JsonProperty("humidity")
|
||||
private String humidity;
|
||||
@JsonProperty("oilValue")
|
||||
private String oilValue;
|
||||
@JsonProperty("voltage")
|
||||
private String voltage;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
import com.njzscloud.common.http.annotation.QueryParam;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class RefreshTokenParam {
|
||||
@QueryParam("REF_TNT")
|
||||
private String refTnt;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
import com.njzscloud.common.http.annotation.QueryParam;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class TokenParam {
|
||||
@QueryParam("REF_TNT")
|
||||
private String refTnt;
|
||||
@QueryParam("TNT")
|
||||
private String tnt;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class HsoaResult<T> {
|
||||
private String message;
|
||||
private Integer code;
|
||||
private boolean success;
|
||||
private T data;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.result;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class LoginResult {
|
||||
@JsonProperty("REF_TNT")
|
||||
private String refTnt;
|
||||
@JsonProperty("TNT")
|
||||
private String tnt;
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.TruckLocationTrackEntity;
|
||||
import com.njzscloud.supervisory.biz.service.TruckLocationTrackService;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class HsoaService {
|
||||
private final OrderInfoService orderInfoService;
|
||||
private final TruckLocationTrackService truckLocationTrackService;
|
||||
private final AtomicBoolean run = new AtomicBoolean(false);
|
||||
private final AtomicInteger succ = new AtomicInteger(0);
|
||||
private final AtomicInteger fail = new AtomicInteger(0);
|
||||
private final AtomicInteger total = new AtomicInteger(0);
|
||||
private final AtomicLong order = new AtomicLong(0);
|
||||
|
||||
public synchronized Map<String, Object> pushOrder(Long orderId, Integer count) {
|
||||
MapBuilder<String, Object> builder = MapUtil.<String, Object>builder();
|
||||
|
||||
if (run.get()) {
|
||||
int i1 = total.get();
|
||||
int i2 = succ.get();
|
||||
int i3 = fail.get();
|
||||
long v = order.get();
|
||||
return builder
|
||||
.put("订单", v)
|
||||
.put("任务数量", i1)
|
||||
.put("成功数量", i2)
|
||||
.put("失败数量", i3)
|
||||
.put("剩余数量", i1 - i2 - i3)
|
||||
.build();
|
||||
}
|
||||
OrderPagingResult orderDetail = orderInfoService.detail(orderId);
|
||||
Assert.notNull(orderDetail, () -> Exceptions.clierr("订单不存在"));
|
||||
String licensePlate = orderDetail.getLicensePlate();
|
||||
String transCompanyName = orderDetail.getTransCompanyName();
|
||||
List<TruckLocationTrackEntity> list = truckLocationTrackService.list(Wrappers.<TruckLocationTrackEntity>lambdaQuery().eq(TruckLocationTrackEntity::getOrderId, orderId));
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return builder
|
||||
.put("订单", orderId)
|
||||
.put("任务数量", 0)
|
||||
.build();
|
||||
}
|
||||
if (count == null || count == 0) {
|
||||
count = list.size();
|
||||
} else {
|
||||
count = Math.min(count, list.size());
|
||||
}
|
||||
run.set(true);
|
||||
order.set(orderId);
|
||||
total.set(count);
|
||||
succ.set(0);
|
||||
fail.set(0);
|
||||
int c = count;
|
||||
Thread thread = new Thread(() -> {
|
||||
for (int i = 0; i < c; i++) {
|
||||
ThreadUtil.sleep(1000);
|
||||
TruckLocationTrackEntity locationTrack = list.get(i);
|
||||
boolean b = run.get();
|
||||
if (!b) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Double longitude = locationTrack.getLongitude();
|
||||
Double latitude = locationTrack.getLatitude();
|
||||
Double speed = locationTrack.getSpeed();
|
||||
Integer direction = locationTrack.getDirection();
|
||||
LocalDateTime locationTime = locationTrack.getLocationTime();
|
||||
String time = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(locationTime);
|
||||
HsoaResult<?> result = Hsoa.pushVehicleTrajectory(new PushVehicleTrajectoryParam()
|
||||
.setCompanyName(transCompanyName)
|
||||
.setTransportLicense(orderDetail.getCertificateSn())
|
||||
.setPlateNumber(licensePlate)
|
||||
.setVehicleType(orderDetail.getTruckCategory())
|
||||
.setLongitude(longitude + "")
|
||||
.setLatitude(latitude + "")
|
||||
.setSpeed(speed)
|
||||
.setDirection(direction + 0.0)
|
||||
.setStateType("正常行驶")
|
||||
.setAlarmType("无")
|
||||
.setLoadStatus("2")
|
||||
.setSealedStatus("1")
|
||||
.setLiftStatus("0")
|
||||
.setAccStatus(1)
|
||||
.setGpsTime(time)
|
||||
.setLocationMode("WGS84")
|
||||
);
|
||||
if (result == null || !result.isSuccess()) {
|
||||
fail.incrementAndGet();
|
||||
log.error("推送定位数据失败,数据Id:{}", locationTrack.getId());
|
||||
} else {
|
||||
succ.incrementAndGet();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
fail.incrementAndGet();
|
||||
log.error("推送定位数据失败,数据Id:{}", locationTrack.getId(), e);
|
||||
}
|
||||
}
|
||||
run.set(false);
|
||||
});
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
|
||||
int i1 = total.get();
|
||||
int i2 = succ.get();
|
||||
int i3 = fail.get();
|
||||
return builder
|
||||
.put("订单", orderId)
|
||||
.put("任务数量", i1)
|
||||
.put("成功数量", i2)
|
||||
.put("失败数量", i3)
|
||||
.put("剩余数量", i1 - i2 - i3)
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -36,15 +36,10 @@ public class MoneyAccountEntity {
|
|||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
* 资金
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 营收
|
||||
*/
|
||||
private BigDecimal revenue;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -109,9 +109,6 @@ public class MoneyChangeDetailEntity {
|
|||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 开始时间(用于时间范围查询)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,10 +23,7 @@ public class MoneyBillResult {
|
|||
private Long orderId;
|
||||
private BigDecimal discountMoney;
|
||||
private BigDecimal settleMoney;
|
||||
/**
|
||||
* 净重
|
||||
*/
|
||||
private Integer settleWeight;
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 开始时间(用于时间范围查询)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class MoneyBillQuartz {
|
|||
|
||||
private final MoneyBillMapper moneyBillMapper;
|
||||
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")//每1分钟一次
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")//每1分钟一次
|
||||
@Scheduled(cron = "0 0 1 27 * ?")//每月27号凌晨1点执行
|
||||
public void syncAssetsDiscover() {
|
||||
generateMoneyBill();
|
||||
|
|
@ -89,15 +89,20 @@ public class MoneyBillQuartz {
|
|||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
|
||||
// 2. 车数=订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
|
||||
// 3. 总质量
|
||||
// 2. 总质量:quantity求和,条件是计费策略不等于"车"
|
||||
int totalWeight = itemGroupResults.stream()
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.filter(result -> !MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
|
||||
// 3. 车数:quantity求和,条件是计费策略等于"车"
|
||||
int totalCars = itemGroupResults.stream()
|
||||
.filter(result -> MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setCarCount(totalCars);
|
||||
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getDiscountMoney)
|
||||
|
|
@ -116,7 +121,7 @@ public class MoneyBillQuartz {
|
|||
entity.setGoodsName(firstResult.getExpenseItemName());
|
||||
entityList.add(entity);
|
||||
log.info("生成账单实体: transCompanyId={}, originExpenseItemId={}, 订单数={}, 总质量={}, 车数={}, 优惠金额={}, 账单金额={}",
|
||||
transCompanyId, originExpenseItemId, orderCount, totalWeight, orderCount, totalDiscountMoney, totalSettleMoney);
|
||||
transCompanyId, originExpenseItemId, orderCount, totalWeight, totalCars, totalDiscountMoney, totalSettleMoney);
|
||||
}
|
||||
}
|
||||
// 账单入库
|
||||
|
|
|
|||
|
|
@ -117,14 +117,19 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
|||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
|
||||
// 2. 总质量
|
||||
// 2. 总质量:quantity求和,条件是计费策略不等于"车"
|
||||
int totalWeight = billResults.stream()
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.filter(result -> !MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
|
||||
// 3. 车数 = 订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
// 3. 车数:quantity求和,条件是计费策略等于"车"
|
||||
int totalCars = billResults.stream()
|
||||
.filter(result -> MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setCarCount(totalCars);
|
||||
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = billResults.stream()
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.contant;
|
||||
|
||||
import com.njzscloud.common.core.ienum.DictStr;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 字典代码:discount_type
|
||||
* 字典名称:优惠类型
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum DiscountType implements DictStr {
|
||||
DISCOUNT("discount", "优惠"),
|
||||
RAISE("raise", "加价"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ import com.njzscloud.supervisory.order.pojo.param.*;
|
|||
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
|
||||
import com.njzscloud.supervisory.order.service.AccountRegulationService;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import com.njzscloud.supervisory.sys.log.annotation.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -32,8 +31,6 @@ import java.util.List;
|
|||
public class OrderInfoController {
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final AccountRegulationService accountRegulationService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -261,17 +258,6 @@ public class OrderInfoController {
|
|||
orderInfoService.export(response, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
* @param orderId 订单Id
|
||||
*/
|
||||
@GetMapping("/forwarded")
|
||||
public R<?> forwarded(@RequestParam("orderId") Long orderId, @RequestParam("area") String area,
|
||||
@RequestParam("areaName") String areaName) {
|
||||
orderInfoService.forwarded(orderId, area, areaName);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 改价
|
||||
*/
|
||||
|
|
@ -282,14 +268,4 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Log("业务调账")
|
||||
@PostMapping("/account_regulation")
|
||||
public R<?> accountRegulation(@RequestBody RegulationParam param) {
|
||||
accountRegulationService.accountRegulation(param);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.PaymentContextResult;
|
||||
|
|
@ -26,8 +25,6 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
|||
|
||||
List<OrderExportResult> exportList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
List<OrderExportDetailResult> exportDetailList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult detail(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult pendingOrder(@Param("ew") QueryWrapper<Object> ew);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
|||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
||||
import com.njzscloud.supervisory.expense.contant.Scope;
|
||||
import com.njzscloud.supervisory.expense.contant.StationsScope;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -98,17 +97,6 @@ public class OrderExpenseItemsEntity {
|
|||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> goodsIds;
|
||||
|
||||
/**
|
||||
* 站点范围;字典代码:station_scope all -->所有站点 stations -->指定站点
|
||||
*/
|
||||
private StationsScope stationScope;
|
||||
|
||||
/**
|
||||
* 站点ids
|
||||
*/
|
||||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> stationIds;
|
||||
|
||||
/**
|
||||
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,6 +23,4 @@ public class OrderItemsParams {
|
|||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
private String bill;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.njzscloud.supervisory.order.pojo.param;
|
|||
|
||||
import com.njzscloud.supervisory.biz.constant.AuditStatus;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.contant.OrderViewType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -21,10 +20,6 @@ public class OrderPagingSearchParam {
|
|||
*/
|
||||
private AuditStatus auditStatus;
|
||||
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private OrderCategory orderCategory;
|
||||
/**
|
||||
* 订单状态; 字典代码:order_status
|
||||
*/
|
||||
|
|
@ -40,8 +35,6 @@ public class OrderPagingSearchParam {
|
|||
* 清运公司ID
|
||||
*/
|
||||
private Long transCompanyId;
|
||||
private String transCompanyName;
|
||||
private String driverName;
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
|
|
@ -52,7 +45,6 @@ public class OrderPagingSearchParam {
|
|||
* 订单编号
|
||||
*/
|
||||
private String sn;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 调账入参
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class RegulationParam {
|
||||
|
||||
/**
|
||||
* 清运公司Id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 订单sn
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private BigDecimal delta;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.pojo.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class OrderExportDetailResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String expenseItemName;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private BigDecimal settleMoney;
|
||||
|
||||
}
|
||||
|
|
@ -11,11 +11,6 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
public class OrderExportResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
|
|
@ -66,10 +61,6 @@ public class OrderExportResult {
|
|||
*/
|
||||
private String areaName;
|
||||
|
||||
private String townName;
|
||||
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 入场磅重(吨)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -38,15 +38,6 @@ public class OrderPagingResult {
|
|||
* 订单 Id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 对方站点 Id; 短驳单有值
|
||||
*/
|
||||
private Long targetStationId;
|
||||
|
||||
/**
|
||||
* 对方订单 Id; 短驳单有值
|
||||
*/
|
||||
private Long targetOrderId;
|
||||
/**
|
||||
* 准运证编号
|
||||
*/
|
||||
|
|
@ -478,8 +469,6 @@ public class OrderPagingResult {
|
|||
*/
|
||||
private String driverPhone;
|
||||
|
||||
private Long driverUserId;
|
||||
|
||||
/**
|
||||
* 驾驶证
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,103 +0,0 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.expense.contant.ExpenseItemCategory;
|
||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyAccountEntity;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||
import com.njzscloud.supervisory.money.service.MoneyAccountService;
|
||||
import com.njzscloud.supervisory.money.service.MoneyChangeDetailService;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderExpenseItemsEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.RegulationParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.YearMonth;
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AccountRegulationService {
|
||||
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final MoneyAccountService moneyAccountService;
|
||||
|
||||
private final MoneyChangeDetailService moneyChangeDetailService;
|
||||
|
||||
private final OrderExpenseItemsService orderExpenseItemsService;
|
||||
|
||||
/**
|
||||
* 业务调账
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void accountRegulation(RegulationParam param) {
|
||||
OrderInfoEntity order = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery()
|
||||
.eq(OrderInfoEntity::getSn, param.getSn())
|
||||
.eq(OrderInfoEntity::getTransCompanyId, param.getCompanyId()));
|
||||
Assert.notNull(order, () -> Exceptions.clierr("当前客户不存在该笔订单,请检查订单号是否正确"));
|
||||
|
||||
// 判断订单创建时间是否在上个月1号和本月26号之间
|
||||
LocalDateTime createTime = order.getCreateTime();
|
||||
if (createTime != null) {
|
||||
LocalDateTime lastMonthFirstDay = YearMonth.now().minusMonths(1).atDay(1).atStartOfDay();
|
||||
LocalDateTime currentMonth26th = YearMonth.now().atDay(26).atTime(23, 59, 59);
|
||||
boolean isInRange = !createTime.isBefore(lastMonthFirstDay) && !createTime.isAfter(currentMonth26th);
|
||||
if (!isInRange) {
|
||||
throw Exceptions.clierr("只能对上月1号至本月26号之间的订单调账");
|
||||
}
|
||||
}
|
||||
|
||||
// 新增一条付费项
|
||||
OrderExpenseItemsEntity productItem = new OrderExpenseItemsEntity()
|
||||
.setExpenseItemCategory(ExpenseItemCategory.ChanPin.getVal())
|
||||
.setOrderId(order.getId())
|
||||
.setOriginExpenseItemId(202511081532L)
|
||||
.setExpenseItemName("业务调账")
|
||||
.setUnitPrice(new BigDecimal("0"))
|
||||
.setUnit("Che")
|
||||
.setMoneyStrategy("Che")
|
||||
.setQuantity(1)
|
||||
.setTotalMoney(param.getDelta())
|
||||
.setSettleMoney(param.getDelta());
|
||||
orderExpenseItemsService.save(productItem);
|
||||
|
||||
// 查询账户
|
||||
MoneyAccountEntity accountEntity = moneyAccountService.getOne(Wrappers.<MoneyAccountEntity>lambdaQuery()
|
||||
.eq(MoneyAccountEntity::getStationId, param.getCompanyId()));
|
||||
if (null == accountEntity) {
|
||||
throw Exceptions.clierr("资金账户不存在");
|
||||
}
|
||||
BigDecimal newMoney = accountEntity.getMoney().add(param.getDelta());
|
||||
// 新增一条资金明细
|
||||
MoneyChangeDetailEntity changeDetail = new MoneyChangeDetailEntity()
|
||||
.setCompanyId(param.getCompanyId())
|
||||
.setOrderId(order.getId())
|
||||
.setMoneyAccountId(accountEntity.getId())
|
||||
.setOldMoney(accountEntity.getMoney())
|
||||
.setDelta(param.getDelta())
|
||||
.setNewMoney(newMoney)
|
||||
.setMoneyChangeCategory(MoneyChangeCategory.DingDanTiaoZhang)
|
||||
.setMemo(param.getMemo());
|
||||
|
||||
moneyChangeDetailService.save(changeDetail);
|
||||
|
||||
// 变更资金账户金额
|
||||
MoneyAccountEntity companyAccount = new MoneyAccountEntity()
|
||||
.setId(accountEntity.getId())
|
||||
.setMoney(newMoney);
|
||||
moneyAccountService.updateById(companyAccount);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -72,8 +72,6 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public long truckComing(TruckComingOrderParam truckComingOrderParam, OrderCategory orderCategory) {
|
||||
Integer weight = truckComingOrderParam.getWeight();
|
||||
Assert.isTrue(weight != null && weight > 0, () -> Exceptions.clierr("磅重错误"));
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
|
|
@ -96,27 +94,24 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer truckOut(Long carInOutId, TruckLeavingOrderParam truckLeavingOrderParam, OrderCategory orderCategory, Long truckId) {
|
||||
Integer weight = truckLeavingOrderParam.getWeight();
|
||||
Assert.isTrue(weight != null && weight > 0, () -> Exceptions.clierr("磅重错误"));
|
||||
|
||||
OrderCarInOutEntity orderCarInOutEntity = this.getById(carInOutId);
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
Integer settleWeight = null;
|
||||
/*Integer roughWeight__ = orderCarInOutEntity.getRoughWeight();
|
||||
if (roughWeight__ == null) {
|
||||
Integer roughWeight__ = orderCarInOutEntity.getRoughWeight();
|
||||
if (roughWeight__ == null) {
|
||||
BizTruckEntity bizTruckEntity = bizTruckService.getById(truckId);
|
||||
Integer truckTareWeight = bizTruckEntity.getTareWeight();
|
||||
Assert.notNull(truckTareWeight, () -> Exceptions.exception("{} 车辆暂无皮重", bizTruckEntity.getLicensePlate()));
|
||||
orderCarInOutEntity.setRoughWeight(truckTareWeight);
|
||||
roughWeight__ = truckTareWeight;
|
||||
} */
|
||||
}
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
roughWeight = weight;
|
||||
settleWeight = roughWeight - orderCarInOutEntity.getTareWeight();
|
||||
roughWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = roughWeight - roughWeight__;
|
||||
} else {
|
||||
tareWeight = weight;
|
||||
settleWeight = orderCarInOutEntity.getRoughWeight() - tareWeight;
|
||||
tareWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = roughWeight__ - tareWeight;
|
||||
}
|
||||
Integer roughWeight_ = roughWeight;
|
||||
Integer tareWeight_ = tareWeight;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,77 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/order_route")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteController {
|
||||
|
||||
private final OrderRouteService orderRouteService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderRouteEntity routeEntity) {
|
||||
orderRouteService.add(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody OrderRouteEntity routeEntity) {
|
||||
orderRouteService.modify(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
orderRouteService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<OrderRouteEntity> detail(@RequestParam Long id) {
|
||||
return R.success(orderRouteService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<OrderRouteEntity>> paging(PageParam pageParam, OrderRouteEntity routeEntity) {
|
||||
return R.success(orderRouteService.paging(pageParam, routeEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单Id查看路线详情
|
||||
*/
|
||||
@GetMapping("/getByOrderId")
|
||||
public R<OrderRouteEntity> getByOrderId(@RequestParam Long orderId) {
|
||||
return R.success(orderRouteService.getByOrderId(orderId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/order_route_detail")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteDetailController {
|
||||
|
||||
private final OrderRouteDetailService orderRouteDetailService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderRouteDetailEntity detailEntity) {
|
||||
orderRouteDetailService.add(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody OrderRouteDetailEntity detailEntity) {
|
||||
orderRouteDetailService.modify(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
orderRouteDetailService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<OrderRouteDetailEntity> detail(@RequestParam Long id) {
|
||||
return R.success(orderRouteDetailService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<OrderRouteDetailEntity>> paging(PageParam pageParam, OrderRouteDetailEntity detailEntity) {
|
||||
return R.success(orderRouteDetailService.paging(pageParam, detailEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/route")
|
||||
@RequiredArgsConstructor
|
||||
public class RouteController {
|
||||
|
||||
private final RouteService routeService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody RouteEntity routeEntity) {
|
||||
routeService.add(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody RouteEntity routeEntity) {
|
||||
routeService.modify(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
routeService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<RouteEntity> detail(@RequestParam Long id) {
|
||||
return R.success(routeService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<RouteEntity>> paging(PageParam pageParam, RouteEntity routeEntity) {
|
||||
return R.success(routeService.paging(pageParam, routeEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/route_detail")
|
||||
@RequiredArgsConstructor
|
||||
public class RouteDetailController {
|
||||
|
||||
private final RouteDetailService routeDetailService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody RouteDetailEntity detailEntity) {
|
||||
routeDetailService.add(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody RouteDetailEntity detailEntity) {
|
||||
routeDetailService.modify(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
routeDetailService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<RouteDetailEntity> detail(@RequestParam Long id) {
|
||||
return R.success(routeDetailService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<RouteDetailEntity>> paging(PageParam pageParam, RouteDetailEntity detailEntity) {
|
||||
return R.success(routeDetailService.paging(pageParam, detailEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 订单路线详情管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderRouteDetailMapper extends BaseMapper<OrderRouteDetailEntity> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderRouteMapper extends BaseMapper<OrderRouteEntity> {
|
||||
|
||||
IPage<OrderRouteEntity> paging(Page<Object> page, @Param("ew") QueryWrapper<OrderRouteEntity> ew);
|
||||
|
||||
OrderRouteEntity selectDetailById(@Param("id") Long id);
|
||||
|
||||
OrderRouteEntity getByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RouteDetailMapper extends BaseMapper<RouteDetailEntity> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RouteMapper extends BaseMapper<RouteEntity> {
|
||||
|
||||
IPage<RouteEntity> paging(Page<Object> page, @Param("ew") QueryWrapper<RouteEntity> ew);
|
||||
|
||||
RouteEntity selectDetailById(@Param("id") Long id);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单路线详情
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_route_detail", autoResultMap = true)
|
||||
public class OrderRouteDetailEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路线id
|
||||
*/
|
||||
private Long orderRouteId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_route", autoResultMap = true)
|
||||
public class OrderRouteEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单Id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 清运公司id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 起始地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startAddress;
|
||||
|
||||
/**
|
||||
* 终点地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endAddress;
|
||||
|
||||
/**
|
||||
* 路线详情
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<OrderRouteDetailEntity> detailEntityList;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "biz_route_detail", autoResultMap = true)
|
||||
public class RouteDetailEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路线id
|
||||
*/
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "biz_route", autoResultMap = true)
|
||||
public class RouteEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 清运公司id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 起始地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startAddress;
|
||||
|
||||
/**
|
||||
* 终点地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endAddress;
|
||||
|
||||
/**
|
||||
* 路线详情
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<RouteDetailEntity> detailEntityList;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线详情管理
|
||||
*/
|
||||
public interface OrderRouteDetailService extends IService<OrderRouteDetailEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(OrderRouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(OrderRouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
OrderRouteDetailEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<OrderRouteDetailEntity> paging(PageParam pageParam, OrderRouteDetailEntity detailEntity);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
public interface OrderRouteService extends IService<OrderRouteEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
OrderRouteEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<OrderRouteEntity> paging(PageParam pageParam, OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 根据订单Id查看路线详情
|
||||
*/
|
||||
OrderRouteEntity getByOrderId(Long orderId);
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue