Compare commits
63 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
b155c21610 | |
|
|
175bd4d7bf | |
|
|
c6ea9ed4ee | |
|
|
2ad627983b | |
|
|
13fba7dc8a | |
|
|
0f6db1bc67 | |
|
|
fb7f39a1f0 | |
|
|
4ffe03808c | |
|
|
f02e93e8df | |
|
|
68ca14ecf9 | |
|
|
911fead99b | |
|
|
572ba946fd | |
|
|
6f30570604 | |
|
|
0c2bb58cca | |
|
|
e8610841e8 | |
|
|
f596a7b683 | |
|
|
2e5aecb2c3 | |
|
|
a20ad40129 | |
|
|
87bc7f5d09 | |
|
|
67e3d7ffee | |
|
|
586b828b96 | |
|
|
6671acfcc4 | |
|
|
38984e90fc | |
|
|
752a310404 | |
|
|
63045f9e50 | |
|
|
781c84b814 | |
|
|
e3bcdefe63 | |
|
|
1c390713c6 | |
|
|
eff2cf2819 | |
|
|
fc7632f9b4 | |
|
|
1cfecce36e | |
|
|
be6808af55 | |
|
|
dcb7f32b6d | |
|
|
0eaeea3b24 | |
|
|
d9462239fd | |
|
|
77db899d11 | |
|
|
c6730de026 | |
|
|
835417024c | |
|
|
8b249f37a0 | |
|
|
d6cbc62e5c | |
|
|
ca40e8260f | |
|
|
d59789fb9e | |
|
|
200bc1ee3a | |
|
|
9d5da6f075 | |
|
|
25190d46bd | |
|
|
6f7c13a84d | |
|
|
e4b216a3db | |
|
|
eb17f855dc | |
|
|
9a9df93792 | |
|
|
8e8cc9a5a7 | |
|
|
4816edf028 | |
|
|
376c9a1c8e | |
|
|
eb76f822c1 | |
|
|
d2dfd390b2 | |
|
|
33cdab43d3 | |
|
|
737b3168bc | |
|
|
8ee4147165 | |
|
|
23cd372a37 | |
|
|
1f6b6e78f9 | |
|
|
ea336aece1 | |
|
|
de971ca312 | |
|
|
b275a2c1fc | |
|
|
599bfee4b0 |
|
|
@ -0,0 +1,442 @@
|
|||
[*]
|
||||
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
|
||||
|
|
@ -151,6 +151,8 @@ public final class JT808 {
|
|||
public static JT808Message parseMessage(ByteBuf buf) {
|
||||
JT808Message jt808Message = new JT808Message();
|
||||
|
||||
byte[] h_b = ByteBufUtil.getBytes(buf);
|
||||
|
||||
try {
|
||||
// 1. 消息ID (2字节)
|
||||
jt808Message.setMessageId(buf.readUnsignedShort());
|
||||
|
|
@ -184,14 +186,22 @@ public final class JT808 {
|
|||
jt808Message.setMessageBody(array);
|
||||
|
||||
// 7. 校验码 (1字节)
|
||||
jt808Message.setCheckCode(buf.readByte());
|
||||
byte checkCode = buf.readByte();
|
||||
jt808Message.setCheckCode(checkCode);
|
||||
|
||||
// 验证校验码
|
||||
if (!verifyCheckCode(jt808Message, buf)) {
|
||||
log.error("校验码错误: {}", jt808Message);
|
||||
return null;
|
||||
|
||||
if (jt808Message.getMessageId() == 0x704) {
|
||||
log.info("报文:{}", h_b);
|
||||
}
|
||||
|
||||
int code = 0;
|
||||
for (int i = 0; i < h_b.length - 1; i++) {
|
||||
code = code ^ h_b[i];
|
||||
}
|
||||
if (code != checkCode) {
|
||||
log.error("校验码错误: {} {}", code, checkCode);
|
||||
// return null;
|
||||
}
|
||||
return jt808Message;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import lombok.Setter;
|
|||
import lombok.experimental.Accessors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* JT808协议消息实体类
|
||||
* 用于存储解析后的JT808协议消息内容
|
||||
|
|
@ -31,6 +34,7 @@ public class JT808Message {
|
|||
private byte[] messageBody;
|
||||
// 校验码 (1字节)
|
||||
private byte checkCode;
|
||||
|
||||
public JT808Message() {
|
||||
}
|
||||
|
||||
|
|
@ -39,6 +43,17 @@ public class JT808Message {
|
|||
return messageBodyProps & 0x3FF;
|
||||
}
|
||||
|
||||
public List<Integer> getBodyBytes() {
|
||||
if (messageBody == null || messageBody.length == 0) {
|
||||
return null;
|
||||
}
|
||||
ArrayList<Integer> integers = new ArrayList<>(messageBody.length);
|
||||
for (byte b : messageBody) {
|
||||
integers.add((int) b);
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
// 从消息体属性中获取是否分包
|
||||
public boolean isPackaged() {
|
||||
return (messageBodyProps & 0x4000) != 0;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ public class JT808MessageCenter {
|
|||
|
||||
Map<MessageType, Consumer<TerminalMessageBody>> m = listeners.computeIfPresent(localizerType, (k, v) -> {
|
||||
MessageType messageType = MessageType.getMessageType(messageId);
|
||||
if (messageType == MessageType.TerminalLocationBatchReport) {
|
||||
log.info("批量上报:{}", message);
|
||||
}
|
||||
|
||||
if (messageType == null) {
|
||||
log.error("未找到消息类型,设备号:{},消息 Id:0x{}", terminalId, Integer.toHexString(messageId));
|
||||
return v;
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ public abstract class JT808MessageListener {
|
|||
int speedThreshold = localizer.getSpeedThreshold();
|
||||
for (int i = 0; i < count; i++) {
|
||||
int length = byteBuf.readUnsignedShort();
|
||||
/* if (length > 28) { // 有扩展信息
|
||||
|
||||
} */
|
||||
LocationReportMessage locationReportMsg = new LocationReportMessage(byteBuf.slice(byteBuf.readerIndex(), length));
|
||||
byteBuf.skipBytes(length);
|
||||
double speed = locationReportMsg.getSpeed();
|
||||
|
|
@ -144,6 +147,8 @@ public abstract class JT808MessageListener {
|
|||
Mqtt.publish(terminalId + "/track_location", realtimeLocationResult);
|
||||
Mqtt.publish(terminalId + "/track_location_real", realtimeLocationResult);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量上报处理失败:{} {}", terminalId, message.getFlowId());
|
||||
} finally {
|
||||
byteBuf.release();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class AccessDeniedExceptionHandler implements AccessDeniedHandler {
|
|||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
} else {
|
||||
log.error("暂无权限: {}", request.getRequestURI(), accessDeniedException);
|
||||
r = R.failed(ExceptionMsg.CLI_ERR_MSG, accessDeniedException.getMessage());
|
||||
r = R.failed(ExceptionMsg.CLI_ERR_MSG, "暂无权限");
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
}
|
||||
ServletUtil.write(response, Jackson.toJsonStr(r), Mime.u8Val(Mime.JSON));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class TokenHandshakeInterceptor implements HandshakeInterceptor {
|
|||
try {
|
||||
HttpServletRequest req = ((ServletServerHttpRequest) request).getServletRequest();
|
||||
String authorization = req.getParameter(Authorization);
|
||||
if (StrUtil.isBlank(authorization)) return false;
|
||||
// if (StrUtil.isBlank(authorization)) return false;
|
||||
|
||||
Tuple2<Long, String> resolved = this.resolve(authorization);
|
||||
if (resolved == null) return false;
|
||||
|
|
@ -66,7 +66,7 @@ public class TokenHandshakeInterceptor implements HandshakeInterceptor {
|
|||
}
|
||||
|
||||
private Tuple2<Long, String> resolve(String tokenStr) {
|
||||
if (StrUtil.isBlank(tokenStr)) return Tuple2.create(0L, IdUtil.fastSimpleUUID());
|
||||
if (StrUtil.isBlank(tokenStr)) return Tuple2.create(1L, IdUtil.fastSimpleUUID());
|
||||
UserDetail userDetail = SecurityUtil.parseToken(tokenStr);
|
||||
if (userDetail == null) return null;
|
||||
Token token = userDetail.getToken();
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@
|
|||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.9.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.volcengine</groupId>
|
||||
<artifactId>volcengine-java-sdk-ark-runtime</artifactId>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
package com.njzscloud.supervisory.biz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.BizDriverEntity;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.DriverCantDelResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司机信息
|
||||
*/
|
||||
|
|
@ -30,4 +34,5 @@ public interface BizDriverMapper extends BaseMapper<BizDriverEntity> {
|
|||
@Select("SELECT id,uscc,company_name FROM biz_company WHERE id = #{companyId}")
|
||||
SearchCompanyResult selectCompanyById(@Param("companyId") Long companyId);
|
||||
|
||||
List<DriverCantDelResult> driverCantDel(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.TruckCantDelResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*/
|
||||
|
|
@ -26,4 +29,6 @@ public interface BizTruckMapper extends BaseMapper<BizTruckEntity> {
|
|||
* 根据ID查询预警详情(包含关联信息)
|
||||
*/
|
||||
SearchTruckResult selectDetailById(@Param("id") Long id);
|
||||
|
||||
List<TruckCantDelResult> truckCantDel(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,11 +62,13 @@ public class BizCompanyEntity {
|
|||
/**
|
||||
* 营业执照有效期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenseStartTime;
|
||||
|
||||
/**
|
||||
* 营业执照有效期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,10 @@ public class BizDriverEntity {
|
|||
*/
|
||||
private String drivingLicence;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenceStartTime;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private LocalDate licenceEndTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
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,4 +147,10 @@ public class SearchCompanyResult {
|
|||
|
||||
private BigDecimal money;
|
||||
|
||||
private String idcard;
|
||||
private String idcardStartTime;
|
||||
private String idcardEndTime;
|
||||
private String idcardFront;
|
||||
private String idcardBack;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
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,6 +2,7 @@ package com.njzscloud.supervisory.biz.service;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
|
@ -19,6 +20,7 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizDriverEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.AddDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.AuditDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.ModifyDriverParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.DriverCantDelResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
import com.njzscloud.supervisory.sys.user.pojo.param.AddUserAccountParam;
|
||||
|
|
@ -31,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 司机信息
|
||||
|
|
@ -101,6 +104,18 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
Assert.notEmpty(ids, () -> Exceptions.clierr("未指定要删除的数据"));
|
||||
List<BizDriverEntity> bizDriverEntities = this.listByIds(ids);
|
||||
Assert.isTrue(bizDriverEntities.size() == ids.size(), () -> Exceptions.clierr("未找到要删除的数据"));
|
||||
List<DriverCantDelResult> idList = baseMapper.driverCantDel(Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.in("b.id", ids));
|
||||
Assert.isTrue(idList.isEmpty(), () -> Exceptions.clierr(MapUtil.builder()
|
||||
.put("reason", "存在已关联的订单")
|
||||
.put("details", idList)
|
||||
.build()));
|
||||
List<Long> userIds = bizDriverEntities.stream().map(BizDriverEntity::getUserId).collect(Collectors.toList());
|
||||
sysUserService.del(userIds);
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.njzscloud.supervisory.biz.service;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -22,6 +23,7 @@ import com.njzscloud.supervisory.biz.pojo.param.ModifyBizTruckParam;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.SearchTruckParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.TruckCantDelResult;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
|
|
@ -104,6 +106,16 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
Assert.notEmpty(ids, () -> Exceptions.clierr("未指定要删除的数据"));
|
||||
long count = this.count(Wrappers.<BizTruckEntity>query().in("id", ids));
|
||||
Assert.isTrue(count == ids.size(), () -> Exceptions.clierr("未找到要删除的数据"));
|
||||
List<TruckCantDelResult> idList = baseMapper.truckCantDel(Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.in("b.id", ids));
|
||||
Assert.isTrue(idList.isEmpty(), () -> Exceptions.clierr(MapUtil.builder()
|
||||
.put("reason", "存在已关联的订单")
|
||||
.put("details", idList)
|
||||
.build()));
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
|
||||
List<TruckLocationTrackEntity> records = resultPage.getRecords();
|
||||
if (records.isEmpty()) {
|
||||
if (errCount >= 200) {
|
||||
if (errCount >= 300) {
|
||||
log.error("暂无实时数据, 订单ID: {}, 时间: {}", orderId, startTime);
|
||||
Websocket.publish(new WsMsg()
|
||||
.setEvent("down/truck_location_track/realtime")
|
||||
|
|
@ -585,11 +585,10 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
return;
|
||||
}
|
||||
errCount++;
|
||||
if (!ThreadUtil.sleep(300)) {
|
||||
if (!ThreadUtil.sleep(1000)) {
|
||||
log.info("任务被取消");
|
||||
return;
|
||||
} else {
|
||||
startTime = LocalDateTime.now();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,15 @@ public interface SupervisionStatisticsMapper {
|
|||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> dataTable();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> todayAuditPassStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> stationStatistics();
|
||||
|
||||
Integer getTotalCarCount();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> getKehuList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,11 +47,13 @@ public class SupervisionStatisticsService {
|
|||
|
||||
CarSummary carSummary = supervisionStatisticsMapper.getCarSummary();
|
||||
Integer todayCarCount = supervisionStatisticsMapper.getTodayCarCount();
|
||||
Integer totalCarCount = supervisionStatisticsMapper.getTotalCarCount();
|
||||
List<RegionSummary> regionSummary = supervisionStatisticsMapper.getRegionSummary();
|
||||
List<CompanySummary> companySummary = supervisionStatisticsMapper.getCompanySummary();
|
||||
List<StationInfo> stationInfo = supervisionStatisticsMapper.getStationInfo();
|
||||
List<Order> orders = supervisionStatisticsMapper.getOrders();
|
||||
List<Project> projects = supervisionStatisticsMapper.getProjects();
|
||||
List<Map<String, Object>> kehu = supervisionStatisticsMapper.getKehuList();
|
||||
|
||||
return MapUtil.<String, Object>builder()
|
||||
.put("dispatchSummary", dispatchSummary == null ? new DispatchSummary() : dispatchSummary)
|
||||
|
|
@ -59,11 +61,13 @@ public class SupervisionStatisticsService {
|
|||
.put("disposeTotalWeight", disposeTotalWeight == null ? 0 : disposeTotalWeight)
|
||||
.put("carSummary", carSummary == null ? new CarSummary() : carSummary)
|
||||
.put("todayCarCount", todayCarCount == null ? 0 : todayCarCount)
|
||||
.put("totalCarCount", totalCarCount == null ? 0 : totalCarCount)
|
||||
.put("regionSummary", regionSummary == null ? new ArrayList<>() : regionSummary)
|
||||
.put("companySummary", companySummary == null ? new ArrayList<>() : companySummary)
|
||||
.put("stationInfo", stationInfo == null ? new ArrayList<>() : stationInfo)
|
||||
.put("orders", orders == null ? new ArrayList<>() : orders)
|
||||
.put("projects", projects == null ? new ArrayList<>() : projects)
|
||||
.put("kehu", kehu == null ? new ArrayList<>() : kehu)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -92,12 +96,23 @@ public class SupervisionStatisticsService {
|
|||
double warnRate = todayTotalCount == 0 ? 0 : todayWarnCount / todayTotalCount * 100;
|
||||
double incWarnRate = yesterdayWarnCount == 0 ? 0 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 100;
|
||||
|
||||
|
||||
Double yesterdayTotalCount = MapUtil.getDouble(dataStatistics, "yesterdayTotalCount", 0.0);
|
||||
double incDayCountRate = yesterdayTotalCount == 0 ? 0 : (todayTotalCount - yesterdayTotalCount) / yesterdayTotalCount * 100;
|
||||
|
||||
Double currentMonthTotalCount = MapUtil.getDouble(dataStatistics, "currentMonthTotalCount", 0.0);
|
||||
Double lastMonthTotalCount = MapUtil.getDouble(dataStatistics, "lastMonthTotalCount", 0.0);
|
||||
double incMonthCountRate = lastMonthTotalCount == 0 ? 0 : (currentMonthTotalCount - lastMonthTotalCount) / lastMonthTotalCount * 100;
|
||||
|
||||
|
||||
dataStatistics.put("dayRate", NumberUtil.decimalFormat("#.##", dayRate));
|
||||
dataStatistics.put("monthRate", NumberUtil.decimalFormat("#.##", monthRate));
|
||||
dataStatistics.put("finishRate", NumberUtil.decimalFormat("#.##", todayFinishRate));
|
||||
dataStatistics.put("incFinishRate", NumberUtil.decimalFormat("#.##", incFinishRate));
|
||||
dataStatistics.put("warnRate", NumberUtil.decimalFormat("#.##", warnRate));
|
||||
dataStatistics.put("incWarnRate", NumberUtil.decimalFormat("#.##", incWarnRate));
|
||||
dataStatistics.put("incDayCountRate", NumberUtil.decimalFormat("#.##", incDayCountRate));
|
||||
dataStatistics.put("incMonthCountRate", NumberUtil.decimalFormat("#.##", incMonthCountRate));
|
||||
return dataStatistics;
|
||||
})
|
||||
.exceptionally(ex -> {
|
||||
|
|
@ -239,6 +254,16 @@ public class SupervisionStatisticsService {
|
|||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
CompletableFuture<Map<String, Object>> todayAuditPassStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::todayAuditPassStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
CompletableFuture<List<Map<String, Object>>> stationStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::stationStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
try {
|
||||
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
||||
|
|
@ -253,6 +278,8 @@ public class SupervisionStatisticsService {
|
|||
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
||||
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
||||
List<Map<String, Object>> dataTable = dataTableFuture.get();
|
||||
Map<String, Object> todayAuditPassStatistics = todayAuditPassStatisticsFuture.get();
|
||||
List<Map<String, Object>> stationStatistics = stationStatisticsFuture.get();
|
||||
return MapUtil.<String, Object>builder()
|
||||
.put("dataStatistics", dataStatistics)
|
||||
.put("warnTruck", warnTruck)
|
||||
|
|
@ -266,6 +293,8 @@ public class SupervisionStatisticsService {
|
|||
.put("userStatistics", userStatistics)
|
||||
.put("weightStatistics", weightStatistics)
|
||||
.put("dataTable", dataTable)
|
||||
.put("todayAuditPassStatistics", todayAuditPassStatistics)
|
||||
.put("stationStatistics", stationStatistics)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
throw Exceptions.exception(e, "数据获取失败");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
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,4 +102,11 @@ public class SearchCompanyResult {
|
|||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
|
||||
|
||||
private String idcard;
|
||||
private String idcardStartTime;
|
||||
private String idcardEndTime;
|
||||
private String idcardFront;
|
||||
private String idcardBack;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,4 +61,6 @@ public class SearchCustomerResult {
|
|||
private SearchCompanyResult company;
|
||||
|
||||
private String settlementWay;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.njzscloud.supervisory.device.pojo.entity.DeviceInfoEntity;
|
|||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
||||
import com.njzscloud.supervisory.order.contant.SettlementWay;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderCarInOutEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||
|
|
@ -470,6 +471,10 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
BigDecimal weight_ = new BigDecimal(weight);
|
||||
BigDecimal v = weight_.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP);
|
||||
try {
|
||||
String settlementWay = orderPagingResult.getSettlementWay();
|
||||
if (SettlementWay.CASH.getTxt().equals(settlementWay)) {
|
||||
playVoice(sn, cid, "{}请先支付", licensePlate);
|
||||
}
|
||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
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> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
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;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,520 @@
|
|||
# 豆包垃圾分析接口文档
|
||||
|
||||
## 接口概述
|
||||
|
||||
本接口基于火山引擎豆包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 | 初始版本,支持垃圾车辆图片分析功能 |
|
||||
|
||||
---
|
||||
|
||||
## 联系方式
|
||||
|
||||
如有问题或建议,请联系开发团队。
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
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,6 +5,7 @@ import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
|||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
||||
import com.njzscloud.supervisory.expense.contant.Scope;
|
||||
import com.njzscloud.supervisory.expense.contant.StationsScope;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -92,6 +93,17 @@ public class ExpenseItemsConfigEntity {
|
|||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> goodsIds;
|
||||
|
||||
/**
|
||||
* 站点范围;字典代码:station_scope all -->所有站点 stations -->指定站点
|
||||
*/
|
||||
private StationsScope stationScope;
|
||||
|
||||
/**
|
||||
* 站点ids
|
||||
*/
|
||||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> stationIds;
|
||||
|
||||
/**
|
||||
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.njzscloud.common.http.HttpClientDecorator;
|
||||
import com.njzscloud.supervisory.config.AppProperties;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@Slf4j
|
||||
public class Hsoa {
|
||||
public static final HsoaApi API;
|
||||
private static final HsoaProperties hsoaProperties;
|
||||
private static final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
|
||||
private static final ReentrantReadWriteLock.ReadLock rlock = rwLock.readLock();
|
||||
private static final ReentrantReadWriteLock.WriteLock wlock = rwLock.writeLock();
|
||||
private static String refTnt = "";
|
||||
private static String tnt = "";
|
||||
private static long lastLoginTime = 0;
|
||||
private static AppProperties appProperties;
|
||||
|
||||
static {
|
||||
HttpClientDecorator httpClientDecorator = SpringUtil.getBean(HttpClientDecorator.class);
|
||||
appProperties = SpringUtil.getBean(AppProperties.class);
|
||||
API = httpClientDecorator.decorate(HsoaApi.class);
|
||||
hsoaProperties = SpringUtil.getBean(HsoaProperties.class);
|
||||
}
|
||||
|
||||
public static HsoaResult<?> pushVehicleTrajectory(PushVehicleTrajectoryParam param) {
|
||||
login();
|
||||
try {
|
||||
rlock.lock();
|
||||
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
|
||||
param.setCityCode(defaultPlace.getCity())
|
||||
.setCityName(defaultPlace.getCityName())
|
||||
;
|
||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
||||
return new HsoaResult<>()
|
||||
.setSuccess(false);
|
||||
}
|
||||
return API.pushVehicleTrajectory(param, new TokenParam().setTnt(tnt).setRefTnt(refTnt));
|
||||
} finally {
|
||||
rlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void login() {
|
||||
try {
|
||||
wlock.lock();
|
||||
long now = System.currentTimeMillis() / 1000;
|
||||
if (StrUtil.isBlank(refTnt) || StrUtil.isBlank(tnt)) {
|
||||
HsoaResult<LoginResult> loginResult = API.login(new LoginParam()
|
||||
.setUserName(hsoaProperties.getUsername())
|
||||
.setPassword(hsoaProperties.getPassword())
|
||||
);
|
||||
if (loginResult.isSuccess()) {
|
||||
LoginResult data = loginResult.getData();
|
||||
refTnt = data.getRefTnt();
|
||||
tnt = data.getTnt();
|
||||
lastLoginTime = now;
|
||||
} else {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败");
|
||||
}
|
||||
} else if (now - lastLoginTime > hsoaProperties.getExpire() - 60) {
|
||||
HsoaResult<LoginResult> loginResult = API.refreshToken(new RefreshTokenParam().setRefTnt(refTnt));
|
||||
if (loginResult.isSuccess()) {
|
||||
LoginResult data = loginResult.getData();
|
||||
refTnt = data.getRefTnt();
|
||||
tnt = data.getTnt();
|
||||
lastLoginTime = now;
|
||||
} else {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
log.error("政务平台登录失败", e);
|
||||
} finally {
|
||||
wlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void relogin() {
|
||||
try {
|
||||
wlock.lock();
|
||||
log.info("重置登录TOKEN");
|
||||
refTnt = "";
|
||||
tnt = "";
|
||||
login();
|
||||
} finally {
|
||||
wlock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import com.njzscloud.common.http.annotation.*;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
|
||||
@RemoteServer(value = "${hsoa.base-url}")
|
||||
public interface HsoaApi {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
@PostEndpoint("/garbage/mLoginApi/login")
|
||||
HsoaResult<LoginResult> login(@FormBodyParam LoginParam apram);
|
||||
|
||||
/**
|
||||
* 刷新 TOKEN
|
||||
*/
|
||||
@GetEndpoint("/garbage/mLoginApi/refreshToken")
|
||||
HsoaResult<LoginResult> refreshToken(@QueryParam RefreshTokenParam apram);
|
||||
|
||||
/**
|
||||
* 发送定位数据
|
||||
*/
|
||||
@PostEndpoint("/garbage/commonApi/pushVehicleTrajectory")
|
||||
HsoaResult<Object> pushVehicleTrajectory(@JsonBodyParam PushVehicleTrajectoryParam apram, @QueryParam TokenParam tokenParam);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.njzscloud.supervisory.hsoa.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.service.HsoaService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hsoa")
|
||||
public class HsoaController {
|
||||
|
||||
private final HsoaService hsoaService;
|
||||
|
||||
@PostMapping("/push")
|
||||
public R<?> push(@RequestBody PushVehicleTrajectoryParam pushVehicleTrajectoryParam) {
|
||||
HsoaResult<?> objectHsoaResult = Hsoa.pushVehicleTrajectory(pushVehicleTrajectoryParam);
|
||||
if (objectHsoaResult.isSuccess()) {
|
||||
return R.success(objectHsoaResult);
|
||||
}
|
||||
return R.failed();
|
||||
}
|
||||
|
||||
@GetMapping("/push_order")
|
||||
public R<?> pushOrder(@RequestParam Long orderId, @RequestParam Integer count) {
|
||||
return R.success(hsoaService.pushOrder(orderId, count));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.njzscloud.supervisory.hsoa.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.TruckLocationTrackEntity;
|
||||
import com.njzscloud.supervisory.biz.service.TruckLocationTrackService;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class HsoaService {
|
||||
private final OrderInfoService orderInfoService;
|
||||
private final TruckLocationTrackService truckLocationTrackService;
|
||||
private final AtomicBoolean run = new AtomicBoolean(false);
|
||||
private final AtomicInteger succ = new AtomicInteger(0);
|
||||
private final AtomicInteger fail = new AtomicInteger(0);
|
||||
private final AtomicInteger total = new AtomicInteger(0);
|
||||
private final AtomicLong order = new AtomicLong(0);
|
||||
|
||||
public synchronized Map<String, Object> pushOrder(Long orderId, Integer count) {
|
||||
MapBuilder<String, Object> builder = MapUtil.<String, Object>builder();
|
||||
|
||||
if (run.get()) {
|
||||
int i1 = total.get();
|
||||
int i2 = succ.get();
|
||||
int i3 = fail.get();
|
||||
long v = order.get();
|
||||
return builder
|
||||
.put("订单", v)
|
||||
.put("任务数量", i1)
|
||||
.put("成功数量", i2)
|
||||
.put("失败数量", i3)
|
||||
.put("剩余数量", i1 - i2 - i3)
|
||||
.build();
|
||||
}
|
||||
OrderPagingResult orderDetail = orderInfoService.detail(orderId);
|
||||
Assert.notNull(orderDetail, () -> Exceptions.clierr("订单不存在"));
|
||||
String licensePlate = orderDetail.getLicensePlate();
|
||||
String transCompanyName = orderDetail.getTransCompanyName();
|
||||
List<TruckLocationTrackEntity> list = truckLocationTrackService.list(Wrappers.<TruckLocationTrackEntity>lambdaQuery().eq(TruckLocationTrackEntity::getOrderId, orderId));
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return builder
|
||||
.put("订单", orderId)
|
||||
.put("任务数量", 0)
|
||||
.build();
|
||||
}
|
||||
if (count == null || count == 0) {
|
||||
count = list.size();
|
||||
} else {
|
||||
count = Math.min(count, list.size());
|
||||
}
|
||||
run.set(true);
|
||||
order.set(orderId);
|
||||
total.set(count);
|
||||
succ.set(0);
|
||||
fail.set(0);
|
||||
int c = count;
|
||||
Thread thread = new Thread(() -> {
|
||||
for (int i = 0; i < c; i++) {
|
||||
ThreadUtil.sleep(1000);
|
||||
TruckLocationTrackEntity locationTrack = list.get(i);
|
||||
boolean b = run.get();
|
||||
if (!b) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Double longitude = locationTrack.getLongitude();
|
||||
Double latitude = locationTrack.getLatitude();
|
||||
Double speed = locationTrack.getSpeed();
|
||||
Integer direction = locationTrack.getDirection();
|
||||
LocalDateTime locationTime = locationTrack.getLocationTime();
|
||||
String time = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(locationTime);
|
||||
HsoaResult<?> result = Hsoa.pushVehicleTrajectory(new PushVehicleTrajectoryParam()
|
||||
.setCompanyName(transCompanyName)
|
||||
.setTransportLicense(orderDetail.getCertificateSn())
|
||||
.setPlateNumber(licensePlate)
|
||||
.setVehicleType(orderDetail.getTruckCategory())
|
||||
.setLongitude(longitude + "")
|
||||
.setLatitude(latitude + "")
|
||||
.setSpeed(speed)
|
||||
.setDirection(direction + 0.0)
|
||||
.setStateType("正常行驶")
|
||||
.setAlarmType("无")
|
||||
.setLoadStatus("2")
|
||||
.setSealedStatus("1")
|
||||
.setLiftStatus("0")
|
||||
.setAccStatus(1)
|
||||
.setGpsTime(time)
|
||||
.setLocationMode("WGS84")
|
||||
);
|
||||
if (result == null || !result.isSuccess()) {
|
||||
fail.incrementAndGet();
|
||||
log.error("推送定位数据失败,数据Id:{}", locationTrack.getId());
|
||||
} else {
|
||||
succ.incrementAndGet();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
fail.incrementAndGet();
|
||||
log.error("推送定位数据失败,数据Id:{}", locationTrack.getId(), e);
|
||||
}
|
||||
}
|
||||
run.set(false);
|
||||
});
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
|
||||
int i1 = total.get();
|
||||
int i2 = succ.get();
|
||||
int i3 = fail.get();
|
||||
return builder
|
||||
.put("订单", orderId)
|
||||
.put("任务数量", i1)
|
||||
.put("成功数量", i2)
|
||||
.put("失败数量", i3)
|
||||
.put("剩余数量", i1 - i2 - i3)
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -36,10 +36,15 @@ public class MoneyAccountEntity {
|
|||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 资金
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 营收
|
||||
*/
|
||||
private BigDecimal revenue;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ public class MoneyChangeDetailEntity {
|
|||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 开始时间(用于时间范围查询)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ public class MoneyBillResult {
|
|||
private Long orderId;
|
||||
private BigDecimal discountMoney;
|
||||
private BigDecimal settleMoney;
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 净重
|
||||
*/
|
||||
private Integer settleWeight;
|
||||
/**
|
||||
* 开始时间(用于时间范围查询)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class MoneyBillQuartz {
|
|||
|
||||
private final MoneyBillMapper moneyBillMapper;
|
||||
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")//每1分钟一次
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")//每1分钟一次
|
||||
@Scheduled(cron = "0 0 1 27 * ?")//每月27号凌晨1点执行
|
||||
public void syncAssetsDiscover() {
|
||||
generateMoneyBill();
|
||||
|
|
@ -89,20 +89,15 @@ public class MoneyBillQuartz {
|
|||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
|
||||
// 2. 总质量:quantity求和,条件是计费策略不等于"车"
|
||||
// 2. 车数=订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
|
||||
// 3. 总质量
|
||||
int totalWeight = itemGroupResults.stream()
|
||||
.filter(result -> !MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
|
||||
// 3. 车数:quantity求和,条件是计费策略等于"车"
|
||||
int totalCars = itemGroupResults.stream()
|
||||
.filter(result -> MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setCarCount(totalCars);
|
||||
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getDiscountMoney)
|
||||
|
|
@ -121,7 +116,7 @@ public class MoneyBillQuartz {
|
|||
entity.setGoodsName(firstResult.getExpenseItemName());
|
||||
entityList.add(entity);
|
||||
log.info("生成账单实体: transCompanyId={}, originExpenseItemId={}, 订单数={}, 总质量={}, 车数={}, 优惠金额={}, 账单金额={}",
|
||||
transCompanyId, originExpenseItemId, orderCount, totalWeight, totalCars, totalDiscountMoney, totalSettleMoney);
|
||||
transCompanyId, originExpenseItemId, orderCount, totalWeight, orderCount, totalDiscountMoney, totalSettleMoney);
|
||||
}
|
||||
}
|
||||
// 账单入库
|
||||
|
|
|
|||
|
|
@ -117,19 +117,14 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
|||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
|
||||
// 2. 总质量:quantity求和,条件是计费策略不等于"车"
|
||||
// 2. 总质量
|
||||
int totalWeight = billResults.stream()
|
||||
.filter(result -> !MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
|
||||
// 3. 车数:quantity求和,条件是计费策略等于"车"
|
||||
int totalCars = billResults.stream()
|
||||
.filter(result -> MoneyStrategy.Che.getVal().equals(result.getMoneyStrategy()))
|
||||
.mapToInt(MoneyBillResult::getQuantity)
|
||||
.sum();
|
||||
entity.setCarCount(totalCars);
|
||||
// 3. 车数 = 订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = billResults.stream()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.njzscloud.supervisory.order.contant;
|
||||
|
||||
import com.njzscloud.common.core.ienum.DictStr;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 字典代码:discount_type
|
||||
* 字典名称:优惠类型
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum DiscountType implements DictStr {
|
||||
DISCOUNT("discount", "优惠"),
|
||||
RAISE("raise", "加价"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ import com.njzscloud.supervisory.order.pojo.param.*;
|
|||
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
|
||||
import com.njzscloud.supervisory.order.service.AccountRegulationService;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import com.njzscloud.supervisory.sys.log.annotation.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -31,6 +32,8 @@ import java.util.List;
|
|||
public class OrderInfoController {
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final AccountRegulationService accountRegulationService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -258,6 +261,17 @@ public class OrderInfoController {
|
|||
orderInfoService.export(response, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
* @param orderId 订单Id
|
||||
*/
|
||||
@GetMapping("/forwarded")
|
||||
public R<?> forwarded(@RequestParam("orderId") Long orderId, @RequestParam("area") String area,
|
||||
@RequestParam("areaName") String areaName) {
|
||||
orderInfoService.forwarded(orderId, area, areaName);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 改价
|
||||
*/
|
||||
|
|
@ -268,4 +282,14 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Log("业务调账")
|
||||
@PostMapping("/account_regulation")
|
||||
public R<?> accountRegulation(@RequestBody RegulationParam param) {
|
||||
accountRegulationService.accountRegulation(param);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.PaymentContextResult;
|
||||
|
|
@ -25,6 +26,8 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
|||
|
||||
List<OrderExportResult> exportList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
List<OrderExportDetailResult> exportDetailList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult detail(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult pendingOrder(@Param("ew") QueryWrapper<Object> ew);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
|||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import com.njzscloud.supervisory.expense.contant.GoodsScope;
|
||||
import com.njzscloud.supervisory.expense.contant.Scope;
|
||||
import com.njzscloud.supervisory.expense.contant.StationsScope;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -97,6 +98,17 @@ public class OrderExpenseItemsEntity {
|
|||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> goodsIds;
|
||||
|
||||
/**
|
||||
* 站点范围;字典代码:station_scope all -->所有站点 stations -->指定站点
|
||||
*/
|
||||
private StationsScope stationScope;
|
||||
|
||||
/**
|
||||
* 站点ids
|
||||
*/
|
||||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> stationIds;
|
||||
|
||||
/**
|
||||
* 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,4 +23,6 @@ public class OrderItemsParams {
|
|||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
private String bill;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.njzscloud.supervisory.order.pojo.param;
|
|||
|
||||
import com.njzscloud.supervisory.biz.constant.AuditStatus;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.contant.OrderViewType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -20,6 +21,10 @@ public class OrderPagingSearchParam {
|
|||
*/
|
||||
private AuditStatus auditStatus;
|
||||
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private OrderCategory orderCategory;
|
||||
/**
|
||||
* 订单状态; 字典代码:order_status
|
||||
*/
|
||||
|
|
@ -35,6 +40,8 @@ public class OrderPagingSearchParam {
|
|||
* 清运公司ID
|
||||
*/
|
||||
private Long transCompanyId;
|
||||
private String transCompanyName;
|
||||
private String driverName;
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
|
|
@ -45,6 +52,7 @@ public class OrderPagingSearchParam {
|
|||
* 订单编号
|
||||
*/
|
||||
private String sn;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 调账入参
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class RegulationParam {
|
||||
|
||||
/**
|
||||
* 清运公司Id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 订单sn
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private BigDecimal delta;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.njzscloud.supervisory.order.pojo.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class OrderExportDetailResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String expenseItemName;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private BigDecimal settleMoney;
|
||||
|
||||
}
|
||||
|
|
@ -11,6 +11,11 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
public class OrderExportResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
|
|
@ -61,6 +66,10 @@ public class OrderExportResult {
|
|||
*/
|
||||
private String areaName;
|
||||
|
||||
private String townName;
|
||||
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 入场磅重(吨)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -38,6 +38,15 @@ public class OrderPagingResult {
|
|||
* 订单 Id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 对方站点 Id; 短驳单有值
|
||||
*/
|
||||
private Long targetStationId;
|
||||
|
||||
/**
|
||||
* 对方订单 Id; 短驳单有值
|
||||
*/
|
||||
private Long targetOrderId;
|
||||
/**
|
||||
* 准运证编号
|
||||
*/
|
||||
|
|
@ -469,6 +478,8 @@ public class OrderPagingResult {
|
|||
*/
|
||||
private String driverPhone;
|
||||
|
||||
private Long driverUserId;
|
||||
|
||||
/**
|
||||
* 驾驶证
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.expense.contant.ExpenseItemCategory;
|
||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyAccountEntity;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||
import com.njzscloud.supervisory.money.service.MoneyAccountService;
|
||||
import com.njzscloud.supervisory.money.service.MoneyChangeDetailService;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderExpenseItemsEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.RegulationParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.YearMonth;
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AccountRegulationService {
|
||||
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final MoneyAccountService moneyAccountService;
|
||||
|
||||
private final MoneyChangeDetailService moneyChangeDetailService;
|
||||
|
||||
private final OrderExpenseItemsService orderExpenseItemsService;
|
||||
|
||||
/**
|
||||
* 业务调账
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void accountRegulation(RegulationParam param) {
|
||||
OrderInfoEntity order = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery()
|
||||
.eq(OrderInfoEntity::getSn, param.getSn())
|
||||
.eq(OrderInfoEntity::getTransCompanyId, param.getCompanyId()));
|
||||
Assert.notNull(order, () -> Exceptions.clierr("当前客户不存在该笔订单,请检查订单号是否正确"));
|
||||
|
||||
// 判断订单创建时间是否在上个月1号和本月26号之间
|
||||
LocalDateTime createTime = order.getCreateTime();
|
||||
if (createTime != null) {
|
||||
LocalDateTime lastMonthFirstDay = YearMonth.now().minusMonths(1).atDay(1).atStartOfDay();
|
||||
LocalDateTime currentMonth26th = YearMonth.now().atDay(26).atTime(23, 59, 59);
|
||||
boolean isInRange = !createTime.isBefore(lastMonthFirstDay) && !createTime.isAfter(currentMonth26th);
|
||||
if (!isInRange) {
|
||||
throw Exceptions.clierr("只能对上月1号至本月26号之间的订单调账");
|
||||
}
|
||||
}
|
||||
|
||||
// 新增一条付费项
|
||||
OrderExpenseItemsEntity productItem = new OrderExpenseItemsEntity()
|
||||
.setExpenseItemCategory(ExpenseItemCategory.ChanPin.getVal())
|
||||
.setOrderId(order.getId())
|
||||
.setOriginExpenseItemId(202511081532L)
|
||||
.setExpenseItemName("业务调账")
|
||||
.setUnitPrice(new BigDecimal("0"))
|
||||
.setUnit("Che")
|
||||
.setMoneyStrategy("Che")
|
||||
.setQuantity(1)
|
||||
.setTotalMoney(param.getDelta())
|
||||
.setSettleMoney(param.getDelta());
|
||||
orderExpenseItemsService.save(productItem);
|
||||
|
||||
// 查询账户
|
||||
MoneyAccountEntity accountEntity = moneyAccountService.getOne(Wrappers.<MoneyAccountEntity>lambdaQuery()
|
||||
.eq(MoneyAccountEntity::getStationId, param.getCompanyId()));
|
||||
if (null == accountEntity) {
|
||||
throw Exceptions.clierr("资金账户不存在");
|
||||
}
|
||||
BigDecimal newMoney = accountEntity.getMoney().add(param.getDelta());
|
||||
// 新增一条资金明细
|
||||
MoneyChangeDetailEntity changeDetail = new MoneyChangeDetailEntity()
|
||||
.setCompanyId(param.getCompanyId())
|
||||
.setOrderId(order.getId())
|
||||
.setMoneyAccountId(accountEntity.getId())
|
||||
.setOldMoney(accountEntity.getMoney())
|
||||
.setDelta(param.getDelta())
|
||||
.setNewMoney(newMoney)
|
||||
.setMoneyChangeCategory(MoneyChangeCategory.DingDanTiaoZhang)
|
||||
.setMemo(param.getMemo());
|
||||
|
||||
moneyChangeDetailService.save(changeDetail);
|
||||
|
||||
// 变更资金账户金额
|
||||
MoneyAccountEntity companyAccount = new MoneyAccountEntity()
|
||||
.setId(accountEntity.getId())
|
||||
.setMoney(newMoney);
|
||||
moneyAccountService.updateById(companyAccount);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -72,6 +72,8 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public long truckComing(TruckComingOrderParam truckComingOrderParam, OrderCategory orderCategory) {
|
||||
Integer weight = truckComingOrderParam.getWeight();
|
||||
Assert.isTrue(weight != null && weight > 0, () -> Exceptions.clierr("磅重错误"));
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
|
|
@ -94,24 +96,27 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
|
|||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer truckOut(Long carInOutId, TruckLeavingOrderParam truckLeavingOrderParam, OrderCategory orderCategory, Long truckId) {
|
||||
Integer weight = truckLeavingOrderParam.getWeight();
|
||||
Assert.isTrue(weight != null && weight > 0, () -> Exceptions.clierr("磅重错误"));
|
||||
|
||||
OrderCarInOutEntity orderCarInOutEntity = this.getById(carInOutId);
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
Integer settleWeight = null;
|
||||
Integer roughWeight__ = orderCarInOutEntity.getRoughWeight();
|
||||
if (roughWeight__ == null) {
|
||||
/*Integer roughWeight__ = orderCarInOutEntity.getRoughWeight();
|
||||
if (roughWeight__ == null) {
|
||||
BizTruckEntity bizTruckEntity = bizTruckService.getById(truckId);
|
||||
Integer truckTareWeight = bizTruckEntity.getTareWeight();
|
||||
Assert.notNull(truckTareWeight, () -> Exceptions.exception("{} 车辆暂无皮重", bizTruckEntity.getLicensePlate()));
|
||||
orderCarInOutEntity.setRoughWeight(truckTareWeight);
|
||||
roughWeight__ = truckTareWeight;
|
||||
}
|
||||
} */
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
roughWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = roughWeight - roughWeight__;
|
||||
roughWeight = weight;
|
||||
settleWeight = roughWeight - orderCarInOutEntity.getTareWeight();
|
||||
} else {
|
||||
tareWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = roughWeight__ - tareWeight;
|
||||
tareWeight = weight;
|
||||
settleWeight = orderCarInOutEntity.getRoughWeight() - tareWeight;
|
||||
}
|
||||
Integer roughWeight_ = roughWeight;
|
||||
Integer tareWeight_ = tareWeight;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,77 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/order_route")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteController {
|
||||
|
||||
private final OrderRouteService orderRouteService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderRouteEntity routeEntity) {
|
||||
orderRouteService.add(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody OrderRouteEntity routeEntity) {
|
||||
orderRouteService.modify(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
orderRouteService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<OrderRouteEntity> detail(@RequestParam Long id) {
|
||||
return R.success(orderRouteService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<OrderRouteEntity>> paging(PageParam pageParam, OrderRouteEntity routeEntity) {
|
||||
return R.success(orderRouteService.paging(pageParam, routeEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单Id查看路线详情
|
||||
*/
|
||||
@GetMapping("/getByOrderId")
|
||||
public R<OrderRouteEntity> getByOrderId(@RequestParam Long orderId) {
|
||||
return R.success(orderRouteService.getByOrderId(orderId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/order_route_detail")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteDetailController {
|
||||
|
||||
private final OrderRouteDetailService orderRouteDetailService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderRouteDetailEntity detailEntity) {
|
||||
orderRouteDetailService.add(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody OrderRouteDetailEntity detailEntity) {
|
||||
orderRouteDetailService.modify(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
orderRouteDetailService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<OrderRouteDetailEntity> detail(@RequestParam Long id) {
|
||||
return R.success(orderRouteDetailService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<OrderRouteDetailEntity>> paging(PageParam pageParam, OrderRouteDetailEntity detailEntity) {
|
||||
return R.success(orderRouteDetailService.paging(pageParam, detailEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/route")
|
||||
@RequiredArgsConstructor
|
||||
public class RouteController {
|
||||
|
||||
private final RouteService routeService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody RouteEntity routeEntity) {
|
||||
routeService.add(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody RouteEntity routeEntity) {
|
||||
routeService.modify(routeEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
routeService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<RouteEntity> detail(@RequestParam Long id) {
|
||||
return R.success(routeService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<RouteEntity>> paging(PageParam pageParam, RouteEntity routeEntity) {
|
||||
return R.success(routeService.paging(pageParam, routeEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.njzscloud.supervisory.route.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/route_detail")
|
||||
@RequiredArgsConstructor
|
||||
public class RouteDetailController {
|
||||
|
||||
private final RouteDetailService routeDetailService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody RouteDetailEntity detailEntity) {
|
||||
routeDetailService.add(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/modify")
|
||||
public R<?> modify(@RequestBody RouteDetailEntity detailEntity) {
|
||||
routeDetailService.modify(detailEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public R<?> del(@RequestBody List<Long> ids) {
|
||||
routeDetailService.del(ids);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<RouteDetailEntity> detail(@RequestParam Long id) {
|
||||
return R.success(routeDetailService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public R<PageResult<RouteDetailEntity>> paging(PageParam pageParam, RouteDetailEntity detailEntity) {
|
||||
return R.success(routeDetailService.paging(pageParam, detailEntity));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 订单路线详情管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderRouteDetailMapper extends BaseMapper<OrderRouteDetailEntity> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderRouteMapper extends BaseMapper<OrderRouteEntity> {
|
||||
|
||||
IPage<OrderRouteEntity> paging(Page<Object> page, @Param("ew") QueryWrapper<OrderRouteEntity> ew);
|
||||
|
||||
OrderRouteEntity selectDetailById(@Param("id") Long id);
|
||||
|
||||
OrderRouteEntity getByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RouteDetailMapper extends BaseMapper<RouteDetailEntity> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.njzscloud.supervisory.route.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface RouteMapper extends BaseMapper<RouteEntity> {
|
||||
|
||||
IPage<RouteEntity> paging(Page<Object> page, @Param("ew") QueryWrapper<RouteEntity> ew);
|
||||
|
||||
RouteEntity selectDetailById(@Param("id") Long id);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单路线详情
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_route_detail", autoResultMap = true)
|
||||
public class OrderRouteDetailEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路线id
|
||||
*/
|
||||
private Long orderRouteId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_route", autoResultMap = true)
|
||||
public class OrderRouteEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单Id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 清运公司id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 起始地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startAddress;
|
||||
|
||||
/**
|
||||
* 终点地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endAddress;
|
||||
|
||||
/**
|
||||
* 路线详情
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<OrderRouteDetailEntity> detailEntityList;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 优惠管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "biz_route_detail", autoResultMap = true)
|
||||
public class RouteDetailEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路线id
|
||||
*/
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.njzscloud.supervisory.route.pojo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "biz_route", autoResultMap = true)
|
||||
public class RouteEntity {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 清运公司id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 起始地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startAddress;
|
||||
|
||||
/**
|
||||
* 终点地
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endAddress;
|
||||
|
||||
/**
|
||||
* 路线详情
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<RouteDetailEntity> detailEntityList;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 修改人 Id; sys_user.id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线详情管理
|
||||
*/
|
||||
public interface OrderRouteDetailService extends IService<OrderRouteDetailEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(OrderRouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(OrderRouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
OrderRouteDetailEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<OrderRouteDetailEntity> paging(PageParam pageParam, OrderRouteDetailEntity detailEntity);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
public interface OrderRouteService extends IService<OrderRouteEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
OrderRouteEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<OrderRouteEntity> paging(PageParam pageParam, OrderRouteEntity orderRouteEntity);
|
||||
|
||||
/**
|
||||
* 根据订单Id查看路线详情
|
||||
*/
|
||||
OrderRouteEntity getByOrderId(Long orderId);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
public interface RouteDetailService extends IService<RouteDetailEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(RouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(RouteDetailEntity detailEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
RouteDetailEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<RouteDetailEntity> paging(PageParam pageParam, RouteDetailEntity detailEntity);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.njzscloud.supervisory.route.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
public interface RouteService extends IService<RouteEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
void add(RouteEntity routeEntity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
void modify(RouteEntity routeEntity);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
void del(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
RouteEntity detail(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageResult<RouteEntity> paging(PageParam pageParam, RouteEntity routeEntity);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.njzscloud.supervisory.route.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.route.mapper.OrderRouteDetailMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteDetailServiceImpl extends ServiceImpl<OrderRouteDetailMapper, OrderRouteDetailEntity> implements OrderRouteDetailService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
public void add(OrderRouteDetailEntity detailEntity) {
|
||||
this.save(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
public void modify(OrderRouteDetailEntity detailEntity) {
|
||||
this.updateById(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
public void del(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Override
|
||||
public OrderRouteDetailEntity detail(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public PageResult<OrderRouteDetailEntity> paging(PageParam pageParam, OrderRouteDetailEntity detailEntity) {
|
||||
Page<OrderRouteDetailEntity> page = this.page(pageParam.toPage(), Wrappers.<OrderRouteDetailEntity>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(detailEntity.getName()), OrderRouteDetailEntity::getName, detailEntity.getName())
|
||||
.eq(OrderRouteDetailEntity::getDeleted, Boolean.FALSE)
|
||||
.orderByDesc(OrderRouteDetailEntity::getCreateTime));
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
package com.njzscloud.supervisory.route.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
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.route.mapper.OrderRouteMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.pojo.OrderRouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteDetailService;
|
||||
import com.njzscloud.supervisory.route.service.OrderRouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrderRouteServiceImpl extends ServiceImpl<OrderRouteMapper, OrderRouteEntity> implements OrderRouteService {
|
||||
|
||||
private final OrderRouteDetailService orderRouteDetailService;
|
||||
|
||||
private final OrderRouteMapper orderRouteMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(OrderRouteEntity orderRouteEntity) {
|
||||
this.save(orderRouteEntity);
|
||||
// 保存详情
|
||||
List<OrderRouteDetailEntity> detailEntityList = orderRouteEntity.getDetailEntityList();
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
for (OrderRouteDetailEntity detailEntity : detailEntityList) {
|
||||
detailEntity.setOrderRouteId(orderRouteEntity.getId());
|
||||
}
|
||||
orderRouteDetailService.saveBatch(detailEntityList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modify(OrderRouteEntity orderRouteEntity) {
|
||||
this.updateById(orderRouteEntity);
|
||||
// 删除原有数据,然后直接新增
|
||||
orderRouteDetailService.remove(Wrappers.<OrderRouteDetailEntity>lambdaQuery()
|
||||
.in(OrderRouteDetailEntity::getOrderRouteId, orderRouteEntity.getId()));
|
||||
List<OrderRouteDetailEntity> detailEntityList = orderRouteEntity.getDetailEntityList();
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
for (OrderRouteDetailEntity detailEntity : detailEntityList) {
|
||||
detailEntity.setOrderRouteId(orderRouteEntity.getId());
|
||||
}
|
||||
orderRouteDetailService.saveBatch(detailEntityList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
for (Long id : ids) {
|
||||
// 删除详细路线
|
||||
orderRouteDetailService.remove(Wrappers.<OrderRouteDetailEntity>lambdaQuery()
|
||||
.in(OrderRouteDetailEntity::getOrderRouteId, id));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Override
|
||||
public OrderRouteEntity detail(Long id) {
|
||||
OrderRouteEntity entity = orderRouteMapper.selectDetailById(id);
|
||||
List<OrderRouteDetailEntity> detailEntityList = orderRouteDetailService.list(Wrappers.lambdaQuery(OrderRouteDetailEntity.class)
|
||||
.eq(OrderRouteDetailEntity::getOrderRouteId, entity.getId())
|
||||
.orderByAsc(OrderRouteDetailEntity::getSort));
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
entity.setDetailEntityList(detailEntityList);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public PageResult<OrderRouteEntity> paging(PageParam pageParam, OrderRouteEntity routeEntity) {
|
||||
QueryWrapper<OrderRouteEntity> ew = Wrappers.<OrderRouteEntity>query()
|
||||
.eq("a.deleted", 0)
|
||||
.like(StrUtil.isNotBlank(routeEntity.getName()), "a.name", routeEntity.getName())
|
||||
.eq(null != routeEntity.getCompanyId(), "a.company_id", routeEntity.getCompanyId())
|
||||
.eq(null != routeEntity.getStationId(), "a.station_id", routeEntity.getStationId())
|
||||
.eq(null != routeEntity.getOrderId(), "a.order_id", routeEntity.getOrderId())
|
||||
.eq(null != routeEntity.getProjectId(), "a.project_id", routeEntity.getProjectId());
|
||||
IPage<OrderRouteEntity> page = orderRouteMapper.paging(pageParam.toPage(), ew);
|
||||
for (OrderRouteEntity entity : page.getRecords()) {
|
||||
List<OrderRouteDetailEntity> detailEntityList = orderRouteDetailService.list(Wrappers.lambdaQuery(OrderRouteDetailEntity.class)
|
||||
.eq(OrderRouteDetailEntity::getOrderRouteId, entity.getId()).orderByAsc(OrderRouteDetailEntity::getSort));
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
entity.setDetailEntityList(detailEntityList);
|
||||
}
|
||||
}
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单Id查看路线详情
|
||||
*/
|
||||
@Override
|
||||
public OrderRouteEntity getByOrderId(Long orderId) {
|
||||
OrderRouteEntity entity = orderRouteMapper.getByOrderId(orderId);
|
||||
if (null != entity) {
|
||||
List<OrderRouteDetailEntity> detailEntityList = orderRouteDetailService.list(Wrappers.lambdaQuery(OrderRouteDetailEntity.class)
|
||||
.eq(OrderRouteDetailEntity::getOrderRouteId, entity.getId())
|
||||
.orderByAsc(OrderRouteDetailEntity::getSort));
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
entity.setDetailEntityList(detailEntityList);
|
||||
}
|
||||
} else {
|
||||
throw Exceptions.error("未查询到路线");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.njzscloud.supervisory.route.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.route.mapper.RouteDetailMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线详情管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RouteDetailServiceImpl extends ServiceImpl<RouteDetailMapper, RouteDetailEntity> implements RouteDetailService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
public void add(RouteDetailEntity detailEntity) {
|
||||
this.save(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
public void modify(RouteDetailEntity detailEntity) {
|
||||
this.updateById(detailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
public void del(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Override
|
||||
public RouteDetailEntity detail(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public PageResult<RouteDetailEntity> paging(PageParam pageParam, RouteDetailEntity detailEntity) {
|
||||
Page<RouteDetailEntity> page = this.page(pageParam.toPage(), Wrappers.<RouteDetailEntity>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(detailEntity.getName()), RouteDetailEntity::getName, detailEntity.getName())
|
||||
.eq(RouteDetailEntity::getDeleted, Boolean.FALSE)
|
||||
.orderByDesc(RouteDetailEntity::getCreateTime));
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.njzscloud.supervisory.route.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
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.order.pojo.entity.OrderExpenseItemsEntity;
|
||||
import com.njzscloud.supervisory.route.mapper.RouteMapper;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
||||
import com.njzscloud.supervisory.route.service.RouteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RouteServiceImpl extends ServiceImpl<RouteMapper, RouteEntity> implements RouteService {
|
||||
|
||||
private final RouteDetailService routeDetailService;
|
||||
|
||||
private final RouteMapper routeMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(RouteEntity routeEntity) {
|
||||
this.save(routeEntity);
|
||||
// 保存详情
|
||||
List<RouteDetailEntity> detailEntityList = routeEntity.getDetailEntityList();
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
for (RouteDetailEntity detailEntity : detailEntityList) {
|
||||
detailEntity.setRouteId(routeEntity.getId());
|
||||
}
|
||||
routeDetailService.saveBatch(detailEntityList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modify(RouteEntity routeEntity) {
|
||||
this.updateById(routeEntity);
|
||||
// 删除原有数据,然后直接新增
|
||||
routeDetailService.remove(Wrappers.<RouteDetailEntity>lambdaQuery()
|
||||
.in(RouteDetailEntity::getRouteId, routeEntity.getId()));
|
||||
List<RouteDetailEntity> detailEntityList = routeEntity.getDetailEntityList();
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
for (RouteDetailEntity detailEntity : detailEntityList) {
|
||||
detailEntity.setRouteId(routeEntity.getId());
|
||||
}
|
||||
routeDetailService.saveBatch(detailEntityList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void del(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
for (Long id : ids) {
|
||||
// 删除详细路线
|
||||
routeDetailService.remove(Wrappers.<RouteDetailEntity>lambdaQuery()
|
||||
.in(RouteDetailEntity::getRouteId, id));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Override
|
||||
public RouteEntity detail(Long id) {
|
||||
RouteEntity entity = routeMapper.selectDetailById(id);
|
||||
List<RouteDetailEntity> detailEntityList = routeDetailService.list(Wrappers.lambdaQuery(RouteDetailEntity.class)
|
||||
.eq(RouteDetailEntity::getRouteId, entity.getId())
|
||||
.orderByAsc(RouteDetailEntity::getSort));
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
entity.setDetailEntityList(detailEntityList);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public PageResult<RouteEntity> paging(PageParam pageParam, RouteEntity routeEntity) {
|
||||
QueryWrapper<RouteEntity> ew = Wrappers.<RouteEntity>query()
|
||||
.eq("a.deleted", 0)
|
||||
.like(StrUtil.isNotBlank(routeEntity.getName()), "a.name", routeEntity.getName())
|
||||
.eq(null != routeEntity.getCompanyId(), "a.company_id", routeEntity.getCompanyId())
|
||||
.eq(null != routeEntity.getStationId(), "a.station_id", routeEntity.getStationId())
|
||||
.eq(null != routeEntity.getProjectId(), "a.project_id", routeEntity.getProjectId());
|
||||
IPage<RouteEntity> page = routeMapper.paging(pageParam.toPage(), ew);
|
||||
for (RouteEntity entity : page.getRecords()) {
|
||||
List<RouteDetailEntity> detailEntityList = routeDetailService.list(Wrappers.lambdaQuery(RouteDetailEntity.class)
|
||||
.eq(RouteDetailEntity::getRouteId, entity.getId()).orderByAsc(RouteDetailEntity::getSort));
|
||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
||||
entity.setDetailEntityList(detailEntityList);
|
||||
}
|
||||
}
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -46,4 +46,9 @@ public class MyResult extends UserDetail {
|
|||
*/
|
||||
private String wechatOpenid;
|
||||
|
||||
/**
|
||||
* 微信授权地址
|
||||
*/
|
||||
private String wxAuthUrl;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,14 @@ import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
|||
import com.njzscloud.supervisory.sys.user.pojo.entity.UserEntity;
|
||||
import com.njzscloud.supervisory.sys.user.pojo.param.UserRegisterParam;
|
||||
import com.njzscloud.supervisory.sys.user.service.UserService;
|
||||
import com.njzscloud.supervisory.wxPay.contant.WxApiConfig;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -92,7 +95,27 @@ public class AuthService implements IUserService, IRoleService {
|
|||
.setEndpoints(endpointResources)
|
||||
.setCompany(company)
|
||||
.setDriver(driver)
|
||||
.setWechatOpenid(wechatOpenid != null ? wechatOpenid : "");
|
||||
.setWechatOpenid(wechatOpenid != null ? wechatOpenid : "")
|
||||
.setWxAuthUrl(wxAuthUrl());
|
||||
}
|
||||
|
||||
public String wxAuthUrl() {
|
||||
// 参数说明
|
||||
// 对回调地址进行URL编码至关重要[citation:1]
|
||||
String redirectUri = null;
|
||||
try {
|
||||
redirectUri = URLEncoder.encode(WxApiConfig.REDIRECT_URI, WxApiConfig.ENC);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 将authUrl返回给前端,引导用户跳转
|
||||
return "https://open.weixin.qq.com/connect/oauth2/authorize?" +
|
||||
"appid=" + WxApiConfig.APP_ID +
|
||||
"&redirect_uri=" + redirectUri +
|
||||
"&response_type=code" +
|
||||
"&scope=" + WxApiConfig.SCOPE +
|
||||
"&state=STATE#wechat_redirect";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.njzscloud.supervisory.biz.constant.BizObj;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||
import com.njzscloud.supervisory.biz.service.BizAuditConfigService;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.station.pojo.entity.StationManageEntity;
|
||||
|
|
@ -102,8 +103,9 @@ public class StationLetterServiceImpl implements StationLetterService {
|
|||
sjAudit.setAuditName("司机待接单");
|
||||
if (BizObj.isDriver(bizObj)) {
|
||||
QueryWrapper<OrderPagingResult> queryWrapper = Wrappers.query();
|
||||
queryWrapper.eq("a.order_status", OrderStatus.DaiJieDan);
|
||||
queryWrapper.eq("f.user_id", userId);
|
||||
queryWrapper.eq("a.order_status", OrderStatus.DaiJieDan)
|
||||
.in("a.order_category", OrderCategory.DuanBoRu, OrderCategory.PuTong)
|
||||
.eq("f.user_id", userId);
|
||||
int sjOrderCount = stationLetterMapper.selectPendingOrderCount(queryWrapper);
|
||||
sjAudit.setCount(sjOrderCount);
|
||||
} else {
|
||||
|
|
@ -117,8 +119,9 @@ public class StationLetterServiceImpl implements StationLetterService {
|
|||
transAudit.setAuditName("清运公司待派单");
|
||||
if (BizObj.isTrans(bizObj)) {
|
||||
QueryWrapper<OrderPagingResult> queryWrapper = Wrappers.query();
|
||||
queryWrapper.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan);
|
||||
queryWrapper.eq("g.user_id", userId);
|
||||
queryWrapper.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan)
|
||||
.in("a.order_category", OrderCategory.DuanBoRu, OrderCategory.PuTong)
|
||||
.eq("g.user_id", userId);
|
||||
int transOrderCount = stationLetterMapper.selectPendingOrderCount(queryWrapper);
|
||||
transAudit.setCount(transOrderCount);
|
||||
} else {
|
||||
|
|
@ -179,7 +182,8 @@ public class StationLetterServiceImpl implements StationLetterService {
|
|||
}
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<OrderPagingResult> queryWrapper = buildOrderQueryWrapper(auditAreaInfo);
|
||||
QueryWrapper<OrderPagingResult> queryWrapper = buildOrderQueryWrapper(auditAreaInfo)
|
||||
.in("a.order_category", OrderCategory.DuanBoRu, OrderCategory.PuTong);
|
||||
int orderCount = stationLetterMapper.selectPendingOrderCount(queryWrapper);
|
||||
orderAudit.setCount(orderCount);
|
||||
|
||||
|
|
@ -197,22 +201,22 @@ public class StationLetterServiceImpl implements StationLetterService {
|
|||
private AuditAreaInfo getAuditAreaInfoByRoles(Set<String> roles) {
|
||||
// 获取区级审核区域
|
||||
List<String> areaList = bizAuditConfigService.list(Wrappers.<BizAuditConfigEntity>lambdaQuery()
|
||||
.in(BizAuditConfigEntity::getAreaRole, roles)).stream()
|
||||
.in(BizAuditConfigEntity::getAreaRole, roles)).stream()
|
||||
.map(BizAuditConfigEntity::getArea)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取市级审核区域
|
||||
List<String> cityList = bizAuditConfigService.list(Wrappers.<BizAuditConfigEntity>lambdaQuery()
|
||||
.in(BizAuditConfigEntity::getCityRole, roles)).stream()
|
||||
.in(BizAuditConfigEntity::getCityRole, roles)).stream()
|
||||
.map(BizAuditConfigEntity::getArea)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取无角色限制的区域
|
||||
List<String> cityAreaList = bizAuditConfigService.list(Wrappers.<BizAuditConfigEntity>lambdaQuery()
|
||||
.isNull(BizAuditConfigEntity::getAreaRole)
|
||||
.isNull(BizAuditConfigEntity::getCityRole)).stream()
|
||||
.isNull(BizAuditConfigEntity::getAreaRole)
|
||||
.isNull(BizAuditConfigEntity::getCityRole)).stream()
|
||||
.map(BizAuditConfigEntity::getArea)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -105,4 +105,14 @@ public class UserController {
|
|||
userService.modifyPasswd(modifyPasswdParam);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@GetMapping("/reset_passwd")
|
||||
public R<?> resetPasswd(@RequestParam("id") Long id) {
|
||||
userService.resetPasswd(id);
|
||||
return R.success(true, "重置成功,新密码:6个6");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,4 +86,9 @@ public class UserEntity {
|
|||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 微信 公众号openid
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.security.util.EncryptUtil;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.AddBizCompanyParam;
|
||||
|
|
@ -187,21 +188,25 @@ public class UserService extends ServiceImpl<UserMapper, UserEntity> implements
|
|||
AddUserParam addUserParam = BeanUtil.copyProperties(userRegisterParam, AddUserParam.class);
|
||||
addUserParam.setAccount(BeanUtil.copyProperties(account, AddUserAccountParam.class));
|
||||
Long userId = this.add(addUserParam);
|
||||
MoneyAccountEntity entity = new MoneyAccountEntity();
|
||||
// if (bizObj == BizObj.GeRen) {
|
||||
// entity.setUserId(userId);
|
||||
// moneyAccountService.add(entity);
|
||||
// return;
|
||||
// }
|
||||
UserRegisterParam.Company company = userRegisterParam.getCompany();
|
||||
Assert.notNull(company, "公司信息不能为空");
|
||||
Long companyId = null;
|
||||
if (!bizObj.isWastePersonal()) {
|
||||
UserRegisterParam.Company company = userRegisterParam.getCompany();
|
||||
Assert.notNull(company, "公司信息不能为空");
|
||||
AddBizCompanyParam addBizCompanyParam = BeanUtil
|
||||
.copyProperties(company, AddBizCompanyParam.class)
|
||||
.setUserId(userId);
|
||||
companyId = bizCompanyService.add(addBizCompanyParam);
|
||||
}
|
||||
|
||||
|
||||
AddBizCompanyParam addBizCompanyParam = BeanUtil
|
||||
.copyProperties(company, AddBizCompanyParam.class)
|
||||
.setUserId(userId);
|
||||
Long companyId = bizCompanyService.add(addBizCompanyParam);
|
||||
// 添加账户信息
|
||||
if (bizObj.isTrans()) {
|
||||
MoneyAccountEntity entity = new MoneyAccountEntity();
|
||||
entity.setStationId(companyId);
|
||||
moneyAccountService.add(entity);
|
||||
}
|
||||
|
|
@ -215,4 +220,9 @@ public class UserService extends ServiceImpl<UserMapper, UserEntity> implements
|
|||
Long userId = SecurityUtil.currentUserId();
|
||||
userAccountService.modifyPasswd(userId, modifyPasswdParam);
|
||||
}
|
||||
|
||||
public void resetPasswd(Long id) {
|
||||
userAccountService.update(Wrappers.<UserAccountEntity>lambdaUpdate().eq(UserAccountEntity::getUserId, id)
|
||||
.set(UserAccountEntity::getSecret, EncryptUtil.encrypt("666666")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.njzscloud.supervisory.wxPay.contant;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 推送类型
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum TempType {
|
||||
TRANS_COMPANY("transCompany", "清运公司"),// 清运公司
|
||||
DRIVER("driver", "司机"), // 司机
|
||||
AUDIT_PENDING("auditPending", "待审核"),
|
||||
AUDIT_OK("auditOk", "审核通过"),
|
||||
AUDIT_REJECT("auditReject", "审核驳回"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.njzscloud.supervisory.wxPay.contant;
|
||||
|
||||
public class TemplateID {
|
||||
|
||||
public static final String TRANS_COMPANY_TEMP_ID = "PAqlS9-hKgKB_Li8Nx4hgMXBp9kOTFrCD_scJtBC1fM";
|
||||
|
||||
public static final String DRIVER_TEMP_ID = "IwHV1nWwu8pO8Ppntyd7KzzV5S00dOEjbsgAFhz9tJM";
|
||||
|
||||
public static final String AUDIT_PENDING = "0SzJv9l51KTvgXvKhQOwifR5pegR3gC1o3IAY8NpEcE";
|
||||
|
||||
public static final String AUDIT_OK = "3peGD6joWVyZ7B29lfJH_gK0oRqharynt0sXlIHE4cg";
|
||||
|
||||
public static final String AUDIT_REJECT = "vDFOJjrB3VNKGIRe5I_LOrfIPDTTdlZoL537CYqjW64";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.njzscloud.supervisory.wxPay.contant;
|
||||
|
||||
public class WxApiConfig {
|
||||
|
||||
public static final String APP_ID = "wxcf5b818c19c51c07";
|
||||
|
||||
public static final String APP_SECRET = "35f72f3d49a9e24c618b82eb624538c8";
|
||||
|
||||
public static final String REDIRECT_URI = "https://supervisory.njzscloud.com/test/bind/index.html";
|
||||
|
||||
public static final String SCOPE = "snsapi_base"; // 静默授权,仅获取OpenID
|
||||
// String scope = "snsapi_userinfo"; // 非静默授权,可获取用户昵称、头像等更多信息[citation:1]
|
||||
|
||||
public static final String ENC = "UTF-8";
|
||||
|
||||
public static final String OAUTH_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?";
|
||||
|
||||
public static final String GET_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=";
|
||||
|
||||
public static final String SEND_TEMPLATE_MSG_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
|
||||
|
||||
public static final String TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.njzscloud.supervisory.wxPay.controller;
|
||||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.supervisory.wxPay.param.TemplateMessageParam;
|
||||
import com.njzscloud.supervisory.wxPay.service.WechatTemplateMessageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 支付相关接口
|
||||
* 使用微信支付官方SDK的生产级实现
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wechatTemplateMessage")
|
||||
@RequiredArgsConstructor
|
||||
public class WechatTemplateMessageController {
|
||||
|
||||
private final WechatTemplateMessageService wechatTemplateMessageService;
|
||||
|
||||
/**
|
||||
* 绑定微信openid
|
||||
*/
|
||||
@GetMapping("/bind")
|
||||
public R<?> bind(@RequestParam String code) {
|
||||
wechatTemplateMessageService.bind(code);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
@GetMapping("/key")
|
||||
public R<?> key(@RequestParam String code) {
|
||||
return R.success(wechatTemplateMessageService.key(code));
|
||||
}
|
||||
|
||||
@PostMapping("/send-order-notice")
|
||||
public String sendOrderNotice(@RequestBody TemplateMessageParam param) {
|
||||
try {
|
||||
// 发送模板消息
|
||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||
return "发送成功";
|
||||
} catch (Exception e) {
|
||||
return "发送失败: " + e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.njzscloud.supervisory.wxPay.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模板数据封装类
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class TemplateData {
|
||||
|
||||
private String value;
|
||||
private String color;
|
||||
|
||||
public TemplateData(String value) {
|
||||
this.value = value;
|
||||
this.color = "#173177";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.njzscloud.supervisory.wxPay.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class TemplateMessageParam {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 推送类型
|
||||
*/
|
||||
private String tempType;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 货物名称
|
||||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 装货地点
|
||||
*/
|
||||
private String startAddress;
|
||||
|
||||
/**
|
||||
* 卸货地点
|
||||
*/
|
||||
private String endAddress;
|
||||
|
||||
/**
|
||||
* 司机名称
|
||||
*/
|
||||
private String driverName;
|
||||
|
||||
/**
|
||||
* 产废单位
|
||||
*/
|
||||
private String cfCompanyName;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String licensePlate;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue