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
|
|
||||||
|
|
@ -1,163 +0,0 @@
|
||||||
package com.njzscloud.common.core.utils;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.ex.Exceptions;
|
|
||||||
|
|
||||||
import javax.imageio.IIOImage;
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.imageio.ImageWriteParam;
|
|
||||||
import javax.imageio.ImageWriter;
|
|
||||||
import javax.imageio.stream.ImageOutputStream;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class ImgUtil {
|
|
||||||
|
|
||||||
// 最小缩放比例(防止无限缩小,可根据需求调整)
|
|
||||||
private static final double MIN_SCALE = 0.1;
|
|
||||||
// 最低质量压缩值(防止质量过低导致图片损坏)
|
|
||||||
private static final float MIN_QUALITY = 0.1f;
|
|
||||||
// 压缩衰减系数(每次递归压缩时,缩放/质量的衰减幅度)
|
|
||||||
private static final double COMPRESS_ATTENUATION = 0.8;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按质量压缩图片(返回字节流)
|
|
||||||
*/
|
|
||||||
public static ByteArrayOutputStream compressByQuality(InputStream in, float quality, String format) throws IOException {
|
|
||||||
BufferedImage bufferedImage = ImageIO.read(in);
|
|
||||||
if (bufferedImage == null) {
|
|
||||||
throw new IOException("读取图片流失败,图片格式不支持或流已关闭");
|
|
||||||
}
|
|
||||||
|
|
||||||
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(format);
|
|
||||||
if (!writers.hasNext()) {
|
|
||||||
throw new IOException("不支持的图片格式:" + format);
|
|
||||||
}
|
|
||||||
ImageWriter writer = writers.next();
|
|
||||||
|
|
||||||
ImageWriteParam param = writer.getDefaultWriteParam();
|
|
||||||
if (param.canWriteCompressed()) {
|
|
||||||
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
|
||||||
// 确保质量不低于最小值
|
|
||||||
param.setCompressionQuality(Math.max(quality, MIN_QUALITY));
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
try (ImageOutputStream ios = ImageIO.createImageOutputStream(out)) {
|
|
||||||
writer.setOutput(ios);
|
|
||||||
writer.write(null, new IIOImage(bufferedImage, null, null), param);
|
|
||||||
return out;
|
|
||||||
} finally {
|
|
||||||
writer.dispose();
|
|
||||||
// 关闭输入流,避免内存泄漏
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按尺寸缩放图片(返回字节流)
|
|
||||||
*/
|
|
||||||
public static ByteArrayOutputStream compressByScale(InputStream in, double scale, String format) throws IOException {
|
|
||||||
BufferedImage srcImage = ImageIO.read(in);
|
|
||||||
if (srcImage == null) {
|
|
||||||
throw new IOException("读取图片流失败,图片格式不支持或流已关闭");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 确保缩放比例不低于最小值
|
|
||||||
double actualScale = Math.max(scale, MIN_SCALE);
|
|
||||||
int newWidth = Math.max(1, (int) (srcImage.getWidth() * actualScale));
|
|
||||||
int newHeight = Math.max(1, (int) (srcImage.getHeight() * actualScale));
|
|
||||||
|
|
||||||
BufferedImage destImage = new BufferedImage(newWidth, newHeight, srcImage.getType());
|
|
||||||
Graphics2D g = destImage.createGraphics();
|
|
||||||
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
|
||||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
|
||||||
g.drawImage(srcImage, 0, 0, newWidth, newHeight, null);
|
|
||||||
g.dispose();
|
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
ImageIO.write(destImage, format, out);
|
|
||||||
// 关闭输入流
|
|
||||||
in.close();
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递归压缩图片:先校验大小,满足阈值直接返回;否则递归压缩直到满足阈值
|
|
||||||
*
|
|
||||||
* @param in 原始图片输入流
|
|
||||||
* @param initialScale 初始压缩比例(尺寸+质量)
|
|
||||||
* @param format 图片格式(jpg/png等)
|
|
||||||
* @param sizeThreshold 体积阈值(例如:1024*100 表示100KB)
|
|
||||||
* @return 压缩后的字节流
|
|
||||||
*/
|
|
||||||
public static ByteArrayOutputStream compress(InputStream in, double initialScale, String format, long sizeThreshold) {
|
|
||||||
try {
|
|
||||||
// ========== 核心新增:第一步先校验原始图片大小 ==========
|
|
||||||
byte[] originalBytes = readBytes(in);
|
|
||||||
// 若原始体积已满足阈值,直接返回字节流,不执行任何压缩
|
|
||||||
if (originalBytes.length <= sizeThreshold) {
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
out.write(originalBytes);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 原始体积不满足阈值,执行第一次组合压缩(质量+尺寸)
|
|
||||||
ByteArrayOutputStream qualityOut = compressByQuality(
|
|
||||||
new ByteArrayInputStream(originalBytes),
|
|
||||||
(float) initialScale,
|
|
||||||
format
|
|
||||||
);
|
|
||||||
ByteArrayOutputStream scaleOut = compressByScale(
|
|
||||||
new ByteArrayInputStream(qualityOut.toByteArray()),
|
|
||||||
initialScale,
|
|
||||||
format
|
|
||||||
);
|
|
||||||
|
|
||||||
// 校验压缩后的体积是否满足阈值
|
|
||||||
long currentSize = scaleOut.size();
|
|
||||||
if (currentSize <= sizeThreshold) {
|
|
||||||
return scaleOut; // 满足阈值,直接返回
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算下一次压缩的比例(衰减)
|
|
||||||
double nextScale = initialScale * COMPRESS_ATTENUATION;
|
|
||||||
|
|
||||||
// 边界校验:防止无限递归
|
|
||||||
if (nextScale < MIN_SCALE) {
|
|
||||||
// 已达到最小压缩比例,返回当前结果(避免图片失效)
|
|
||||||
return scaleOut;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 递归调用:使用衰减后的比例继续压缩
|
|
||||||
return compress(
|
|
||||||
new ByteArrayInputStream(scaleOut.toByteArray()),
|
|
||||||
nextScale,
|
|
||||||
format,
|
|
||||||
sizeThreshold
|
|
||||||
);
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw Exceptions.error(e, "图片压缩失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 辅助方法:读取输入流的所有字节(避免流复用导致的问题)
|
|
||||||
*/
|
|
||||||
private static byte[] readBytes(InputStream in) throws IOException {
|
|
||||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
|
||||||
byte[] temp = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((len = in.read(temp)) != -1) {
|
|
||||||
buffer.write(temp, 0, len);
|
|
||||||
}
|
|
||||||
in.close();
|
|
||||||
return buffer.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -25,9 +25,6 @@ public class CompositeInterceptor implements RequestInterceptor, ResponseInterce
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object process(RequestInfo requestInfo, ResponseInfo responseInfo, Type responseType) {
|
public Object process(RequestInfo requestInfo, ResponseInfo responseInfo, Type responseType) {
|
||||||
if (requestInfo.contentType != null && requestInfo.contentType.contains("multipart/form-data")) {
|
|
||||||
log.info("响应拦截器: {}、{}、{}", Jackson.toJsonStr(requestInfo), new String(responseInfo.body), responseType);
|
|
||||||
}
|
|
||||||
log.info("响应拦截器: {}、{}、{}", Jackson.toJsonStr(requestInfo), new String(responseInfo.body), responseType);
|
log.info("响应拦截器: {}、{}、{}", Jackson.toJsonStr(requestInfo), new String(responseInfo.body), responseType);
|
||||||
Object data = null;
|
Object data = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@ package com.njzscloud.common.localizer;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.njzscloud.common.localizer.contant.LocalizerType;
|
import com.njzscloud.common.localizer.contant.LocalizerType;
|
||||||
import com.njzscloud.common.mqtt.util.Mqtt;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
|
|
@ -18,10 +19,10 @@ public class DeviceStore {
|
||||||
private static final Lock localizersReadLock = localizersLock.readLock();
|
private static final Lock localizersReadLock = localizersLock.readLock();
|
||||||
|
|
||||||
public static void init() {
|
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();
|
localizersWriteLock.lock();
|
||||||
try {
|
try {
|
||||||
log.info("重新加载设备:{}", list.size());
|
log.info("重新加载设备:{}", list.size());
|
||||||
|
|
@ -60,4 +61,8 @@ public class DeviceStore {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Collection<Localizer> list() {
|
||||||
|
return CollUtil.unmodifiable(localizers);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,12 @@ public class Localizer {
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
protected String terminalId;
|
protected String terminalId;
|
||||||
|
/**
|
||||||
|
* 车牌
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private String licensePlate;
|
||||||
/**
|
/**
|
||||||
* 设备类型
|
* 设备类型
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public final class Htzj {
|
public final class Htzj {
|
||||||
private static HtzjListeners htzjListeners = new HtzjListeners();
|
private static HtzjListeners htzjListeners;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
htzjListeners = new HtzjListeners();
|
htzjListeners = new HtzjListeners();
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
@ -150,8 +151,7 @@ public final class JT808 {
|
||||||
|
|
||||||
public static JT808Message parseMessage(ByteBuf buf) {
|
public static JT808Message parseMessage(ByteBuf buf) {
|
||||||
JT808Message jt808Message = new JT808Message();
|
JT808Message jt808Message = new JT808Message();
|
||||||
|
byte[] bytes = ByteBufUtil.getBytes(buf);
|
||||||
byte[] h_b = ByteBufUtil.getBytes(buf);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. 消息ID (2字节)
|
// 1. 消息ID (2字节)
|
||||||
|
|
@ -186,22 +186,20 @@ public final class JT808 {
|
||||||
jt808Message.setMessageBody(array);
|
jt808Message.setMessageBody(array);
|
||||||
|
|
||||||
// 7. 校验码 (1字节)
|
// 7. 校验码 (1字节)
|
||||||
byte checkCode = buf.readByte();
|
jt808Message.setCheckCode(buf.readByte());
|
||||||
jt808Message.setCheckCode(checkCode);
|
|
||||||
|
|
||||||
|
// 验证校验码
|
||||||
if (jt808Message.getMessageId() == 0x704) {
|
if (!verifyCheckCode(jt808Message, buf)) {
|
||||||
log.info("报文:{}", h_b);
|
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;
|
return jt808Message;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ import lombok.Setter;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JT808协议消息实体类
|
* JT808协议消息实体类
|
||||||
* 用于存储解析后的JT808协议消息内容
|
* 用于存储解析后的JT808协议消息内容
|
||||||
|
|
@ -34,7 +31,6 @@ public class JT808Message {
|
||||||
private byte[] messageBody;
|
private byte[] messageBody;
|
||||||
// 校验码 (1字节)
|
// 校验码 (1字节)
|
||||||
private byte checkCode;
|
private byte checkCode;
|
||||||
|
|
||||||
public JT808Message() {
|
public JT808Message() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,17 +39,6 @@ public class JT808Message {
|
||||||
return messageBodyProps & 0x3FF;
|
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() {
|
public boolean isPackaged() {
|
||||||
return (messageBodyProps & 0x4000) != 0;
|
return (messageBodyProps & 0x4000) != 0;
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@ public class JT808MessageCenter {
|
||||||
|
|
||||||
Map<MessageType, Consumer<TerminalMessageBody>> m = listeners.computeIfPresent(localizerType, (k, v) -> {
|
Map<MessageType, Consumer<TerminalMessageBody>> m = listeners.computeIfPresent(localizerType, (k, v) -> {
|
||||||
MessageType messageType = MessageType.getMessageType(messageId);
|
MessageType messageType = MessageType.getMessageType(messageId);
|
||||||
if (messageType == MessageType.TerminalLocationBatchReport) {
|
|
||||||
log.info("批量上报:{}", message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (messageType == null) {
|
if (messageType == null) {
|
||||||
log.error("未找到消息类型,设备号:{},消息 Id:0x{}", terminalId, Integer.toHexString(messageId));
|
log.error("未找到消息类型,设备号:{},消息 Id:0x{}", terminalId, Integer.toHexString(messageId));
|
||||||
return v;
|
return v;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.njzscloud.common.localizer.jt808.support;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.njzscloud.common.localizer.DeviceStore;
|
import com.njzscloud.common.localizer.DeviceStore;
|
||||||
import com.njzscloud.common.localizer.Localizer;
|
import com.njzscloud.common.localizer.Localizer;
|
||||||
import com.njzscloud.common.localizer.contant.LocalizerType;
|
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.JT808;
|
||||||
import com.njzscloud.common.localizer.jt808.message.*;
|
import com.njzscloud.common.localizer.jt808.message.*;
|
||||||
import com.njzscloud.common.localizer.mqtt.result.RealtimeLocationResult;
|
import com.njzscloud.common.localizer.mqtt.result.RealtimeLocationResult;
|
||||||
|
import com.njzscloud.common.localizer.service.LocalizerService;
|
||||||
import com.njzscloud.common.mqtt.util.Mqtt;
|
import com.njzscloud.common.mqtt.util.Mqtt;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -105,9 +108,12 @@ public abstract class JT808MessageListener {
|
||||||
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf);
|
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf);
|
||||||
double speed = locationReportMsg.getSpeed();
|
double speed = locationReportMsg.getSpeed();
|
||||||
int speedThreshold = localizer.getSpeedThreshold();
|
int speedThreshold = localizer.getSpeedThreshold();
|
||||||
|
String licensePlate = localizer.getLicensePlate();
|
||||||
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
||||||
|
.setLicensePlate(licensePlate)
|
||||||
.setTerminalId(terminalId)
|
.setTerminalId(terminalId)
|
||||||
.setOverspeed(speed > speedThreshold);
|
.setOverspeed(speed > speedThreshold);
|
||||||
|
saveData(realtimeLocationResult);
|
||||||
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
||||||
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -134,26 +140,35 @@ public abstract class JT808MessageListener {
|
||||||
int speedThreshold = localizer.getSpeedThreshold();
|
int speedThreshold = localizer.getSpeedThreshold();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int length = byteBuf.readUnsignedShort();
|
int length = byteBuf.readUnsignedShort();
|
||||||
/* if (length > 28) { // 有扩展信息
|
|
||||||
|
|
||||||
} */
|
|
||||||
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf.slice(byteBuf.readerIndex(), length));
|
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf.slice(byteBuf.readerIndex(), length));
|
||||||
byteBuf.skipBytes(length);
|
byteBuf.skipBytes(length);
|
||||||
double speed = locationReportMsg.getSpeed();
|
double speed = locationReportMsg.getSpeed();
|
||||||
|
String licensePlate = localizer.getLicensePlate();
|
||||||
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
RealtimeLocationResult realtimeLocationResult = BeanUtil.copyProperties(locationReportMsg, RealtimeLocationResult.class)
|
||||||
|
.setLicensePlate(licensePlate)
|
||||||
.setTerminalId(terminalId)
|
.setTerminalId(terminalId)
|
||||||
.setOverspeed(speed > speedThreshold)
|
.setOverspeed(speed > speedThreshold)
|
||||||
.setType(type);
|
.setType(type);
|
||||||
|
saveData(realtimeLocationResult);
|
||||||
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
||||||
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("批量上报处理失败:{} {}", terminalId, message.getFlowId());
|
|
||||||
} finally {
|
} finally {
|
||||||
byteBuf.release();
|
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)
|
@Accessors(chain = true)
|
||||||
public class RealtimeLocationResult {
|
public class RealtimeLocationResult {
|
||||||
private String terminalId;
|
private String terminalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌
|
||||||
|
*/
|
||||||
|
private String licensePlate;
|
||||||
private int type;
|
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);
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
} else {
|
} else {
|
||||||
log.error("暂无权限: {}", request.getRequestURI(), accessDeniedException);
|
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);
|
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
}
|
}
|
||||||
ServletUtil.write(response, Jackson.toJsonStr(r), Mime.u8Val(Mime.JSON));
|
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) {
|
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);
|
UserDetail userDetail = SecurityUtil.parseToken(tokenStr);
|
||||||
if (userDetail == null) return null;
|
if (userDetail == null) return null;
|
||||||
Token token = userDetail.getToken();
|
Token token = userDetail.getToken();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,19 @@
|
||||||
<artifactId>njzscloud-common-core</artifactId>
|
<artifactId>njzscloud-common-core</artifactId>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>com.njzscloud</groupId>
|
<groupId>com.njzscloud</groupId>
|
||||||
<artifactId>njzscloud-common-localizer</artifactId>
|
<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:
|
mqtt:
|
||||||
enabled: true
|
enabled: true
|
||||||
broker: tcp://139.224.54.144:1883
|
broker: tcp://139.224.54.144:1883
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: localizer
|
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:
|
mqtt:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,6 @@
|
||||||
<artifactId>aspectjweaver</artifactId>
|
<artifactId>aspectjweaver</artifactId>
|
||||||
<version>1.9.7</version>
|
<version>1.9.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.volcengine</groupId>
|
|
||||||
<artifactId>volcengine-java-sdk-ark-runtime</artifactId>
|
|
||||||
<version>LATEST</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,10 @@ import com.njzscloud.supervisory.sys.log.utils.SpringBeanHolder;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableAsync
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Main.class, args);
|
SpringApplication.run(Main.class, args);
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.constant;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.ienum.DictStr;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票类型
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum InvoiceType implements DictStr {
|
|
||||||
GENERAL("GENERAL", "普票"),
|
|
||||||
EXCLUSIVE("EXCLUSIVE", "专票");
|
|
||||||
private final String val;
|
|
||||||
private final String txt;
|
|
||||||
}
|
|
||||||
|
|
@ -108,17 +108,4 @@ public class BizDriverController {
|
||||||
bizDriverService.cancel(id);
|
bizDriverService.cancel(id);
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 切换公司
|
|
||||||
*
|
|
||||||
* @param companyId Id
|
|
||||||
*/
|
|
||||||
@GetMapping("/change_company")
|
|
||||||
public R<?> changeCompany(@RequestParam Long id,
|
|
||||||
@RequestParam Long companyId
|
|
||||||
) {
|
|
||||||
bizDriverService.changeCompany(id, companyId);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.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.biz.pojo.entity.BizInvoiceEntity;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.SearchBizInvoiceParam;
|
|
||||||
import com.njzscloud.supervisory.biz.service.BizInvoiceService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票抬头管理
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/biz_invoice")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class BizInvoiceController {
|
|
||||||
|
|
||||||
private final BizInvoiceService bizInvoiceService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@PostMapping("/add")
|
|
||||||
public R<?> add(@RequestBody BizInvoiceEntity entity) {
|
|
||||||
bizInvoiceService.add(entity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@PostMapping("/modify")
|
|
||||||
public R<?> modify(@RequestBody BizInvoiceEntity entity) {
|
|
||||||
bizInvoiceService.modify(entity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@GetMapping("/remove")
|
|
||||||
public R<?> remove(@RequestParam Long id) {
|
|
||||||
bizInvoiceService.remove(id);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail")
|
|
||||||
public R<BizInvoiceEntity> detail(@RequestParam Long id) {
|
|
||||||
return R.success(bizInvoiceService.detail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/paging")
|
|
||||||
public R<PageResult<BizInvoiceEntity>> paging(PageParam pageParam, SearchBizInvoiceParam searchParam) {
|
|
||||||
return R.success(bizInvoiceService.paging(pageParam, searchParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.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.biz.pojo.entity.BizPatrolReportEntity;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.SearchBizPatrolReportParam;
|
|
||||||
import com.njzscloud.supervisory.biz.service.BizPatrolReportService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查上报
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/biz_patrol_report")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class BizPatrolReportController {
|
|
||||||
|
|
||||||
private final BizPatrolReportService bizPatrolReportService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@PostMapping("/add")
|
|
||||||
public R<?> add(@RequestBody BizPatrolReportEntity entity) {
|
|
||||||
bizPatrolReportService.add(entity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@PostMapping("/modify")
|
|
||||||
public R<?> modify(@RequestBody BizPatrolReportEntity entity) {
|
|
||||||
bizPatrolReportService.modify(entity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@GetMapping("/remove")
|
|
||||||
public R<?> remove(@RequestParam Long id) {
|
|
||||||
bizPatrolReportService.remove(id);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail")
|
|
||||||
public R<BizPatrolReportEntity> detail(@RequestParam Long id) {
|
|
||||||
return R.success(bizPatrolReportService.detail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/paging")
|
|
||||||
public R<PageResult<BizPatrolReportEntity>> paging(PageParam pageParam, SearchBizPatrolReportParam searchParam) {
|
|
||||||
return R.success(bizPatrolReportService.paging(pageParam, searchParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -115,17 +115,4 @@ public class BizTruckController {
|
||||||
bizTruckService.cancel(id);
|
bizTruckService.cancel(id);
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 切换公司
|
|
||||||
*
|
|
||||||
* @param companyId Id
|
|
||||||
*/
|
|
||||||
@GetMapping("/change_company")
|
|
||||||
public R<?> changeCompany(@RequestParam Long id,
|
|
||||||
@RequestParam Long companyId
|
|
||||||
) {
|
|
||||||
bizTruckService.changeCompany(id, companyId);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.controller;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.utils.R;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.QRCodeParam;
|
|
||||||
import com.njzscloud.supervisory.biz.service.QRCodeService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取二维码
|
|
||||||
*
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/qr")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class QRCodeController {
|
|
||||||
|
|
||||||
private final QRCodeService qrCodeService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取二维码
|
|
||||||
*/
|
|
||||||
@GetMapping("/getCode")
|
|
||||||
public R<?> getCode(QRCodeParam codeParam) {
|
|
||||||
return R.success(qrCodeService.getCode(codeParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +1,15 @@
|
||||||
package com.njzscloud.supervisory.biz.mapper;
|
package com.njzscloud.supervisory.biz.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
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.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizDriverEntity;
|
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 com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
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}")
|
@Select("SELECT id,uscc,company_name FROM biz_company WHERE id = #{companyId}")
|
||||||
SearchCompanyResult selectCompanyById(@Param("companyId") Long companyId);
|
SearchCompanyResult selectCompanyById(@Param("companyId") Long companyId);
|
||||||
|
|
||||||
List<DriverCantDelResult> driverCantDel(@Param("ew") QueryWrapper<Object> ew);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizInvoiceEntity;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票抬头管理
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface BizInvoiceMapper extends BaseMapper<BizInvoiceEntity> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizPatrolReportEntity;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查上报
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface BizPatrolReportMapper extends BaseMapper<BizPatrolReportEntity> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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.entity.BizTruckEntity;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
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.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆信息
|
* 车辆信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,6 +26,4 @@ public interface BizTruckMapper extends BaseMapper<BizTruckEntity> {
|
||||||
* 根据ID查询预警详情(包含关联信息)
|
* 根据ID查询预警详情(包含关联信息)
|
||||||
*/
|
*/
|
||||||
SearchTruckResult selectDetailById(@Param("id") Long id);
|
SearchTruckResult selectDetailById(@Param("id") Long id);
|
||||||
|
|
||||||
List<TruckCantDelResult> truckCantDel(@Param("ew") QueryWrapper<Object> ew);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ public class BizCompanyEntity {
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private Integer stationType;
|
|
||||||
/**
|
/**
|
||||||
* 归属用户
|
* 归属用户
|
||||||
*/
|
*/
|
||||||
|
|
@ -63,13 +62,11 @@ public class BizCompanyEntity {
|
||||||
/**
|
/**
|
||||||
* 营业执照有效期
|
* 营业执照有效期
|
||||||
*/
|
*/
|
||||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
|
||||||
private LocalDate licenseStartTime;
|
private LocalDate licenseStartTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 营业执照有效期
|
* 营业执照有效期
|
||||||
*/
|
*/
|
||||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
|
||||||
private LocalDate licenseEndTime;
|
private LocalDate licenseEndTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,8 @@ public class BizDriverEntity {
|
||||||
*/
|
*/
|
||||||
private String drivingLicence;
|
private String drivingLicence;
|
||||||
|
|
||||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
|
||||||
private LocalDate licenceStartTime;
|
private LocalDate licenceStartTime;
|
||||||
|
|
||||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
|
||||||
private LocalDate licenceEndTime;
|
private LocalDate licenceEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.pojo.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票抬头管理
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@TableName(value = "biz_invoice", autoResultMap = true)
|
|
||||||
public class BizInvoiceEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司名称
|
|
||||||
*/
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司ID
|
|
||||||
*/
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票类型:general 普票 exclusive 专票
|
|
||||||
*/
|
|
||||||
private InvoiceType type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一社会信用代码
|
|
||||||
*/
|
|
||||||
private String uscc;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开户银行
|
|
||||||
*/
|
|
||||||
private String bank;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开户账号
|
|
||||||
*/
|
|
||||||
private String accountNum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册地址
|
|
||||||
*/
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
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,90 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.pojo.entity;
|
|
||||||
|
|
||||||
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.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查上报
|
|
||||||
*
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@TableName(value = "biz_patrol_report", autoResultMap = true)
|
|
||||||
public class BizPatrolReportEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详细地址
|
|
||||||
*/
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上报时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime reportTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查照片
|
|
||||||
*/
|
|
||||||
@TableField(typeHandler = JsonTypeHandler.class)
|
|
||||||
private List<String> picture;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -41,7 +41,6 @@ public class ModifyBizCompanyParam {
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
private Integer stationType;
|
|
||||||
/**
|
/**
|
||||||
* 业务对象; 字典代码:biz_obj
|
* 业务对象; 字典代码:biz_obj
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.pojo.param;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class QRCodeParam {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二维码宽度
|
|
||||||
*/
|
|
||||||
private Integer width;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二维码高度
|
|
||||||
*/
|
|
||||||
private Integer height;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二维码图片类型,jpg 或 png
|
|
||||||
*/
|
|
||||||
private String imgType;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.pojo.param;
|
|
||||||
|
|
||||||
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票抬头管理查询参数
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class SearchBizInvoiceParam {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司名称
|
|
||||||
*/
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票类型:general 普票 exclusive 专票
|
|
||||||
*/
|
|
||||||
private InvoiceType type;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.pojo.param;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查上报查询参数
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class SearchBizPatrolReportParam {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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 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.bean.BeanUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.map.MapUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
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.AddDriverParam;
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.AuditDriverParam;
|
import com.njzscloud.supervisory.biz.pojo.param.AuditDriverParam;
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.ModifyDriverParam;
|
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.biz.pojo.result.SearchCompanyResult;
|
||||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||||
import com.njzscloud.supervisory.sys.user.pojo.param.AddUserAccountParam;
|
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.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 司机信息
|
* 司机信息
|
||||||
|
|
@ -104,18 +101,6 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void del(List<Long> ids) {
|
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);
|
this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,11 +208,4 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
||||||
.eq(BizDriverEntity::getId, id)
|
.eq(BizDriverEntity::getId, id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeCompany(Long id, Long companyId) {
|
|
||||||
this.updateById(new BizDriverEntity()
|
|
||||||
.setId(id)
|
|
||||||
.setCompanyId(companyId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.service;
|
|
||||||
|
|
||||||
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.core.ex.Exceptions;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
|
||||||
import com.njzscloud.supervisory.biz.mapper.BizInvoiceMapper;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizInvoiceEntity;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.SearchBizInvoiceParam;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票抬头管理
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class BizInvoiceService extends ServiceImpl<BizInvoiceMapper, BizInvoiceEntity> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param bizInvoiceEntity 数据
|
|
||||||
*/
|
|
||||||
public void add(BizInvoiceEntity bizInvoiceEntity) {
|
|
||||||
this.save(bizInvoiceEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*
|
|
||||||
* @param bizInvoiceEntity 数据
|
|
||||||
*/
|
|
||||||
public void modify(BizInvoiceEntity bizInvoiceEntity) {
|
|
||||||
Long id = bizInvoiceEntity.getId();
|
|
||||||
BizInvoiceEntity oldData = getById(id);
|
|
||||||
if (oldData == null) {
|
|
||||||
throw Exceptions.exception("未找到要修改的数据");
|
|
||||||
}
|
|
||||||
this.updateById(bizInvoiceEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*
|
|
||||||
* @param id Id
|
|
||||||
*/
|
|
||||||
public void remove(Long id) {
|
|
||||||
BizInvoiceEntity oldData = getById(id);
|
|
||||||
if (oldData == null) {
|
|
||||||
throw Exceptions.exception("未找到要删除的数据");
|
|
||||||
}
|
|
||||||
this.removeById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*
|
|
||||||
* @param id Id
|
|
||||||
* @return BizInvoiceEntity 结果
|
|
||||||
*/
|
|
||||||
public BizInvoiceEntity detail(Long id) {
|
|
||||||
BizInvoiceEntity bizInvoiceEntity = this.getById(id);
|
|
||||||
if (bizInvoiceEntity == null) {
|
|
||||||
throw Exceptions.exception("数据不存在");
|
|
||||||
}
|
|
||||||
return bizInvoiceEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param pageParam 分页参数
|
|
||||||
* @param searchParam 查询参数
|
|
||||||
* @return PageResult<BizInvoiceEntity> 分页结果
|
|
||||||
*/
|
|
||||||
public PageResult<BizInvoiceEntity> paging(PageParam pageParam, SearchBizInvoiceParam searchParam) {
|
|
||||||
String contact = searchParam.getContact();
|
|
||||||
String companyName = searchParam.getCompanyName();
|
|
||||||
String phone = searchParam.getPhone();
|
|
||||||
InvoiceType type = searchParam.getType();
|
|
||||||
|
|
||||||
Page<BizInvoiceEntity> page = this.page(pageParam.toPage(), Wrappers.<BizInvoiceEntity>lambdaQuery()
|
|
||||||
.like(StrUtil.isNotBlank(contact), BizInvoiceEntity::getContact, contact)
|
|
||||||
.like(StrUtil.isNotBlank(companyName), BizInvoiceEntity::getCompanyName, companyName)
|
|
||||||
.like(StrUtil.isNotBlank(phone), BizInvoiceEntity::getPhone, phone)
|
|
||||||
.eq(type != null, BizInvoiceEntity::getType, type)
|
|
||||||
.orderByDesc(BizInvoiceEntity::getCreateTime));
|
|
||||||
return PageResult.of(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.service;
|
|
||||||
|
|
||||||
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.core.ex.Exceptions;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.biz.mapper.BizPatrolReportMapper;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizPatrolReportEntity;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.SearchBizPatrolReportParam;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡查上报
|
|
||||||
*
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class BizPatrolReportService extends ServiceImpl<BizPatrolReportMapper, BizPatrolReportEntity> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param bizPatrolReportEntity 数据
|
|
||||||
*/
|
|
||||||
public void add(BizPatrolReportEntity bizPatrolReportEntity) {
|
|
||||||
this.save(bizPatrolReportEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*
|
|
||||||
* @param bizPatrolReportEntity 数据
|
|
||||||
*/
|
|
||||||
public void modify(BizPatrolReportEntity bizPatrolReportEntity) {
|
|
||||||
Long id = bizPatrolReportEntity.getId();
|
|
||||||
BizPatrolReportEntity oldData = getById(id);
|
|
||||||
if (oldData == null) {
|
|
||||||
throw Exceptions.exception("未找到要修改的数据");
|
|
||||||
}
|
|
||||||
this.updateById(bizPatrolReportEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*
|
|
||||||
* @param id Id
|
|
||||||
*/
|
|
||||||
public void remove(Long id) {
|
|
||||||
BizPatrolReportEntity oldData = getById(id);
|
|
||||||
if (oldData == null) {
|
|
||||||
throw Exceptions.exception("未找到要删除的数据");
|
|
||||||
}
|
|
||||||
this.removeById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*
|
|
||||||
* @param id Id
|
|
||||||
* @return BizPatrolReportEntity 结果
|
|
||||||
*/
|
|
||||||
public BizPatrolReportEntity detail(Long id) {
|
|
||||||
BizPatrolReportEntity bizPatrolReportEntity = this.getById(id);
|
|
||||||
if (bizPatrolReportEntity == null) {
|
|
||||||
throw Exceptions.exception("数据不存在");
|
|
||||||
}
|
|
||||||
return bizPatrolReportEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param pageParam 分页参数
|
|
||||||
* @param searchParam 查询参数
|
|
||||||
* @return PageResult<BizPatrolReportEntity> 分页结果
|
|
||||||
*/
|
|
||||||
public PageResult<BizPatrolReportEntity> paging(PageParam pageParam, SearchBizPatrolReportParam searchParam) {
|
|
||||||
String contact = searchParam.getContact();
|
|
||||||
String phone = searchParam.getPhone();
|
|
||||||
|
|
||||||
Page<BizPatrolReportEntity> page = this.page(pageParam.toPage(), Wrappers.<BizPatrolReportEntity>lambdaQuery()
|
|
||||||
.like(StrUtil.isNotBlank(contact), BizPatrolReportEntity::getContact, contact)
|
|
||||||
.like(StrUtil.isNotBlank(phone), BizPatrolReportEntity::getPhone, phone)
|
|
||||||
.orderByDesc(BizPatrolReportEntity::getCreateTime));
|
|
||||||
return PageResult.of(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.njzscloud.supervisory.biz.service;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.map.MapUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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.param.SearchTruckParam;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
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.pojo.entity.DeviceLocalizerEntity;
|
||||||
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
|
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
|
||||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||||
|
|
@ -31,6 +29,7 @@ import com.njzscloud.supervisory.sys.dict.pojo.DictItemEntity;
|
||||||
import com.njzscloud.supervisory.sys.dict.service.DictItemService;
|
import com.njzscloud.supervisory.sys.dict.service.DictItemService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -45,7 +44,8 @@ import java.util.stream.Collectors;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity> implements IService<BizTruckEntity> {
|
public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity> implements IService<BizTruckEntity> {
|
||||||
private final DeviceLocalizerService deviceLocalizerService;
|
private final DeviceLocalizerService deviceLocalizerService;
|
||||||
private final DictItemService dictItemService;
|
@Autowired
|
||||||
|
private DictItemService dictItemService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
|
|
@ -73,7 +73,7 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*
|
*
|
||||||
* @param modifyBizTruckParam 数据
|
* @param bizTruckEntity 数据
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void modify(ModifyBizTruckParam modifyBizTruckParam) {
|
public void modify(ModifyBizTruckParam modifyBizTruckParam) {
|
||||||
|
|
@ -104,16 +104,6 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void del(List<Long> ids) {
|
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);
|
this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,11 +219,4 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
||||||
.eq(BizTruckEntity::getId, id)
|
.eq(BizTruckEntity::getId, id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeCompany(Long id, Long companyId) {
|
|
||||||
this.updateById(new BizTruckEntity()
|
|
||||||
.setId(id)
|
|
||||||
.setCompanyId(companyId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package com.njzscloud.supervisory.biz.service;
|
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.img.ImgUtil;
|
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
||||||
import cn.hutool.extra.qrcode.QrConfig;
|
|
||||||
import com.njzscloud.supervisory.biz.pojo.param.QRCodeParam;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取二维码
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class QRCodeService {
|
|
||||||
|
|
||||||
public String getCode(QRCodeParam codeParam) {
|
|
||||||
Integer width = codeParam.getWidth();
|
|
||||||
Integer height = codeParam.getHeight();
|
|
||||||
if (width == null) {
|
|
||||||
width = 300;
|
|
||||||
}
|
|
||||||
if (height == null) {
|
|
||||||
height = 300;
|
|
||||||
}
|
|
||||||
String imgType = codeParam.getImgType();
|
|
||||||
if (imgType == null) {
|
|
||||||
imgType = ImgUtil.IMAGE_TYPE_JPG;
|
|
||||||
}
|
|
||||||
|
|
||||||
return QrCodeUtil.generateAsBase64(codeParam.getContent(), new QrConfig(width, height), imgType);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -575,7 +575,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
||||||
|
|
||||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||||
if (records.isEmpty()) {
|
if (records.isEmpty()) {
|
||||||
if (errCount >= 300) {
|
if (errCount >= 200) {
|
||||||
log.error("暂无实时数据, 订单ID: {}, 时间: {}", orderId, startTime);
|
log.error("暂无实时数据, 订单ID: {}, 时间: {}", orderId, startTime);
|
||||||
Websocket.publish(new WsMsg()
|
Websocket.publish(new WsMsg()
|
||||||
.setEvent("down/truck_location_track/realtime")
|
.setEvent("down/truck_location_track/realtime")
|
||||||
|
|
@ -585,10 +585,11 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
errCount++;
|
errCount++;
|
||||||
if (!ThreadUtil.sleep(1000)) {
|
if (!ThreadUtil.sleep(300)) {
|
||||||
log.info("任务被取消");
|
log.info("任务被取消");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
startTime = LocalDateTime.now();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,15 +64,4 @@ public interface SupervisionStatisticsMapper {
|
||||||
|
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
List<Map<String, Object>> dataTable();
|
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();
|
CarSummary carSummary = supervisionStatisticsMapper.getCarSummary();
|
||||||
Integer todayCarCount = supervisionStatisticsMapper.getTodayCarCount();
|
Integer todayCarCount = supervisionStatisticsMapper.getTodayCarCount();
|
||||||
Integer totalCarCount = supervisionStatisticsMapper.getTotalCarCount();
|
|
||||||
List<RegionSummary> regionSummary = supervisionStatisticsMapper.getRegionSummary();
|
List<RegionSummary> regionSummary = supervisionStatisticsMapper.getRegionSummary();
|
||||||
List<CompanySummary> companySummary = supervisionStatisticsMapper.getCompanySummary();
|
List<CompanySummary> companySummary = supervisionStatisticsMapper.getCompanySummary();
|
||||||
List<StationInfo> stationInfo = supervisionStatisticsMapper.getStationInfo();
|
List<StationInfo> stationInfo = supervisionStatisticsMapper.getStationInfo();
|
||||||
List<Order> orders = supervisionStatisticsMapper.getOrders();
|
List<Order> orders = supervisionStatisticsMapper.getOrders();
|
||||||
List<Project> projects = supervisionStatisticsMapper.getProjects();
|
List<Project> projects = supervisionStatisticsMapper.getProjects();
|
||||||
List<Map<String, Object>> kehu = supervisionStatisticsMapper.getKehuList();
|
|
||||||
|
|
||||||
return MapUtil.<String, Object>builder()
|
return MapUtil.<String, Object>builder()
|
||||||
.put("dispatchSummary", dispatchSummary == null ? new DispatchSummary() : dispatchSummary)
|
.put("dispatchSummary", dispatchSummary == null ? new DispatchSummary() : dispatchSummary)
|
||||||
|
|
@ -61,13 +59,11 @@ public class SupervisionStatisticsService {
|
||||||
.put("disposeTotalWeight", disposeTotalWeight == null ? 0 : disposeTotalWeight)
|
.put("disposeTotalWeight", disposeTotalWeight == null ? 0 : disposeTotalWeight)
|
||||||
.put("carSummary", carSummary == null ? new CarSummary() : carSummary)
|
.put("carSummary", carSummary == null ? new CarSummary() : carSummary)
|
||||||
.put("todayCarCount", todayCarCount == null ? 0 : todayCarCount)
|
.put("todayCarCount", todayCarCount == null ? 0 : todayCarCount)
|
||||||
.put("totalCarCount", totalCarCount == null ? 0 : totalCarCount)
|
|
||||||
.put("regionSummary", regionSummary == null ? new ArrayList<>() : regionSummary)
|
.put("regionSummary", regionSummary == null ? new ArrayList<>() : regionSummary)
|
||||||
.put("companySummary", companySummary == null ? new ArrayList<>() : companySummary)
|
.put("companySummary", companySummary == null ? new ArrayList<>() : companySummary)
|
||||||
.put("stationInfo", stationInfo == null ? new ArrayList<>() : stationInfo)
|
.put("stationInfo", stationInfo == null ? new ArrayList<>() : stationInfo)
|
||||||
.put("orders", orders == null ? new ArrayList<>() : orders)
|
.put("orders", orders == null ? new ArrayList<>() : orders)
|
||||||
.put("projects", projects == null ? new ArrayList<>() : projects)
|
.put("projects", projects == null ? new ArrayList<>() : projects)
|
||||||
.put("kehu", kehu == null ? new ArrayList<>() : kehu)
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,23 +92,12 @@ public class SupervisionStatisticsService {
|
||||||
double warnRate = todayTotalCount == 0 ? 0 : todayWarnCount / todayTotalCount * 100;
|
double warnRate = todayTotalCount == 0 ? 0 : todayWarnCount / todayTotalCount * 100;
|
||||||
double incWarnRate = yesterdayWarnCount == 0 ? 0 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 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("dayRate", NumberUtil.decimalFormat("#.##", dayRate));
|
||||||
dataStatistics.put("monthRate", NumberUtil.decimalFormat("#.##", monthRate));
|
dataStatistics.put("monthRate", NumberUtil.decimalFormat("#.##", monthRate));
|
||||||
dataStatistics.put("finishRate", NumberUtil.decimalFormat("#.##", todayFinishRate));
|
dataStatistics.put("finishRate", NumberUtil.decimalFormat("#.##", todayFinishRate));
|
||||||
dataStatistics.put("incFinishRate", NumberUtil.decimalFormat("#.##", incFinishRate));
|
dataStatistics.put("incFinishRate", NumberUtil.decimalFormat("#.##", incFinishRate));
|
||||||
dataStatistics.put("warnRate", NumberUtil.decimalFormat("#.##", warnRate));
|
dataStatistics.put("warnRate", NumberUtil.decimalFormat("#.##", warnRate));
|
||||||
dataStatistics.put("incWarnRate", NumberUtil.decimalFormat("#.##", incWarnRate));
|
dataStatistics.put("incWarnRate", NumberUtil.decimalFormat("#.##", incWarnRate));
|
||||||
dataStatistics.put("incDayCountRate", NumberUtil.decimalFormat("#.##", incDayCountRate));
|
|
||||||
dataStatistics.put("incMonthCountRate", NumberUtil.decimalFormat("#.##", incMonthCountRate));
|
|
||||||
return dataStatistics;
|
return dataStatistics;
|
||||||
})
|
})
|
||||||
.exceptionally(ex -> {
|
.exceptionally(ex -> {
|
||||||
|
|
@ -254,16 +239,6 @@ public class SupervisionStatisticsService {
|
||||||
log.error("数据获取失败", ex);
|
log.error("数据获取失败", ex);
|
||||||
return Collections.emptyList();
|
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 {
|
try {
|
||||||
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
||||||
|
|
@ -278,8 +253,6 @@ public class SupervisionStatisticsService {
|
||||||
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
||||||
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
||||||
List<Map<String, Object>> dataTable = dataTableFuture.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()
|
return MapUtil.<String, Object>builder()
|
||||||
.put("dataStatistics", dataStatistics)
|
.put("dataStatistics", dataStatistics)
|
||||||
.put("warnTruck", warnTruck)
|
.put("warnTruck", warnTruck)
|
||||||
|
|
@ -293,8 +266,6 @@ public class SupervisionStatisticsService {
|
||||||
.put("userStatistics", userStatistics)
|
.put("userStatistics", userStatistics)
|
||||||
.put("weightStatistics", weightStatistics)
|
.put("weightStatistics", weightStatistics)
|
||||||
.put("dataTable", dataTable)
|
.put("dataTable", dataTable)
|
||||||
.put("todayAuditPassStatistics", todayAuditPassStatistics)
|
|
||||||
.put("stationStatistics", stationStatistics)
|
|
||||||
.build();
|
.build();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw Exceptions.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 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 SearchCompanyResult company;
|
||||||
|
|
||||||
private String settlementWay;
|
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.CheckStatus;
|
||||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||||
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
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.OrderCarInOutEntity;
|
||||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||||
|
|
@ -438,10 +437,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
log.info("进道闸转出道闸,订单号:{}", orderInfoSn);
|
log.info("进道闸转出道闸,订单号:{}", orderInfoSn);
|
||||||
if (orderInfo.getCheckStatus() == CheckStatus.WeiKanLiao) {
|
|
||||||
// 播语音
|
|
||||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
|
||||||
}
|
|
||||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||||
.setOrderId(orderId)
|
.setOrderId(orderId)
|
||||||
.setWeight(weight)
|
.setWeight(weight)
|
||||||
|
|
@ -475,14 +470,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
||||||
BigDecimal weight_ = new BigDecimal(weight);
|
BigDecimal weight_ = new BigDecimal(weight);
|
||||||
BigDecimal v = weight_.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP);
|
BigDecimal v = weight_.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP);
|
||||||
try {
|
try {
|
||||||
String settlementWay = orderPagingResult.getSettlementWay();
|
|
||||||
if (SettlementWay.CASH.getTxt().equals(settlementWay)) {
|
|
||||||
playVoice(sn, cid, "{}请先支付", licensePlate);
|
|
||||||
}
|
|
||||||
if (orderInfo.getCheckStatus() == CheckStatus.WeiKanLiao) {
|
|
||||||
// 播语音
|
|
||||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
|
||||||
}
|
|
||||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||||
.setOrderId(orderId)
|
.setOrderId(orderId)
|
||||||
.setWeight(weight)
|
.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -15,7 +15,6 @@ public enum ExpenseItemCategory implements DictStr {
|
||||||
ChanPin("ChanPin", "产品"),
|
ChanPin("ChanPin", "产品"),
|
||||||
QingYunFuWuFei("QingYunFuWuFei", "清运服务费"),
|
QingYunFuWuFei("QingYunFuWuFei", "清运服务费"),
|
||||||
YunFei("YunFei", "运费"),
|
YunFei("YunFei", "运费"),
|
||||||
ZhongZhuanYunYingFei("ZhongZhuanYunYingFei", "中转运营费"),
|
|
||||||
;
|
;
|
||||||
private final String val;
|
private final String val;
|
||||||
private final String txt;
|
private final String txt;
|
||||||
|
|
|
||||||
|
|
@ -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.biz.constant.BizObj;
|
||||||
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
||||||
import com.njzscloud.supervisory.expense.contant.Scope;
|
import com.njzscloud.supervisory.expense.contant.Scope;
|
||||||
import com.njzscloud.supervisory.expense.contant.StationsScope;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -93,17 +92,6 @@ public class ExpenseItemsConfigEntity {
|
||||||
@TableField(typeHandler = JsonTypeHandler.class)
|
@TableField(typeHandler = JsonTypeHandler.class)
|
||||||
private List<String> goodsIds;
|
private List<String> goodsIds;
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点范围;字典代码:station_scope all -->所有站点 stations -->指定站点
|
|
||||||
*/
|
|
||||||
private StationsScope stationScope;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点ids
|
|
||||||
*/
|
|
||||||
@TableField(typeHandler = JsonTypeHandler.class)
|
|
||||||
private List<String> stationIds;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class ExpenseItemsConfigService extends ServiceImpl<ExpenseItemsConfigMap
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
public void add(ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
public void add(ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
||||||
// expenseItemsConfigEntity.setExpenseItemCategory(ExpenseItemCategory.QingYunFuWuFei.getVal());
|
expenseItemsConfigEntity.setExpenseItemCategory(ExpenseItemCategory.QingYunFuWuFei.getVal());
|
||||||
this.save(expenseItemsConfigEntity);
|
this.save(expenseItemsConfigEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,8 +55,7 @@ public class ExpenseItemsConfigService extends ServiceImpl<ExpenseItemsConfigMap
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
public PageResult<ExpenseItemsConfigEntity> paging(PageParam pageParam, ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
public PageResult<ExpenseItemsConfigEntity> paging(PageParam pageParam, ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
||||||
expenseItemsConfigEntity.setDeleted(Boolean.FALSE);
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<ExpenseItemsConfigEntity>query(expenseItemsConfigEntity)));
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(expenseItemsConfigEntity)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,131 +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.*;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.UploadResult;
|
|
||||||
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 final AppProperties appProperties;
|
|
||||||
private static String refTnt = "";
|
|
||||||
private static String tnt = "";
|
|
||||||
private static long lastLoginTime = 0;
|
|
||||||
|
|
||||||
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 HsoaResult<?> pushProvincial(PushProvincialSaveParam param) {
|
|
||||||
login();
|
|
||||||
try {
|
|
||||||
rlock.lock();
|
|
||||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
|
||||||
return new HsoaResult<>()
|
|
||||||
.setSuccess(false);
|
|
||||||
}
|
|
||||||
return API.pushProvincial(param, new TokenParam().setTnt(tnt).setRefTnt(refTnt));
|
|
||||||
} finally {
|
|
||||||
rlock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UploadResult upload(PushProvincialUploadParam param) {
|
|
||||||
login();
|
|
||||||
try {
|
|
||||||
rlock.lock();
|
|
||||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
|
||||||
return new UploadResult();
|
|
||||||
}
|
|
||||||
return API.upload(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,41 +0,0 @@
|
||||||
package com.njzscloud.supervisory.hsoa;
|
|
||||||
|
|
||||||
import com.njzscloud.common.http.annotation.*;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.param.*;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.UploadResult;
|
|
||||||
|
|
||||||
@RemoteServer(value = "${hsoa.base-url}")
|
|
||||||
public interface HsoaApi {
|
|
||||||
/**
|
|
||||||
* 登录
|
|
||||||
*/
|
|
||||||
@PostEndpoint("/garbage/mLoginApi/login")
|
|
||||||
HsoaResult<LoginResult> login(@FormBodyParam LoginParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新 TOKEN
|
|
||||||
*/
|
|
||||||
@GetEndpoint("/garbage/mLoginApi/refreshToken")
|
|
||||||
HsoaResult<LoginResult> refreshToken(@QueryParam RefreshTokenParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送定位数据
|
|
||||||
*/
|
|
||||||
@PostEndpoint("/garbage/commonApi/pushVehicleTrajectory")
|
|
||||||
HsoaResult<Object> pushVehicleTrajectory(@JsonBodyParam PushVehicleTrajectoryParam param, @QueryParam TokenParam tokenParam);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电子联单数据
|
|
||||||
*/
|
|
||||||
@PostEndpoint("/garbage/api/pushProvincial/save")
|
|
||||||
HsoaResult<Object> pushProvincial(@JsonBodyParam PushProvincialSaveParam param, @QueryParam TokenParam tokenParam);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传附件
|
|
||||||
*/
|
|
||||||
@PostEndpoint("/garbage/api/pushProvincial/upload")
|
|
||||||
UploadResult upload(@MultiBodyParam PushProvincialUploadParam param, @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.PushProvincialSaveParam;
|
|
||||||
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_vehicle_trajectory")
|
|
||||||
public R<?> pushVehicleTrajectory(@RequestBody PushVehicleTrajectoryParam pushVehicleTrajectoryParam) {
|
|
||||||
HsoaResult<?> objectHsoaResult = Hsoa.pushVehicleTrajectory(pushVehicleTrajectoryParam);
|
|
||||||
return R.success(objectHsoaResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/push_provincial")
|
|
||||||
public R<?> pushProvincial(@RequestParam PushProvincialSaveParam param) {
|
|
||||||
HsoaResult<?> hsoaResult = Hsoa.pushProvincial(param);
|
|
||||||
return R.success(hsoaResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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,653 +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;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建筑垃圾处置运输订单主实体
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class PushProvincialSaveParam {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场接收信息DTO
|
|
||||||
*/
|
|
||||||
@JsonProperty("handleInfoDTO")
|
|
||||||
private HandleInfo handleInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审批信息DTO
|
|
||||||
*/
|
|
||||||
@JsonProperty("reviewInfoDTO")
|
|
||||||
private ReviewInfo reviewInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输订单基础信息DTO
|
|
||||||
*/
|
|
||||||
@JsonProperty("transportOrderDTO")
|
|
||||||
private TransportOrder transportOrder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输订单记录DTO
|
|
||||||
*/
|
|
||||||
@JsonProperty("transportOrderRecordDTO")
|
|
||||||
private TransportOrderRecord transportOrderRecord;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场接收信息DTO
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public static class HandleInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 核准日期
|
|
||||||
*/
|
|
||||||
private String approveDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 核准人姓名
|
|
||||||
*/
|
|
||||||
private String approveUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createrName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场编码
|
|
||||||
*/
|
|
||||||
private String disposalSiteCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场名称
|
|
||||||
*/
|
|
||||||
private String disposalSiteName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置工艺
|
|
||||||
*/
|
|
||||||
private String handleCraft;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置许可证名称
|
|
||||||
*/
|
|
||||||
private String handleLicenseName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置许可证编码
|
|
||||||
*/
|
|
||||||
private String handleLicenseNum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置方式(回填、填埋、资源化利用、焚烧、其他)
|
|
||||||
*/
|
|
||||||
private String handleMethod;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场纬度
|
|
||||||
*/
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终端处置场处置许可证附件路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("HANDLE_LICENSE_FILE")
|
|
||||||
private String handleLicenseFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置许可证结束有效期
|
|
||||||
*/
|
|
||||||
private String licenseValidEndDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置许可证开始有效期
|
|
||||||
*/
|
|
||||||
private String licenseValidStartDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String linkPhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处置场经度
|
|
||||||
*/
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批准(监督)单位名称
|
|
||||||
*/
|
|
||||||
private String superviseUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private String updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private String updaterName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终端处置场处置凭证附件路径(勘料照片)
|
|
||||||
*/
|
|
||||||
|
|
||||||
@JsonProperty("HANDLE_VOUCHER_FILE")
|
|
||||||
private String handleVoucherFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重量(单位: 吨)
|
|
||||||
*/
|
|
||||||
private String weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审批信息DTO
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public static class ReviewInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门所属区域名称
|
|
||||||
*/
|
|
||||||
private String cgAreaName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批意见
|
|
||||||
*/
|
|
||||||
private String cgReviewOpinion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime cgReviewTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批人所属部门编码
|
|
||||||
*/
|
|
||||||
private String cgUnitCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批人所属部门名称
|
|
||||||
*/
|
|
||||||
private String cgUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批人id
|
|
||||||
*/
|
|
||||||
private String cgUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批人名称
|
|
||||||
*/
|
|
||||||
private String cgUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createrName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门所属区域名称
|
|
||||||
*/
|
|
||||||
private String jtAreaName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批意见
|
|
||||||
*/
|
|
||||||
private String jtReviewOpinion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批时间
|
|
||||||
*/
|
|
||||||
private String jtReviewTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批人所属部门编码
|
|
||||||
*/
|
|
||||||
private String jtUnitCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批人所属部门名称
|
|
||||||
*/
|
|
||||||
private String jtUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批人id
|
|
||||||
*/
|
|
||||||
private String jtUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批人名称
|
|
||||||
*/
|
|
||||||
private String jtUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交通部门审批附件路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("JT_REVIEW_FILE")
|
|
||||||
private String jtReviewFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 城管部门审批附件路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("CG_REVIEW_FILE")
|
|
||||||
private String cgReviewFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private String updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private String updaterName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输订单基础信息DTO
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public static class TransportOrder {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约结束日期(yyyy-mm-dd)
|
|
||||||
*/
|
|
||||||
private String appointmentEndDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约结束时间(hh: mm)
|
|
||||||
*/
|
|
||||||
private String appointmentEndTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约开始日期(yyyy-mm-dd)
|
|
||||||
*/
|
|
||||||
private String appointmentStartDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约开始时间(hh: mm)
|
|
||||||
*/
|
|
||||||
private String appointmentStartTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属区编码
|
|
||||||
*/
|
|
||||||
private String areaCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属区名称
|
|
||||||
*/
|
|
||||||
private String areaName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属市编码
|
|
||||||
*/
|
|
||||||
private String cityCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属市名称
|
|
||||||
*/
|
|
||||||
private String cityName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建设工程(用地)规划许可证号
|
|
||||||
*/
|
|
||||||
private String constructionLandLicenseNum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建设单位统一社会信用代码
|
|
||||||
*/
|
|
||||||
private String constructionUnitCreditCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建设单位负责人
|
|
||||||
*/
|
|
||||||
private String constructionUnitDirector;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建设单位名称
|
|
||||||
*/
|
|
||||||
private String constructionUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建设单位联系电话
|
|
||||||
*/
|
|
||||||
private String constructionUnitPhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createrName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排放源(产废单位)
|
|
||||||
*/
|
|
||||||
private String emissionSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业联系人
|
|
||||||
*/
|
|
||||||
private String enterpriseHead;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预估重量(单位: 吨)
|
|
||||||
*/
|
|
||||||
private String estimateWeight;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾产出的许可证名称
|
|
||||||
*/
|
|
||||||
private String garbageProductionLicenseName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾产出的许可证编号
|
|
||||||
*/
|
|
||||||
private String garbageProductionLicenseNum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾现场照片路径(多个路径用逗号分隔)
|
|
||||||
*/
|
|
||||||
@JsonProperty("GARBAGE_SCENE_FILE")
|
|
||||||
private String garbageSceneFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业联系人电话
|
|
||||||
*/
|
|
||||||
private String headContact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 纬度(产废单位)
|
|
||||||
*/
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度(产废单位)
|
|
||||||
*/
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单编号(新的编号方式)
|
|
||||||
*/
|
|
||||||
private String orderNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单状态(90: 已处置(终端处置场提交处置表单,整个流程结束))
|
|
||||||
*/
|
|
||||||
private Integer orderStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单类型(1: 个人居民 2: 居委物业 3: 沿街商铺 4: 建筑工地)
|
|
||||||
*/
|
|
||||||
private Integer orderType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工程名称(项目名称)
|
|
||||||
*/
|
|
||||||
private String projectName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业注册地址
|
|
||||||
*/
|
|
||||||
private String registerAddress;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建筑工地清运预约现场联系人
|
|
||||||
*/
|
|
||||||
private String sceneLinkName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 建筑工地清运预约现场联系电话
|
|
||||||
*/
|
|
||||||
private String sceneLinkPhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属街道编码
|
|
||||||
*/
|
|
||||||
private String streetCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属街道名称
|
|
||||||
*/
|
|
||||||
private String streetName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业id
|
|
||||||
*/
|
|
||||||
private String transportationEnterpriseId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业名称
|
|
||||||
*/
|
|
||||||
private String transportationEnterpriseName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾类型编码(1: 工程渣土 2: 工程泥浆 3: 工程垃圾 4: 拆除垃圾 5: 装修垃圾)
|
|
||||||
*/
|
|
||||||
private String wasteTypeCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾类型名称(1: 工程渣土 2: 工程泥浆 3: 工程垃圾 4: 拆除垃圾 5: 装修垃圾)
|
|
||||||
*/
|
|
||||||
private String wasteTypeName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位统一社会信用代码
|
|
||||||
*/
|
|
||||||
private String workUnitCreditCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位负责人
|
|
||||||
*/
|
|
||||||
private String workUnitDirector;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位名称
|
|
||||||
*/
|
|
||||||
private String workUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位联系电话
|
|
||||||
*/
|
|
||||||
private String workUnitPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输订单记录DTO
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public static class TransportOrderRecord {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消纳单位名称
|
|
||||||
*/
|
|
||||||
private String absorptionUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审批状态(3: 已审批)
|
|
||||||
*/
|
|
||||||
private Integer auditStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输车辆车牌号
|
|
||||||
*/
|
|
||||||
private String carNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消纳单位类型(1: 中转站 3: 资源利用企业 4: 消纳场)
|
|
||||||
*/
|
|
||||||
private String absorptionUnitType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消纳单位编码
|
|
||||||
*/
|
|
||||||
private String absorptionUnitCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间(yyyy-MM-dd HH: mm: ss)
|
|
||||||
*/
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输司机驾驶证号
|
|
||||||
*/
|
|
||||||
private String driverLicense;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业联系人
|
|
||||||
*/
|
|
||||||
private String enterpriseHead;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业运输的许可证名称
|
|
||||||
*/
|
|
||||||
private String enterpriseTransportLicenseName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业运输的许可证编号
|
|
||||||
*/
|
|
||||||
private String enterpriseTransportLicenseNum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预估重量(单位: 吨)
|
|
||||||
*/
|
|
||||||
private String estimateWeight;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 司机实际结束运输时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime haulageEndTimeStr;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 司机实际开始运输时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime haulageStartTimeStr;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人电话
|
|
||||||
*/
|
|
||||||
private String headContact;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输许可证照片路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("TRANS_LICENSE_FILE")
|
|
||||||
private String transLicenseFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾装车前附件路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("GARBAGE_LOAD_BEFORE_FILE")
|
|
||||||
private String garbageLoadBeforeFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 垃圾装车后附件路径
|
|
||||||
*/
|
|
||||||
@JsonProperty("GARBAGE_LOAD_AFTER_FILE")
|
|
||||||
private String garbageLoadAfterFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输许可证有效期起止(格式:yyyy-MM-dd-yyyy-MM-dd)
|
|
||||||
*/
|
|
||||||
private String licenseValidityPeriodDateRange;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业运输的许可证结束有效期
|
|
||||||
*/
|
|
||||||
private String licenseValidityPeriodEndDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业运输的许可证开始有效期
|
|
||||||
*/
|
|
||||||
private String licenseValidityPeriodStartDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输路线
|
|
||||||
*/
|
|
||||||
private String route;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批准(监督)单位名称
|
|
||||||
*/
|
|
||||||
private String superviseUnitName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输日期范围(格式:yyyy-MM-dd-yyyy-MM-dd)
|
|
||||||
*/
|
|
||||||
private String transportDateRange;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输结束日期
|
|
||||||
*/
|
|
||||||
private String transportEndDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输开始日期
|
|
||||||
*/
|
|
||||||
private String transportStartDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业id
|
|
||||||
*/
|
|
||||||
private String transportationEnterpriseId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运企业名称
|
|
||||||
*/
|
|
||||||
private String transportationEnterpriseName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private String updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人名称
|
|
||||||
*/
|
|
||||||
private String updaterName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
|
||||||
|
|
||||||
import com.njzscloud.common.http.annotation.MultiBodyParam;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class PushProvincialUploadParam {
|
|
||||||
// 垃圾现场照片
|
|
||||||
public static final String GARBAGE_SCENE_FILE = "GARBAGE_SCENE_FILE";
|
|
||||||
// 垃圾产出的许可证照片
|
|
||||||
public static final String LICENSE_FILE = "LICENSE_FILE";
|
|
||||||
// 垃圾运输的许可证照片
|
|
||||||
public static final String TRANS_LICENSE_FILE = "TRANS_LICENSE_FILE";
|
|
||||||
// 委托书照片
|
|
||||||
public static final String PROXY_STATEMENT_FILE = "PROXY_STATEMENT_FILE";
|
|
||||||
// 建筑工地
|
|
||||||
public static final String CONS_SITE_FILE = "CONS_SITE_FILE";
|
|
||||||
// 居民小区
|
|
||||||
public static final String RES_AREA_FILE = "RES_AREA_FILE";
|
|
||||||
// 沿街商铺
|
|
||||||
public static final String STREET_SHOP_FILE = "STREET_SHOP_FILE";
|
|
||||||
// 运输企业
|
|
||||||
public static final String TRANS_ENTER_FILE = "TRANS_ENTER_FILE";
|
|
||||||
// 运输车辆
|
|
||||||
public static final String TRANS_VEHICLE_FILE = "TRANS_VEHICLE_FILE";
|
|
||||||
// 驾驶员
|
|
||||||
public static final String TRANS_DRIVER_FILE = "TRANS_DRIVER_FILE";
|
|
||||||
// 垃圾中转站
|
|
||||||
public static final String TRANS_STA_FILE = "TRANS_STA_FILE";
|
|
||||||
// 垃圾存放点
|
|
||||||
public static final String STO_POINT_FILE = "STO_POINT_FILE";
|
|
||||||
// 资源利用企业
|
|
||||||
public static final String RES_UTIL_FILE = "RES_UTIL_FILE";
|
|
||||||
// 垃圾消纳场所
|
|
||||||
public static final String CONS_PLACE_FILE = "CONS_PLACE_FILE";
|
|
||||||
// 垃圾回填场所
|
|
||||||
public static final String BACKFILL_PLACE_FILE = "BACKFILL_PLACE_FILE";
|
|
||||||
// 我的意见
|
|
||||||
public static final String MY_OPINION_FILE = "MY_OPINION_FILE";
|
|
||||||
// 主管部门审批附件
|
|
||||||
public static final String ZG_REVIEW_FILE = "ZG_REVIEW_FILE";
|
|
||||||
// 交通部门审批附件
|
|
||||||
public static final String JT_REVIEW_FILE = "JT_REVIEW_FILE";
|
|
||||||
// 城管部门审批附件
|
|
||||||
public static final String CG_REVIEW_FILE = "CG_REVIEW_FILE";
|
|
||||||
// 消息资讯附件
|
|
||||||
public static final String NEWS_INFO_FILE = "NEWS_INFO_FILE";
|
|
||||||
// 垃圾运输附件
|
|
||||||
public static final String GARBAGE_TRANS_FILE = "GARBAGE_TRANS_FILE";
|
|
||||||
// 终端处置场处置许可证附件
|
|
||||||
public static final String HANDLE_LICENSE_FILE = "HANDLE_LICENSE_FILE";
|
|
||||||
// 终端处置场处置凭证附件
|
|
||||||
public static final String HANDLE_VOUCHER_FILE = "HANDLE_VOUCHER_FILE";
|
|
||||||
// 无人机巡检案件附件/手机端上报案件附件
|
|
||||||
public static final String INSPECTION_EVENT_FILE = "INSPECTION_EVENT_FILE";
|
|
||||||
// 垃圾装车前附件
|
|
||||||
public static final String GARBAGE_LOAD_BEFORE_FILE = "GARBAGE_LOAD_BEFORE_FILE";
|
|
||||||
// 垃圾装车后附件
|
|
||||||
public static final String GARBAGE_LOAD_AFTER_FILE = "GARBAGE_LOAD_AFTER_FILE";
|
|
||||||
// 无人机巡检/手机端案件处置附件
|
|
||||||
public static final String DISPOSAL_EVENT_FILE = "DISPOSAL_EVENT_FILE";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件
|
|
||||||
*/
|
|
||||||
@MultiBodyParam
|
|
||||||
private InputStream file;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路径,参照下方附件上传接口 路径字典值
|
|
||||||
*/
|
|
||||||
@MultiBodyParam
|
|
||||||
private String uploadPath;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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,21 +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 UploadResult {
|
|
||||||
private String msg;
|
|
||||||
private String flag;
|
|
||||||
private String id;
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
public boolean isSuccess() {
|
|
||||||
return "success".equals(flag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,276 +0,0 @@
|
||||||
package com.njzscloud.supervisory.hsoa.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njzscloud.common.core.jackson.Jackson;
|
|
||||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushProvincialSaveParam;
|
|
||||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
|
||||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.njzscloud.supervisory.hsoa.pojo.param.PushProvincialUploadParam.*;
|
|
||||||
|
|
||||||
@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();
|
|
||||||
|
|
||||||
} */
|
|
||||||
|
|
||||||
public HsoaResult<?> pushProvincialSave(OrderPagingResult detail) {
|
|
||||||
log.info("上传数据:{}", Jackson.toJsonStr(detail));
|
|
||||||
|
|
||||||
PushProvincialSaveParam param = new PushProvincialSaveParam()
|
|
||||||
.setHandleInfo(new PushProvincialSaveParam.HandleInfo()
|
|
||||||
.setApproveDate(detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setApproveUserName(detail.getCheckerName())
|
|
||||||
// .setCreateTime(detail.getCreateTime())
|
|
||||||
// .setCreaterName(detail.getContacts())
|
|
||||||
// .setDisposalSiteCode("")
|
|
||||||
.setDisposalSiteName(detail.getStationName())
|
|
||||||
// .setHandleCraft("")
|
|
||||||
// .setHandleLicenseName("")
|
|
||||||
// .setHandleLicenseNum("")
|
|
||||||
.setHandleMethod("资源化利用")
|
|
||||||
.setLongitude(detail.getStationLng().toString())
|
|
||||||
.setLatitude(detail.getStationLat().toString())
|
|
||||||
// .setHANDLE_LICENSE_FILE("")
|
|
||||||
// .setLicenseValidStartDate("")
|
|
||||||
// .setLicenseValidEndDate("")
|
|
||||||
.setLinkPhone(detail.getCheckerPhone())
|
|
||||||
// .setSuperviseUnitName("")
|
|
||||||
// .setUpdateTime("")
|
|
||||||
// .setUpdaterName("")
|
|
||||||
.setHandleVoucherFile(upload(detail.getCheckPhoto(), HANDLE_VOUCHER_FILE))
|
|
||||||
.setWeight(new BigDecimal(detail.getSettleWeight()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP).toPlainString())
|
|
||||||
)
|
|
||||||
.setReviewInfo(new PushProvincialSaveParam.ReviewInfo()
|
|
||||||
.setCgAreaName(detail.getProvinceName() + detail.getCityName() + detail.getAreaName())
|
|
||||||
.setCgReviewOpinion(StrUtil.isBlank(detail.getShiAuditMemo()) ? "同意" : detail.getShiAuditMemo())
|
|
||||||
.setCgReviewTime(detail.getShiAuditTime())
|
|
||||||
// .setCgUnitCode("")
|
|
||||||
.setCgUnitName(detail.getAreaName() + "城管")
|
|
||||||
.setCgUserId(detail.getQuAuditUserId() == null ? (detail.getShiAuditUserId() == null ? null : detail.getShiAuditUserId().toString()) : detail.getQuAuditUserId().toString())
|
|
||||||
// .setCgUserName(detail.getQuAuditUserName() == null ? (detail.getShiAuditUserName() == null ? null : detail.getShiAuditUserName()) : detail.getQuAuditUserName())
|
|
||||||
.setCgUserName(detail.getAreaName().contains("琅琊") ? "陶明莉" : (detail.getAreaName().contains("南谯") ? "刘浩" : (detail.getQuAuditUserName() == null ? (detail.getShiAuditUserName() == null ? null : detail.getShiAuditUserName()) : detail.getQuAuditUserName())))
|
|
||||||
// .setCreateTime(detail.getCreateTime())
|
|
||||||
// .setCreaterName(detail.getContacts())
|
|
||||||
// .setCG_REVIEW_FILE("")
|
|
||||||
)
|
|
||||||
.setTransportOrder(new PushProvincialSaveParam.TransportOrder()
|
|
||||||
.setAddress(detail.getAddress())
|
|
||||||
.setAppointmentStartDate(detail.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setAppointmentStartTime(detail.getCreateTime().format(DateTimeFormatter.ofPattern("HH:mm")))
|
|
||||||
.setAreaCode(detail.getArea())
|
|
||||||
.setAreaName(detail.getAreaName())
|
|
||||||
.setCityCode(detail.getCity())
|
|
||||||
.setCityName(detail.getCityName())
|
|
||||||
.setConstructionUnitCreditCode(detail.getUscc())
|
|
||||||
.setConstructionUnitName(detail.getCompanyName())
|
|
||||||
.setConstructionUnitDirector(detail.getContacts())
|
|
||||||
.setConstructionUnitPhone(detail.getPhone())
|
|
||||||
.setEmissionSource(detail.getCompanyName() == null ? detail.getContacts() : detail.getCompanyName())
|
|
||||||
.setEstimateWeight(detail.getEstimatedQuantity())
|
|
||||||
.setGarbageSceneFile(upload(detail.getSitePhotos(), GARBAGE_SCENE_FILE))
|
|
||||||
.setEnterpriseHead(detail.getTransContacts())
|
|
||||||
.setHeadContact(detail.getTransPhone())
|
|
||||||
.setLatitude(detail.getLat() == null ? null : detail.getLat().toString())
|
|
||||||
.setLongitude(detail.getLng() == null ? null : detail.getLng().toString())
|
|
||||||
// .setOrderNumber(detail.getArea() + detail.getSn())
|
|
||||||
.setOrderStatus(90)
|
|
||||||
.setOrderType(detail.getCompanyName() == null ? 1 : 4)
|
|
||||||
.setProjectName(detail.getProjectName())
|
|
||||||
.setRegisterAddress(detail.getTransAddress())
|
|
||||||
.setSceneLinkName(detail.getContacts())
|
|
||||||
.setSceneLinkPhone(detail.getPhone())
|
|
||||||
.setStreetCode(detail.getTown())
|
|
||||||
.setStreetName(detail.getTownName())
|
|
||||||
.setTransportationEnterpriseId(detail.getTransCompanyId() == null ? null : detail.getTransCompanyId().toString())
|
|
||||||
.setTransportationEnterpriseName(detail.getTransCompanyName())
|
|
||||||
.setWasteTypeCode(detail.getGoodsName().contains("拆除") ? "4" :
|
|
||||||
(detail.getGoodsName().contains("装修") ? "5" :
|
|
||||||
(detail.getGoodsName().contains("建筑") ? "3" : (detail.getGoodsName().contains("园林") ? "3" : (detail.getGoodsName().contains("拆迁") ? "4" : null)))
|
|
||||||
))
|
|
||||||
.setWasteTypeName(detail.getGoodsName())
|
|
||||||
.setWorkUnitCreditCode(detail.getUscc())
|
|
||||||
.setWorkUnitDirector(detail.getContacts())
|
|
||||||
.setWorkUnitPhone(detail.getPhone())
|
|
||||||
.setWorkUnitName(detail.getCompanyName())
|
|
||||||
)
|
|
||||||
.setTransportOrderRecord(new PushProvincialSaveParam.TransportOrderRecord()
|
|
||||||
.setAbsorptionUnitName(detail.getStationCompanyName())
|
|
||||||
.setAuditStatus(3)
|
|
||||||
.setCarNo(detail.getLicensePlate())
|
|
||||||
.setAbsorptionUnitType("1")
|
|
||||||
.setAbsorptionUnitCode(detail.getStationUscc())
|
|
||||||
.setDriverLicense(detail.getDrivingLicenceNo())
|
|
||||||
.setEnterpriseHead(detail.getDriverName())
|
|
||||||
.setHeadContact(detail.getDriverPhone())
|
|
||||||
// .setEnterpriseTransportLicenseName("")
|
|
||||||
.setEnterpriseTransportLicenseNum(detail.getCertificateSn())
|
|
||||||
.setEstimateWeight(detail.getEstimatedQuantity())
|
|
||||||
.setHaulageStartTimeStr(detail.getTransTime())
|
|
||||||
.setHaulageEndTimeStr(detail.getOutTime())
|
|
||||||
// .setTRANS_LICENSE_FILE("")
|
|
||||||
.setGarbageLoadBeforeFile(upload(detail.getCargoPhoto(), GARBAGE_LOAD_BEFORE_FILE))
|
|
||||||
.setGarbageLoadAfterFile(upload(detail.getCargoPhoto(), GARBAGE_LOAD_AFTER_FILE))
|
|
||||||
.setLicenseValidityPeriodDateRange(detail.getShiAuditTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "-" + detail.getShiAuditTime().plusHours(24).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setLicenseValidityPeriodStartDate(detail.getShiAuditTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setLicenseValidityPeriodEndDate(detail.getShiAuditTime().plusHours(24).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
// .setRoute("")
|
|
||||||
.setSuperviseUnitName(detail.getAreaName())
|
|
||||||
.setTransportDateRange(detail.getTransTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "-" + detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setTransportStartDate(detail.getTransTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setTransportEndDate(detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
||||||
.setTransportationEnterpriseId(detail.getTransCompanyId() == null ? null : detail.getTransCompanyId().toString())
|
|
||||||
.setTransportationEnterpriseName(detail.getTransCompanyName())
|
|
||||||
);
|
|
||||||
log.info(Jackson.toJsonStr(param));
|
|
||||||
return Hsoa.pushProvincial(param);
|
|
||||||
// return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String upload(List<String> urls, String uploadPath) {
|
|
||||||
return null;
|
|
||||||
/* if (CollUtil.isEmpty(urls)) return null;
|
|
||||||
String url = urls.get(0);
|
|
||||||
if (StrUtil.isBlank(url)) return null;
|
|
||||||
url = url.substring(1);
|
|
||||||
String[] split = url.split("/");
|
|
||||||
if (split.length < 2) return null;
|
|
||||||
Tuple2<InputStream, String> tuple2 = AliOSS.obtainFile(split[0], split[1]);
|
|
||||||
InputStream in = tuple2.get_0();
|
|
||||||
try {
|
|
||||||
ByteArrayOutputStream out = ImgUtil.compress(in, 0.5, FileUtil.extName(split[1]), 1024 * 1024);
|
|
||||||
byte[] bytes = out.toByteArray();
|
|
||||||
UploadResult upload = Hsoa.upload(new PushProvincialUploadParam()
|
|
||||||
.setFile(new ByteArrayInputStream(bytes))
|
|
||||||
.setUploadPath(uploadPath)
|
|
||||||
);
|
|
||||||
if (upload.isSuccess()) {
|
|
||||||
log.info("图片:{}、{}", uploadPath, upload.getUrl());
|
|
||||||
return upload.getUrl();
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} finally {
|
|
||||||
IoUtil.close(in);
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -16,7 +16,6 @@ public enum MoneyChangeCategory implements DictStr {
|
||||||
DingDanTiaoZhang("DingDanTiaoZhang", "订单调账"),
|
DingDanTiaoZhang("DingDanTiaoZhang", "订单调账"),
|
||||||
DingDanKouKuan("DingDanKouKuan", "订单扣款"),
|
DingDanKouKuan("DingDanKouKuan", "订单扣款"),
|
||||||
DingDanTuiKuan("DingDanTuiKuan", "订单退款"),
|
DingDanTuiKuan("DingDanTuiKuan", "订单退款"),
|
||||||
DuanBoYingShou("DuanBoYingShou", "短驳营收"),
|
|
||||||
;
|
;
|
||||||
private final String val;
|
private final String val;
|
||||||
private final String txt;
|
private final String txt;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
package com.njzscloud.supervisory.money.contant;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.ienum.DictStr;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 资金明细类型
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum MoneyDetailType implements DictStr {
|
|
||||||
COMPANY("company", "企业"),
|
|
||||||
WX("wx", "微信");
|
|
||||||
|
|
||||||
private final String val;
|
|
||||||
private final String txt;
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
package com.njzscloud.supervisory.money.contant;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.ienum.DictStr;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典代码:payment_status
|
|
||||||
* 字典名称:支付状态
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum PayStatus implements DictStr {
|
|
||||||
PENDING("PENDING", "待支付"),
|
|
||||||
PAID("PAID", "已支付"),
|
|
||||||
REFUNDING("REFUNDING", "待退款"),
|
|
||||||
REFUNDED("REFUNDED", "已退款"),
|
|
||||||
;
|
|
||||||
private final String val;
|
|
||||||
private final String txt;
|
|
||||||
}
|
|
||||||
|
|
@ -16,7 +16,6 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金明细
|
* 资金明细
|
||||||
* @author ljw
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金账户表
|
* 资金账户表
|
||||||
* @author ljw
|
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -37,20 +36,10 @@ public class MoneyAccountEntity {
|
||||||
private Long stationId;
|
private Long stationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 余额
|
* 资金
|
||||||
*/
|
*/
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
|
|
||||||
/**
|
|
||||||
* 营收
|
|
||||||
*/
|
|
||||||
private BigDecimal revenue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 附件地址
|
|
||||||
*/
|
|
||||||
private String fileUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.njzscloud.supervisory.money.pojo.entity;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.njzscloud.supervisory.money.contant.BillStatus;
|
import com.njzscloud.supervisory.money.contant.BillStatus;
|
||||||
import com.njzscloud.supervisory.money.contant.InvoiceStatus;
|
import com.njzscloud.supervisory.money.contant.InvoiceStatus;
|
||||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -138,9 +137,4 @@ public class MoneyBillEntity {
|
||||||
*/
|
*/
|
||||||
private String goodsName;
|
private String goodsName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单类型; 字典代码:order_category
|
|
||||||
*/
|
|
||||||
private String orderCategory;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package com.njzscloud.supervisory.money.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||||
import com.njzscloud.supervisory.money.contant.MoneyDetailType;
|
|
||||||
import com.njzscloud.supervisory.money.contant.PayStatus;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -14,13 +12,12 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金变动明细
|
* 资金变动明细
|
||||||
* @author ljw
|
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName(value = "money_change_detail", autoResultMap = true)
|
@TableName("money_change_detail")
|
||||||
public class MoneyChangeDetailEntity {
|
public class MoneyChangeDetailEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,16 +31,6 @@ public class MoneyChangeDetailEntity {
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
private MoneyDetailType type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private PayStatus status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公司id
|
* 公司id
|
||||||
*/
|
*/
|
||||||
|
|
@ -79,11 +66,6 @@ public class MoneyChangeDetailEntity {
|
||||||
*/
|
*/
|
||||||
private MoneyChangeCategory moneyChangeCategory;
|
private MoneyChangeCategory moneyChangeCategory;
|
||||||
|
|
||||||
/**
|
|
||||||
* 附件地址
|
|
||||||
*/
|
|
||||||
private String fileUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扩展信息
|
* 扩展信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -127,12 +109,6 @@ public class MoneyChangeDetailEntity {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String sn;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String licensePlate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始时间(用于时间范围查询)
|
* 开始时间(用于时间范围查询)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue