commit 1fa33039728a9bb9fb5c3a12e1245a2c68277d10 Author: esacpe Date: Wed Jul 17 21:04:17 2024 +0800 1 diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..85fa010 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml b/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml new file mode 100644 index 0000000..6fec8f4 --- /dev/null +++ b/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml b/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml new file mode 100644 index 0000000..9eb8596 --- /dev/null +++ b/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__cn_hutool_hutool_all_5_7_20.xml b/.idea/libraries/Maven__cn_hutool_hutool_all_5_7_20.xml new file mode 100644 index 0000000..fa85ae7 --- /dev/null +++ b/.idea/libraries/Maven__cn_hutool_hutool_all_5_7_20.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_alibaba_druid_1_2_8.xml b/.idea/libraries/Maven__com_alibaba_druid_1_2_8.xml new file mode 100644 index 0000000..6b51017 --- /dev/null +++ b/.idea/libraries/Maven__com_alibaba_druid_1_2_8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_alibaba_druid_spring_boot_starter_1_2_8.xml b/.idea/libraries/Maven__com_alibaba_druid_spring_boot_starter_1_2_8.xml new file mode 100644 index 0000000..725a929 --- /dev/null +++ b/.idea/libraries/Maven__com_alibaba_druid_spring_boot_starter_1_2_8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_alibaba_fastjson_1_2_83.xml b/.idea/libraries/Maven__com_alibaba_fastjson_1_2_83.xml new file mode 100644 index 0000000..fb8e949 --- /dev/null +++ b/.idea/libraries/Maven__com_alibaba_fastjson_1_2_83.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_alibaba_transmittable_thread_local_2_11_5.xml b/.idea/libraries/Maven__com_alibaba_transmittable_thread_local_2_11_5.xml new file mode 100644 index 0000000..a34ba45 --- /dev/null +++ b/.idea/libraries/Maven__com_alibaba_transmittable_thread_local_2_11_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_auth0_java_jwt_3_8_1.xml b/.idea/libraries/Maven__com_auth0_java_jwt_3_8_1.xml new file mode 100644 index 0000000..1755ec4 --- /dev/null +++ b/.idea/libraries/Maven__com_auth0_java_jwt_3_8_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_baomidou_mybatis_plus_3_4_3.xml b/.idea/libraries/Maven__com_baomidou_mybatis_plus_3_4_3.xml new file mode 100644 index 0000000..ffb1369 --- /dev/null +++ b/.idea/libraries/Maven__com_baomidou_mybatis_plus_3_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_baomidou_mybatis_plus_annotation_3_4_3.xml b/.idea/libraries/Maven__com_baomidou_mybatis_plus_annotation_3_4_3.xml new file mode 100644 index 0000000..2570725 --- /dev/null +++ b/.idea/libraries/Maven__com_baomidou_mybatis_plus_annotation_3_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_4_3.xml b/.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_4_3.xml new file mode 100644 index 0000000..fd9a3f6 --- /dev/null +++ b/.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_baomidou_mybatis_plus_core_3_4_3.xml b/.idea/libraries/Maven__com_baomidou_mybatis_plus_core_3_4_3.xml new file mode 100644 index 0000000..0e93676 --- /dev/null +++ b/.idea/libraries/Maven__com_baomidou_mybatis_plus_core_3_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_baomidou_mybatis_plus_extension_3_4_3.xml b/.idea/libraries/Maven__com_baomidou_mybatis_plus_extension_3_4_3.xml new file mode 100644 index 0000000..0bdbc71 --- /dev/null +++ b/.idea/libraries/Maven__com_baomidou_mybatis_plus_extension_3_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_belerweb_pinyin4j_2_5_0.xml b/.idea/libraries/Maven__com_belerweb_pinyin4j_2_5_0.xml new file mode 100644 index 0000000..2ca54a7 --- /dev/null +++ b/.idea/libraries/Maven__com_belerweb_pinyin4j_2_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_carrotsearch_thirdparty_simple_xml_safe_2_7_1.xml b/.idea/libraries/Maven__com_carrotsearch_thirdparty_simple_xml_safe_2_7_1.xml new file mode 100644 index 0000000..a918945 --- /dev/null +++ b/.idea/libraries/Maven__com_carrotsearch_thirdparty_simple_xml_safe_2_7_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml b/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml new file mode 100644 index 0000000..33c30b4 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_1.xml new file mode 100644 index 0000000..3aa8175 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_2.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_2.xml new file mode 100644 index 0000000..6447563 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_4_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_4_3.xml new file mode 100644 index 0000000..42a8d5b --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_7.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_7.xml new file mode 100644 index 0000000..45dbb56 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml new file mode 100644 index 0000000..06441f4 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_1.xml new file mode 100644 index 0000000..bd0d979 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_2.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_2.xml new file mode 100644 index 0000000..4923956 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_11_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_4_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_4_3.xml new file mode 100644 index 0000000..fc3ea3f --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml new file mode 100644 index 0000000..55b3f7b --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_11_1.xml new file mode 100644 index 0000000..08c0010 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_4_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_4_3.xml new file mode 100644 index 0000000..567d7e5 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9.xml new file mode 100644 index 0000000..b007cab --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_11_1.xml new file mode 100644 index 0000000..27241b7 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_1.xml new file mode 100644 index 0000000..ea31a53 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_1.xml new file mode 100644 index 0000000..50b2736 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_1.xml new file mode 100644 index 0000000..6eac973 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_caspar_chen_swagger_ui_layer_1_1_3.xml b/.idea/libraries/Maven__com_github_caspar_chen_swagger_ui_layer_1_1_3.xml new file mode 100644 index 0000000..fc5a467 --- /dev/null +++ b/.idea/libraries/Maven__com_github_caspar_chen_swagger_ui_layer_1_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_4_2.xml b/.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_4_2.xml new file mode 100644 index 0000000..87f32d8 --- /dev/null +++ b/.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_4_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_pagehelper_pagehelper_5_3_0.xml b/.idea/libraries/Maven__com_github_pagehelper_pagehelper_5_3_0.xml new file mode 100644 index 0000000..798310e --- /dev/null +++ b/.idea/libraries/Maven__com_github_pagehelper_pagehelper_5_3_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_penggle_kaptcha_2_3_2.xml b/.idea/libraries/Maven__com_github_penggle_kaptcha_2_3_2.xml new file mode 100644 index 0000000..bc88169 --- /dev/null +++ b/.idea/libraries/Maven__com_github_penggle_kaptcha_2_3_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_virtuald_curvesapi_1_06.xml b/.idea/libraries/Maven__com_github_virtuald_curvesapi_1_06.xml new file mode 100644 index 0000000..d156c18 --- /dev/null +++ b/.idea/libraries/Maven__com_github_virtuald_curvesapi_1_06.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml new file mode 100644 index 0000000..1c380d0 --- /dev/null +++ b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml b/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml new file mode 100644 index 0000000..848cecd --- /dev/null +++ b/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml b/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml new file mode 100644 index 0000000..36e948e --- /dev/null +++ b/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml b/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml new file mode 100644 index 0000000..f349d63 --- /dev/null +++ b/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml b/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml new file mode 100644 index 0000000..4e15702 --- /dev/null +++ b/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml b/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml new file mode 100644 index 0000000..bacaa45 --- /dev/null +++ b/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_jhlabs_filters_2_0_235_1.xml b/.idea/libraries/Maven__com_jhlabs_filters_2_0_235_1.xml new file mode 100644 index 0000000..f674d8e --- /dev/null +++ b/.idea/libraries/Maven__com_jhlabs_filters_2_0_235_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_netflix_archaius_archaius_core_0_7_6.xml b/.idea/libraries/Maven__com_netflix_archaius_archaius_core_0_7_6.xml new file mode 100644 index 0000000..bd9061c --- /dev/null +++ b/.idea/libraries/Maven__com_netflix_archaius_archaius_core_0_7_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_netflix_feign_feign_core_8_14_4.xml b/.idea/libraries/Maven__com_netflix_feign_feign_core_8_14_4.xml new file mode 100644 index 0000000..d977a58 --- /dev/null +++ b/.idea/libraries/Maven__com_netflix_feign_feign_core_8_14_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_netflix_feign_feign_slf4j_8_14_4.xml b/.idea/libraries/Maven__com_netflix_feign_feign_slf4j_8_14_4.xml new file mode 100644 index 0000000..7b9a4b5 --- /dev/null +++ b/.idea/libraries/Maven__com_netflix_feign_feign_slf4j_8_14_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_netflix_hystrix_hystrix_core_1_5_18.xml b/.idea/libraries/Maven__com_netflix_hystrix_hystrix_core_1_5_18.xml new file mode 100644 index 0000000..588dca0 --- /dev/null +++ b/.idea/libraries/Maven__com_netflix_hystrix_hystrix_core_1_5_18.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_squareup_okhttp3_okhttp_4_8_1.xml b/.idea/libraries/Maven__com_squareup_okhttp3_okhttp_4_8_1.xml new file mode 100644 index 0000000..5b88b8a --- /dev/null +++ b/.idea/libraries/Maven__com_squareup_okhttp3_okhttp_4_8_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_squareup_okio_okio_2_7_0.xml b/.idea/libraries/Maven__com_squareup_okio_okio_2_7_0.xml new file mode 100644 index 0000000..95fd78d --- /dev/null +++ b/.idea/libraries/Maven__com_squareup_okio_okio_2_7_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_vividsolutions_jts_1_13.xml b/.idea/libraries/Maven__com_vividsolutions_jts_1_13.xml new file mode 100644 index 0000000..b7e360b --- /dev/null +++ b/.idea/libraries/Maven__com_vividsolutions_jts_1_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_zaxxer_HikariCP_3_4_5.xml b/.idea/libraries/Maven__com_zaxxer_HikariCP_3_4_5.xml new file mode 100644 index 0000000..97e2291 --- /dev/null +++ b/.idea/libraries/Maven__com_zaxxer_HikariCP_3_4_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml b/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml new file mode 100644 index 0000000..9314c36 --- /dev/null +++ b/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_zaxxer_SparseBitSet_1_2.xml b/.idea/libraries/Maven__com_zaxxer_SparseBitSet_1_2.xml new file mode 100644 index 0000000..6ce4aae --- /dev/null +++ b/.idea/libraries/Maven__com_zaxxer_SparseBitSet_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml new file mode 100644 index 0000000..84eb115 --- /dev/null +++ b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_codec_commons_codec_1_12.xml b/.idea/libraries/Maven__commons_codec_commons_codec_1_12.xml new file mode 100644 index 0000000..0953394 --- /dev/null +++ b/.idea/libraries/Maven__commons_codec_commons_codec_1_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml b/.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml new file mode 100644 index 0000000..5384f7a --- /dev/null +++ b/.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml new file mode 100644 index 0000000..13afda2 --- /dev/null +++ b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_configuration_commons_configuration_1_8.xml b/.idea/libraries/Maven__commons_configuration_commons_configuration_1_8.xml new file mode 100644 index 0000000..772d6fe --- /dev/null +++ b/.idea/libraries/Maven__commons_configuration_commons_configuration_1_8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_4.xml b/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_4.xml new file mode 100644 index 0000000..3b9dcc0 --- /dev/null +++ b/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_io_commons_io_2_2.xml b/.idea/libraries/Maven__commons_io_commons_io_2_2.xml new file mode 100644 index 0000000..f8084ec --- /dev/null +++ b/.idea/libraries/Maven__commons_io_commons_io_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_io_commons_io_2_7.xml b/.idea/libraries/Maven__commons_io_commons_io_2_7.xml new file mode 100644 index 0000000..ded72c9 --- /dev/null +++ b/.idea/libraries/Maven__commons_io_commons_io_2_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml b/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml new file mode 100644 index 0000000..2ec8376 --- /dev/null +++ b/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml b/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml new file mode 100644 index 0000000..b770f56 --- /dev/null +++ b/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml new file mode 100644 index 0000000..eab40b3 --- /dev/null +++ b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_github_openfeign_feign_core_10_10_1.xml b/.idea/libraries/Maven__io_github_openfeign_feign_core_10_10_1.xml new file mode 100644 index 0000000..efc64b2 --- /dev/null +++ b/.idea/libraries/Maven__io_github_openfeign_feign_core_10_10_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_github_openfeign_feign_hystrix_10_10_1.xml b/.idea/libraries/Maven__io_github_openfeign_feign_hystrix_10_10_1.xml new file mode 100644 index 0000000..11bde67 --- /dev/null +++ b/.idea/libraries/Maven__io_github_openfeign_feign_hystrix_10_10_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_github_openfeign_form_feign_form_3_8_0.xml b/.idea/libraries/Maven__io_github_openfeign_form_feign_form_3_8_0.xml new file mode 100644 index 0000000..0534476 --- /dev/null +++ b/.idea/libraries/Maven__io_github_openfeign_form_feign_form_3_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_github_openfeign_form_feign_form_spring_3_8_0.xml b/.idea/libraries/Maven__io_github_openfeign_form_feign_form_spring_3_8_0.xml new file mode 100644 index 0000000..47e101e --- /dev/null +++ b/.idea/libraries/Maven__io_github_openfeign_form_feign_form_spring_3_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_lettuce_lettuce_core_5_3_0_RELEASE.xml b/.idea/libraries/Maven__io_lettuce_lettuce_core_5_3_0_RELEASE.xml new file mode 100644 index 0000000..778f95d --- /dev/null +++ b/.idea/libraries/Maven__io_lettuce_lettuce_core_5_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_micrometer_micrometer_core_1_5_1.xml b/.idea/libraries/Maven__io_micrometer_micrometer_core_1_5_1.xml new file mode 100644 index 0000000..0db69cb --- /dev/null +++ b/.idea/libraries/Maven__io_micrometer_micrometer_core_1_5_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_minio_minio_8_0_3.xml b/.idea/libraries/Maven__io_minio_minio_8_0_3.xml new file mode 100644 index 0000000..c8743c4 --- /dev/null +++ b/.idea/libraries/Maven__io_minio_minio_8_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_buffer_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_49_Final.xml new file mode 100644 index 0000000..9247b16 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_buffer_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_51_Final.xml new file mode 100644 index 0000000..68df79d --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_codec_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_codec_4_1_49_Final.xml new file mode 100644 index 0000000..a3b1c84 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_codec_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_codec_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_codec_4_1_51_Final.xml new file mode 100644 index 0000000..62ec8c2 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_codec_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_codec_dns_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_codec_dns_4_1_51_Final.xml new file mode 100644 index 0000000..684d838 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_codec_dns_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_common_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_common_4_1_49_Final.xml new file mode 100644 index 0000000..0219231 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_common_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_common_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_common_4_1_51_Final.xml new file mode 100644 index 0000000..36e612e --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_common_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_handler_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_handler_4_1_49_Final.xml new file mode 100644 index 0000000..00e798d --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_handler_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_handler_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_handler_4_1_51_Final.xml new file mode 100644 index 0000000..fb10871 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_handler_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_resolver_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_49_Final.xml new file mode 100644 index 0000000..a080e6b --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_resolver_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_51_Final.xml new file mode 100644 index 0000000..0281c5e --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_resolver_dns_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_resolver_dns_4_1_51_Final.xml new file mode 100644 index 0000000..2b6768c --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_resolver_dns_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_transport_4_1_49_Final.xml b/.idea/libraries/Maven__io_netty_netty_transport_4_1_49_Final.xml new file mode 100644 index 0000000..f0b7741 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_transport_4_1_49_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_transport_4_1_51_Final.xml b/.idea/libraries/Maven__io_netty_netty_transport_4_1_51_Final.xml new file mode 100644 index 0000000..425736e --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_transport_4_1_51_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_4_RELEASE.xml b/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_4_RELEASE.xml new file mode 100644 index 0000000..eb81c2f --- /dev/null +++ b/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_4_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_5_RELEASE.xml b/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_5_RELEASE.xml new file mode 100644 index 0000000..a5baba9 --- /dev/null +++ b/.idea/libraries/Maven__io_projectreactor_reactor_core_3_3_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_2_2_19.xml b/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_2_2_19.xml new file mode 100644 index 0000000..4b5c378 --- /dev/null +++ b/.idea/libraries/Maven__io_reactivex_rxjava2_rxjava_2_2_19.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_reactivex_rxjava_1_2_0.xml b/.idea/libraries/Maven__io_reactivex_rxjava_1_2_0.xml new file mode 100644 index 0000000..27eb537 --- /dev/null +++ b/.idea/libraries/Maven__io_reactivex_rxjava_1_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_core_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_core_2_8_0.xml new file mode 100644 index 0000000..64855d8 --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_core_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_schema_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_schema_2_8_0.xml new file mode 100644 index 0000000..c271a62 --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_schema_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_spi_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_spi_2_8_0.xml new file mode 100644 index 0000000..c43a6ab --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_spi_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_8_0.xml new file mode 100644 index 0000000..5060ed3 --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_8_0.xml new file mode 100644 index 0000000..3838245 --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_8_0.xml new file mode 100644 index 0000000..830eefd --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_8_0.xml b/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_8_0.xml new file mode 100644 index 0000000..bd002c8 --- /dev/null +++ b/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_14.xml b/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_14.xml new file mode 100644 index 0000000..ffd56aa --- /dev/null +++ b/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_14.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_swagger_swagger_models_1_5_14.xml b/.idea/libraries/Maven__io_swagger_swagger_models_1_5_14.xml new file mode 100644 index 0000000..000ff27 --- /dev/null +++ b/.idea/libraries/Maven__io_swagger_swagger_models_1_5_14.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml b/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml new file mode 100644 index 0000000..cba9dd2 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_validation_jakarta_validation_api_2_0_2.xml b/.idea/libraries/Maven__jakarta_validation_jakarta_validation_api_2_0_2.xml new file mode 100644 index 0000000..e66afb9 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_validation_jakarta_validation_api_2_0_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml b/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml new file mode 100644 index 0000000..e74f3ab --- /dev/null +++ b/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_cache_cache_api_1_0_0.xml b/.idea/libraries/Maven__javax_cache_cache_api_1_0_0.xml new file mode 100644 index 0000000..4ff335f --- /dev/null +++ b/.idea/libraries/Maven__javax_cache_cache_api_1_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml new file mode 100644 index 0000000..c24f7e3 --- /dev/null +++ b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_7.xml b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_7.xml new file mode 100644 index 0000000..5589596 --- /dev/null +++ b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_9.xml b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_9.xml new file mode 100644 index 0000000..22f4f74 --- /dev/null +++ b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_sf_ehcache_ehcache_core_2_6_11.xml b/.idea/libraries/Maven__net_sf_ehcache_ehcache_core_2_6_11.xml new file mode 100644 index 0000000..1c71163 --- /dev/null +++ b/.idea/libraries/Maven__net_sf_ehcache_ehcache_core_2_6_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_collections4_4_4.xml b/.idea/libraries/Maven__org_apache_commons_commons_collections4_4_4.xml new file mode 100644 index 0000000..5871c95 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_collections4_4_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_compress_1_19.xml b/.idea/libraries/Maven__org_apache_commons_commons_compress_1_19.xml new file mode 100644 index 0000000..7c25fef --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_compress_1_19.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_12_0.xml b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_12_0.xml new file mode 100644 index 0000000..28b8682 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_12_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_math3_3_6_1.xml b/.idea/libraries/Maven__org_apache_commons_commons_math3_3_6_1.xml new file mode 100644 index 0000000..ebfe0a8 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_math3_3_6_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_text_1_6.xml b/.idea/libraries/Maven__org_apache_commons_commons_text_1_6.xml new file mode 100644 index 0000000..5a2fa29 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_text_1_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_12.xml b/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_12.xml new file mode 100644 index 0000000..9cb68a2 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_13.xml b/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_13.xml new file mode 100644 index 0000000..b475675 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_2.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_2.xml new file mode 100644 index 0000000..35caff2 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_3.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_3.xml new file mode 100644 index 0000000..8ad4996 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_13_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_2.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_2.xml new file mode 100644 index 0000000..5788de2 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_3.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_3.xml new file mode 100644 index 0000000..57e6ac4 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_poi_poi_4_1_2.xml b/.idea/libraries/Maven__org_apache_poi_poi_4_1_2.xml new file mode 100644 index 0000000..c706d5b --- /dev/null +++ b/.idea/libraries/Maven__org_apache_poi_poi_4_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_poi_poi_ooxml_4_1_2.xml b/.idea/libraries/Maven__org_apache_poi_poi_ooxml_4_1_2.xml new file mode 100644 index 0000000..905ca0c --- /dev/null +++ b/.idea/libraries/Maven__org_apache_poi_poi_ooxml_4_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_4_1_2.xml b/.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_4_1_2.xml new file mode 100644 index 0000000..93d965d --- /dev/null +++ b/.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_4_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_cache_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_cache_1_8_0.xml new file mode 100644 index 0000000..5272a36 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_cache_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_config_core_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_config_core_1_8_0.xml new file mode 100644 index 0000000..4578d1b --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_config_core_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_config_ogdl_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_config_ogdl_1_8_0.xml new file mode 100644 index 0000000..e699787 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_config_ogdl_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_core_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_core_1_8_0.xml new file mode 100644 index 0000000..aa3fdcf --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_core_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_cipher_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_cipher_1_8_0.xml new file mode 100644 index 0000000..77a90b8 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_cipher_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_core_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_core_1_8_0.xml new file mode 100644 index 0000000..dddd497 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_core_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_hash_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_hash_1_8_0.xml new file mode 100644 index 0000000..ece1eae --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_crypto_hash_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_ehcache_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_ehcache_1_8_0.xml new file mode 100644 index 0000000..c1049dc --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_ehcache_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_event_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_event_1_8_0.xml new file mode 100644 index 0000000..b7a65df --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_event_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_shiro_shiro_lang_1_8_0.xml b/.idea/libraries/Maven__org_apache_shiro_shiro_lang_1_8_0.xml new file mode 100644 index 0000000..499eb00 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_shiro_shiro_lang_1_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_37.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_37.xml new file mode 100644 index 0000000..7e39935 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_37.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_37.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_37.xml new file mode 100644 index 0000000..6a30056 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_37.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_velocity_velocity_engine_core_2_3.xml b/.idea/libraries/Maven__org_apache_velocity_velocity_engine_core_2_3.xml new file mode 100644 index 0000000..ea2816e --- /dev/null +++ b/.idea/libraries/Maven__org_apache_velocity_velocity_engine_core_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_3_1_0.xml b/.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_3_1_0.xml new file mode 100644 index 0000000..0695d4b --- /dev/null +++ b/.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_3_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_6.xml b/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_6.xml new file mode 100644 index 0000000..d0ca705 --- /dev/null +++ b/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml b/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml new file mode 100644 index 0000000..6d622d2 --- /dev/null +++ b/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_glassfish_jakarta_el_3_0_3.xml b/.idea/libraries/Maven__org_glassfish_jakarta_el_3_0_3.xml new file mode 100644 index 0000000..ae5020d --- /dev/null +++ b/.idea/libraries/Maven__org_glassfish_jakarta_el_3_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml new file mode 100644 index 0000000..6908885 --- /dev/null +++ b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml new file mode 100644 index 0000000..04cc804 --- /dev/null +++ b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_1_5_Final.xml b/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_1_5_Final.xml new file mode 100644 index 0000000..6d045ad --- /dev/null +++ b/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_1_5_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_javassist_javassist_3_21_0_GA.xml b/.idea/libraries/Maven__org_javassist_javassist_3_21_0_GA.xml new file mode 100644 index 0000000..09c4cf0 --- /dev/null +++ b/.idea/libraries/Maven__org_javassist_javassist_3_21_0_GA.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml new file mode 100644 index 0000000..5f7dd01 --- /dev/null +++ b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_2_0_9_Final.xml b/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_2_0_9_Final.xml new file mode 100644 index 0000000..ee45f31 --- /dev/null +++ b/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_2_0_9_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_river_2_0_9_Final.xml b/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_river_2_0_9_Final.xml new file mode 100644 index 0000000..9f3ba0d --- /dev/null +++ b/.idea/libraries/Maven__org_jboss_marshalling_jboss_marshalling_river_2_0_9_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..e2c8297 --- /dev/null +++ b/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_1_3_72.xml b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_1_3_72.xml new file mode 100644 index 0000000..3b29150 --- /dev/null +++ b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_1_3_72.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_70.xml b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_70.xml new file mode 100644 index 0000000..bbe5288 --- /dev/null +++ b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_70.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jodd_jodd_bean_5_0_13.xml b/.idea/libraries/Maven__org_jodd_jodd_bean_5_0_13.xml new file mode 100644 index 0000000..33b8f60 --- /dev/null +++ b/.idea/libraries/Maven__org_jodd_jodd_bean_5_0_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jodd_jodd_core_5_0_13.xml b/.idea/libraries/Maven__org_jodd_jodd_core_5_0_13.xml new file mode 100644 index 0000000..735d215 --- /dev/null +++ b/.idea/libraries/Maven__org_jodd_jodd_core_5_0_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_latencyutils_LatencyUtils_2_0_3.xml b/.idea/libraries/Maven__org_latencyutils_LatencyUtils_2_0_3.xml new file mode 100644 index 0000000..bf68169 --- /dev/null +++ b/.idea/libraries/Maven__org_latencyutils_LatencyUtils_2_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml b/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml new file mode 100644 index 0000000..87cb599 --- /dev/null +++ b/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mybatis_mybatis_3_5_7.xml b/.idea/libraries/Maven__org_mybatis_mybatis_3_5_7.xml new file mode 100644 index 0000000..fab1459 --- /dev/null +++ b/.idea/libraries/Maven__org_mybatis_mybatis_3_5_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml b/.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml new file mode 100644 index 0000000..a359305 --- /dev/null +++ b/.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_0.xml b/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_0.xml new file mode 100644 index 0000000..879dc41 --- /dev/null +++ b/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_0.xml b/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_0.xml new file mode 100644 index 0000000..8161289 --- /dev/null +++ b/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_projectlombok_lombok_1_16_18.xml b/.idea/libraries/Maven__org_projectlombok_lombok_1_16_18.xml new file mode 100644 index 0000000..8503cb4 --- /dev/null +++ b/.idea/libraries/Maven__org_projectlombok_lombok_1_16_18.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_projectlombok_lombok_1_18_8.xml b/.idea/libraries/Maven__org_projectlombok_lombok_1_18_8.xml new file mode 100644 index 0000000..9843fa4 --- /dev/null +++ b/.idea/libraries/Maven__org_projectlombok_lombok_1_18_8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml b/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml new file mode 100644 index 0000000..f17253b --- /dev/null +++ b/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_redisson_redisson_3_13_3.xml b/.idea/libraries/Maven__org_redisson_redisson_3_13_3.xml new file mode 100644 index 0000000..fae323d --- /dev/null +++ b/.idea/libraries/Maven__org_redisson_redisson_3_13_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_redisson_redisson_spring_boot_starter_3_13_3.xml b/.idea/libraries/Maven__org_redisson_redisson_spring_boot_starter_3_13_3.xml new file mode 100644 index 0000000..009c3e8 --- /dev/null +++ b/.idea/libraries/Maven__org_redisson_redisson_spring_boot_starter_3_13_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_redisson_redisson_spring_data_23_3_13_3.xml b/.idea/libraries/Maven__org_redisson_redisson_spring_data_23_3_13_3.xml new file mode 100644 index 0000000..e16ba79 --- /dev/null +++ b/.idea/libraries/Maven__org_redisson_redisson_spring_data_23_3_13_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_reflections_reflections_0_9_11.xml b/.idea/libraries/Maven__org_reflections_reflections_0_9_11.xml new file mode 100644 index 0000000..d8b2fb5 --- /dev/null +++ b/.idea/libraries/Maven__org_reflections_reflections_0_9_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_30.xml b/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_30.xml new file mode 100644 index 0000000..27229ce --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_30.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_13.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_13.xml new file mode 100644 index 0000000..4fd913d --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml new file mode 100644 index 0000000..20e8163 --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml new file mode 100644 index 0000000..6545f77 --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml new file mode 100644 index 0000000..02b6812 --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_0_RELEASE.xml new file mode 100644 index 0000000..90f25ec --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_2_RELEASE.xml new file mode 100644 index 0000000..158ddd9 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_2_3_0_RELEASE.xml new file mode 100644 index 0000000..4eaf24b --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_autoconfigure_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_autoconfigure_2_3_0_RELEASE.xml new file mode 100644 index 0000000..304d350 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_autoconfigure_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_12_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_12_RELEASE.xml new file mode 100644 index 0000000..45fdc55 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_12_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_0_RELEASE.xml new file mode 100644 index 0000000..04b7e81 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_2_RELEASE.xml new file mode 100644 index 0000000..d547da6 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_4_5.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_4_5.xml new file mode 100644 index 0000000..3f8b8a7 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_4_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_0_RELEASE.xml new file mode 100644 index 0000000..cad03dc --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_2_RELEASE.xml new file mode 100644 index 0000000..0cfdca9 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_actuator_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_actuator_2_3_0_RELEASE.xml new file mode 100644 index 0000000..c2ad696 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_actuator_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_3_2_RELEASE.xml new file mode 100644 index 0000000..3a5b31d --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_3_0_RELEASE.xml new file mode 100644 index 0000000..59fabda --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_4_5.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_4_5.xml new file mode 100644 index 0000000..ab882ae --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_4_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_0.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_0.xml new file mode 100644 index 0000000..5206606 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_3_2_RELEASE.xml new file mode 100644 index 0000000..b2bec55 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_0_RELEASE.xml new file mode 100644 index 0000000..b4b9a36 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_2_RELEASE.xml new file mode 100644 index 0000000..30cfcb1 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_2_RELEASE.xml new file mode 100644 index 0000000..2aed09e --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_validation_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_validation_2_3_2_RELEASE.xml new file mode 100644 index 0000000..a04fca2 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_validation_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_3_2_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_3_2_RELEASE.xml new file mode 100644 index 0000000..af10dc8 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_3_2_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_4_5.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_4_5.xml new file mode 100644 index 0000000..bd16337 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_4_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_archaius_2_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_archaius_2_2_5_RELEASE.xml new file mode 100644 index 0000000..1f971e4 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_archaius_2_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_ribbon_2_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_ribbon_2_2_5_RELEASE.xml new file mode 100644 index 0000000..eccd43a --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_netflix_ribbon_2_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_openfeign_core_2_2_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_openfeign_core_2_2_5_RELEASE.xml new file mode 100644 index 0000000..a02663e --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_cloud_spring_cloud_openfeign_core_2_2_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_3_0_RELEASE.xml new file mode 100644 index 0000000..8e81cfb --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_3_0_RELEASE.xml new file mode 100644 index 0000000..1052151 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_3_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_3_0_RELEASE.xml new file mode 100644 index 0000000..b9546e7 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_3_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml new file mode 100644 index 0000000..fbc0452 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml b/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml new file mode 100644 index 0000000..7e6f096 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_aop_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_aop_5_2_6_RELEASE.xml new file mode 100644 index 0000000..e31c2b2 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_aop_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_aop_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_aop_5_2_8_RELEASE.xml new file mode 100644 index 0000000..000f9ff --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_aop_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_4_0_9_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_beans_4_0_9_RELEASE.xml new file mode 100644 index 0000000..f98ea8c --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_4_0_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_beans_5_2_8_RELEASE.xml new file mode 100644 index 0000000..ca7aa33 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_6.xml new file mode 100644 index 0000000..49a8b7f --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_5_3_7.xml b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_7.xml new file mode 100644 index 0000000..eca6183 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_context_4_0_9_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_context_4_0_9_RELEASE.xml new file mode 100644 index 0000000..802cb82 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_context_4_0_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_context_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_context_5_2_8_RELEASE.xml new file mode 100644 index 0000000..3194e8e --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_context_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_context_support_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_context_support_5_2_6_RELEASE.xml new file mode 100644 index 0000000..4a53bcf --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_context_support_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_core_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_core_5_2_6_RELEASE.xml new file mode 100644 index 0000000..44ad8a8 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_core_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_core_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_core_5_2_8_RELEASE.xml new file mode 100644 index 0000000..e7d5de5 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_core_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_core_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_core_5_3_6.xml new file mode 100644 index 0000000..33a8f45 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_core_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_expression_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_expression_5_2_8_RELEASE.xml new file mode 100644 index 0000000..2d2456d --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_expression_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_6_RELEASE.xml new file mode 100644 index 0000000..b148bc1 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_8_RELEASE.xml new file mode 100644 index 0000000..4fea859 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jcl_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_6.xml new file mode 100644 index 0000000..005d9a6 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_6.xml new file mode 100644 index 0000000..17ca07b --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_7.xml b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_7.xml new file mode 100644 index 0000000..235b6d5 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_6.xml new file mode 100644 index 0000000..0aa1739 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_oxm_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_oxm_5_2_6_RELEASE.xml new file mode 100644 index 0000000..5cfaf2a --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_oxm_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_tx_5_2_6_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_tx_5_2_6_RELEASE.xml new file mode 100644 index 0000000..a77080c --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_tx_5_2_6_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_tx_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_6.xml new file mode 100644 index 0000000..ce9d784 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_tx_5_3_7.xml b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_7.xml new file mode 100644 index 0000000..765d963 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_web_5_1_5_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_web_5_1_5_RELEASE.xml new file mode 100644 index 0000000..b8a2414 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_web_5_1_5_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_web_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_web_5_2_8_RELEASE.xml new file mode 100644 index 0000000..ae46cf0 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_web_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_webmvc_5_2_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_spring_webmvc_5_2_8_RELEASE.xml new file mode 100644 index 0000000..d584e24 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_webmvc_5_2_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_6.xml b/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_6.xml new file mode 100644 index 0000000..6940ffa --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ssssssss_magic_api_2_0_1.xml b/.idea/libraries/Maven__org_ssssssss_magic_api_2_0_1.xml new file mode 100644 index 0000000..d22b326 --- /dev/null +++ b/.idea/libraries/Maven__org_ssssssss_magic_api_2_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ssssssss_magic_api_plugin_swagger_2_0_1.xml b/.idea/libraries/Maven__org_ssssssss_magic_api_plugin_swagger_2_0_1.xml new file mode 100644 index 0000000..58fbee2 --- /dev/null +++ b/.idea/libraries/Maven__org_ssssssss_magic_api_plugin_swagger_2_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ssssssss_magic_api_spring_boot_starter_2_0_1.xml b/.idea/libraries/Maven__org_ssssssss_magic_api_spring_boot_starter_2_0_1.xml new file mode 100644 index 0000000..be2a716 --- /dev/null +++ b/.idea/libraries/Maven__org_ssssssss_magic_api_spring_boot_starter_2_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ssssssss_magic_editor_2_0_1.xml b/.idea/libraries/Maven__org_ssssssss_magic_editor_2_0_1.xml new file mode 100644 index 0000000..5eedcb2 --- /dev/null +++ b/.idea/libraries/Maven__org_ssssssss_magic_editor_2_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ssssssss_magic_script_1_8_5.xml b/.idea/libraries/Maven__org_ssssssss_magic_script_1_8_5.xml new file mode 100644 index 0000000..87ef154 --- /dev/null +++ b/.idea/libraries/Maven__org_ssssssss_magic_script_1_8_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml b/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml new file mode 100644 index 0000000..e998675 --- /dev/null +++ b/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4361200 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0671122 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5259ae3 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + jr + + + + + + + + 1721098449559 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-base-starter/common-base-starter.iml b/common-base-starter/common-base-starter.iml new file mode 100644 index 0000000..7ef687b --- /dev/null +++ b/common-base-starter/common-base-starter.iml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-base-starter/pom.xml b/common-base-starter/pom.xml new file mode 100644 index 0000000..112cc3e --- /dev/null +++ b/common-base-starter/pom.xml @@ -0,0 +1,187 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-base-starter + 1.0.0-SNAPSHOT + + + 8 + 8 + 3.13.3 + 2.8.0 + + + + + + org.apache.velocity + velocity-engine-core + 2.3 + + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + com.github.caspar-chen + swagger-ui-layer + 1.1.3 + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + + + cn.hutool + hutool-all + 5.7.20 + + + com.belerweb + pinyin4j + 2.5.0 + + + + com.alibaba + fastjson + ${fastjson.version} + + + org.apache.commons + commons-lang3 + 3.12.0 + + + com.google.guava + guava + 29.0-jre + + + org.projectlombok + lombok + 1.18.8 + + + com.alibaba + transmittable-thread-local + 2.11.5 + + + org.redisson + redisson-spring-boot-starter + ${redisson.version} + true + + + org.springframework.boot + spring-boot-starter-aop + ${spring-boot-dependencies.version} + + + com.github.pagehelper + pagehelper + 5.3.0 + compile + + + jakarta.validation + jakarta.validation-api + 2.0.2 + compile + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.3 + + + com.baomidou + mybatis-plus-extension + 3.4.3 + + + + + org.apache.poi + poi-ooxml + 4.1.2 + + + + org.apache.poi + poi + 4.1.2 + + + + com.mosty + common-redis-starter + 1.0.0-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + true + + + + compile + + jar + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/Desensitization.java b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/Desensitization.java new file mode 100644 index 0000000..18fa8e6 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/Desensitization.java @@ -0,0 +1,113 @@ +package com.mosty.common.base.autoconfig; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; + +/** + * 脱敏类 + * @author kevin + * @date 2022/3/8 11:10 PM + * @since 1.0.0 + */ +@SuppressWarnings("unused") +public class Desensitization { + + /** + * 手机类型脱敏 + * @author kevin + * @date 2022/3/8 11:13 PM + * @since 1.0.0 + */ + public static class Phone extends JsonSerializer { + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeObject(value); + return; + } + String trim = value.trim(); + if (trim.length() == 11) { + String phone = trim.replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"); + jsonGenerator.writeObject(phone); + return; + } + jsonGenerator.writeObject(value); + } + } + + /** + * 银行卡号类型脱敏 + * @author kevin + * @date 2022/3/8 11:13 PM + * @since 1.0.0 + */ + public static class BankCard extends JsonSerializer { + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeObject(value); + return; + } + String trim = value.trim(); + String phone = trim.replaceAll("(\\d{6})\\d*(\\d{4})", "$1****$2"); + jsonGenerator.writeObject(phone); + } + } + + /** + * 身份证号类型脱敏 + * @author kevin + * @date 2022/3/8 11:13 PM + * @since 1.0.0 + */ + public static class IdentityCard extends JsonSerializer { + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeObject(value); + return; + } + String trim = value.trim(); + String phone = trim.replaceAll("(\\d{6})\\d*(\\w{4})", "$1****$2"); + jsonGenerator.writeObject(phone); + } + } + + /** + * 姓名类型脱敏 + * @author kevin + * @date 2022/3/8 11:13 PM + * @since 1.0.0 + */ + public static class FullName extends JsonSerializer { + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value) || value.length() == 1 || value.trim().length() == 1) { + jsonGenerator.writeObject(value); + return; + } + String trim = value.trim(); + if (trim.length() == 2) { + jsonGenerator.writeObject(value.charAt(0) + "*"); + return; + } + StringBuilder stringBuffer = new StringBuilder(); + for (int i = 0; i < value.length(); i++) { + if (i == 0 || i == value.length() - 1) { + stringBuffer.append(value.charAt(i)); + } else { + stringBuffer.append("*"); + } + } + jsonGenerator.writeObject(stringBuffer.toString()); + } + } + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/JacksonCustomizerConfig.java b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/JacksonCustomizerConfig.java new file mode 100644 index 0000000..a2b95fb --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/JacksonCustomizerConfig.java @@ -0,0 +1,88 @@ +//package com.mosty.common.base.autoconfig; +// +//import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +//import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +//import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer; +//import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +//import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +//import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.lang3.StringUtils; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.core.convert.converter.Converter; +//import org.springframework.stereotype.Component; +// +//import java.time.LocalDate; +//import java.time.LocalDateTime; +//import java.time.LocalTime; +//import java.time.format.DateTimeFormatter; +// +///** +// * 全局: 序列化,反序列化,格式处理 +// * @author kevin +// * @date 2022/3/28 2:37 PM +// * @since 1.0.0 +// */ +//@Slf4j +//@Configuration +//public class JacksonCustomizerConfig { +// +// @Value("${spring.jackson.date-format:yyyy-MM-dd HH:mm:ss}") +// private String localDateTimePattern; +// +// @Value("${spring.jackson.local-date-format:yyyy-MM-dd}") +// private String localDatePattern; +// +// @Value("${spring.jackson.local-time-format:HH:mm:ss}") +// private String localTimePattern; +// +// @Bean +// public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() { +// return builder -> { +// builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(localDateTimePattern))); +// builder.serializerByType(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(localDatePattern))); +// builder.serializerByType(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(localTimePattern))); +// builder.deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(localDateTimePattern))); +// builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(localDatePattern))); +// builder.deserializerByType(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(localTimePattern))); +// }; +// } +// +// /** +// * 时间LocalDateTime转换 +// */ +// @Component +// public static class LocalDateTimeConverter implements Converter { +// @Override +// public LocalDateTime convert(String source) { +// if (StringUtils.isBlank(source)) { +// return null; +// } +// if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) { +// return LocalDateTime.parse(source, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); +// } +// throw new IllegalArgumentException("Invalid value '" + source + "'"); +// } +// } +// +// /** +// * 时间LocalDate转换 +// */ +// @Component +// public static class LocalDateConverter implements Converter { +// @Override +// public LocalDate convert(String source) { +// if (StringUtils.isBlank(source)) { +// return null; +// } +// if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) { +// return LocalDate.parse(source, DateTimeFormatter.ofPattern("yyyy-MM-dd")); +// } +// throw new IllegalArgumentException("Invalid value '" + source + "'"); +// } +// } +// +//} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/swagger/SwaggerConfig.java b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/swagger/SwaggerConfig.java new file mode 100644 index 0000000..a795c08 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/autoconfig/swagger/SwaggerConfig.java @@ -0,0 +1,87 @@ +package com.mosty.common.base.autoconfig.swagger; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.Contact; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.ArrayList; +import java.util.List; + +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_HEADER; + +/** + * swagger 配置、自动装配类类 + * {@link ComponentScan} 具体扫描地址可以更改为: + * {@link ComponentScan({"com.mosty.common.config.controller","..."})} + * + * @author kevin + * @date 2022/1/22 5:47 PM + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +@ComponentScan({"com.mosty.common"}) +@SuppressWarnings("unused") +public class SwaggerConfig { + + /** swagger基础扫描包 */ + private static final String SWAGGER_SCAN_BASE_PACKAGE = "com.mosty"; + + /** swagger默认关闭,则没有配置也保证不会启动报错 */ + @Value("${swagger.enable:true}") + private Boolean swaggerEnable; + @Value("${swagger.title:mosty}") + private String title; + @Value("${swagger.host:127.0.0.1}") + private String host; + @Value("${swagger.port:9999}") + private String port; + @Value("${swagger.version:1.0.0}") + private String version; + @Value("${swagger.name:基础服务}") + private String name; + @Value("${swagger.url:''}") + private String url; + @Value("${swagger.email:''}") + private String email; + @Value("${spring.application.name}") + private String serviceName; + + @Bean + public Docket createRestApi() { + if (swaggerEnable) { + List parameters = new ArrayList<>(); + parameters.add(new ParameterBuilder() + .name(TOKEN_HEADER) + .description("令牌") + .modelRef(new ModelRef("string")) + .parameterType("header") + .required(false) + .build()); + + return new Docket(DocumentationType.SWAGGER_2) + .host(host + ":" + port) + .apiInfo( + new ApiInfoBuilder().title(serviceName).description(serviceName) + .version(version).contact(new Contact(name, url, email)).build()) + .globalOperationParameters(parameters) + .select() + .apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)) + .paths(PathSelectors.any()) + .build(); + } + return new Docket(DocumentationType.SWAGGER_2).enable(false); + } + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/Constants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/Constants.java new file mode 100644 index 0000000..d46f493 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/Constants.java @@ -0,0 +1,114 @@ +package com.mosty.common.base.constant; + +/** + * 通用常量信息 + * + * @author ruoyi + */ +public class Constants { + /** + * UTF-8 字符集 + */ + public static final String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + public static final String GBK = "GBK"; + + /** + * http请求 + */ + public static final String HTTP = "http://"; + + /** + * https请求 + */ + public static final String HTTPS = "https://"; + + /** + * 通用成功标识 + */ + public static final String SUCCESS = "0"; + + /** + * 通用失败标识 + */ + public static final String FAIL = "1"; + + /** + * 登录成功 + */ + public static final String LOGIN_SUCCESS = "Success"; + + /** + * 注销 + */ + public static final String LOGOUT = "Logout"; + + /** + * 注册 + */ + public static final String REGISTER = "Register"; + + /** + * 登录失败 + */ + public static final String LOGIN_FAIL = "Error"; + + /** + * 系统用户授权缓存 + */ + public static final String SYS_AUTH_CACHE = "sys-authCache"; + + /** + * 参数管理 cache name + */ + public static final String SYS_CONFIG_CACHE = "sys-config"; + + /** + * 参数管理 cache key + */ + public static final String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache name + */ + public static final String SYS_DICT_CACHE = "sys-dict"; + + /** + * 字典管理 cache key + */ + public static final String SYS_DICT_KEY = "sys_dict:"; + + /** + * 资源映射路径 前缀 + */ + public static final String RESOURCE_PREFIX = "/profile"; + + /** + * RMI 远程方法调用 + */ + public static final String LOOKUP_RMI = "rmi:"; + + /** + * LDAP 远程方法调用 + */ + public static final String LOOKUP_LDAP = "ldap:"; + + /** + * LDAPS 远程方法调用 + */ + public static final String LOOKUP_LDAPS = "ldaps:"; + + /** + * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) + */ + public static final String[] JOB_WHITELIST_STR = {"com.ruoyi"}; + + /** + * 定时任务违规的字符 + */ + public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", + "org.springframework", "org.apache", "com.ruoyi.common.utils.file"}; +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/GenConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/GenConstants.java new file mode 100644 index 0000000..a8b5079 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/GenConstants.java @@ -0,0 +1,176 @@ +package com.mosty.common.base.constant; + +/** + * 代码生成通用常量 + * + * @author ruoyi + */ +public class GenConstants { + /** + * 单表(增删改查) + */ + public static final String TPL_CRUD = "crud"; + + /** + * 树表(增删改查) + */ + public static final String TPL_TREE = "tree"; + + /** + * 主子表(增删改查) + */ + public static final String TPL_SUB = "sub"; + + /** + * 树编码字段 + */ + public static final String TREE_CODE = "treeCode"; + + /** + * 树父编码字段 + */ + public static final String TREE_PARENT_CODE = "treeParentCode"; + + /** + * 树名称字段 + */ + public static final String TREE_NAME = "treeName"; + + /** + * 上级菜单ID字段 + */ + public static final String PARENT_MENU_ID = "parentMenuId"; + + /** + * 上级菜单名称字段 + */ + public static final String PARENT_MENU_NAME = "parentMenuName"; + + /** + * 数据库字符串类型 + */ + public static final String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"}; + + /** + * 数据库文本类型 + */ + public static final String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"}; + + /** + * 数据库时间类型 + */ + public static final String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"}; + + /** + * 数据库数字类型 + */ + public static final String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", + "bit", "bigint", "float", "double", "decimal"}; + + /** + * 页面不需要编辑字段 + */ + public static final String[] COLUMNNAME_NOT_EDIT = {"id", "create_by", "create_time", "del_flag"}; + + /** + * 页面不需要显示的列表字段 + */ + public static final String[] COLUMNNAME_NOT_LIST = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time"}; + + /** + * 页面不需要查询字段 + */ + public static final String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark"}; + + /** + * Entity基类字段 + */ + public static final String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime", "remark"}; + + /** + * Tree基类字段 + */ + public static final String[] TREE_ENTITY = {"parentName", "parentId", "orderNum", "ancestors"}; + + /** + * 文本框 + */ + public static final String HTML_INPUT = "input"; + + /** + * 文本域 + */ + public static final String HTML_TEXTAREA = "textarea"; + + /** + * 下拉框 + */ + public static final String HTML_SELECT = "select"; + + /** + * 单选框 + */ + public static final String HTML_RADIO = "radio"; + + /** + * 复选框 + */ + public static final String HTML_CHECKBOX = "checkbox"; + + /** + * 日期控件 + */ + public static final String HTML_DATETIME = "datetime"; + + /** + * 上传控件 + */ + public static final String HTML_UPLOAD = "upload"; + + /** + * 富文本控件 + */ + public static final String HTML_SUMMERNOTE = "summernote"; + + /** + * 字符串类型 + */ + public static final String TYPE_STRING = "String"; + + /** + * 整型 + */ + public static final String TYPE_INTEGER = "Integer"; + + /** + * 长整型 + */ + public static final String TYPE_LONG = "Long"; + + /** + * 浮点型 + */ + public static final String TYPE_DOUBLE = "Double"; + + /** + * 高精度计算类型 + */ + public static final String TYPE_BIGDECIMAL = "BigDecimal"; + + /** + * 时间类型 + */ + public static final String TYPE_DATE = "Date"; + + /** + * 模糊查询 + */ + public static final String QUERY_LIKE = "LIKE"; + + /** + * 需要 + */ + public static final String REQUIRE = "1"; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/OnlineStatus.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/OnlineStatus.java new file mode 100644 index 0000000..a065c2f --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/OnlineStatus.java @@ -0,0 +1,23 @@ +package com.mosty.common.base.constant; + +/** + * 用户会话 + * + * @author ruoyi + */ +public enum OnlineStatus { + /** + * 用户状态 + */ + on_line("在线"), off_line("离线"); + + private final String info; + + private OnlineStatus(String info) { + this.info = info; + } + + public String getInfo() { + return info; + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/PermissionConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/PermissionConstants.java new file mode 100644 index 0000000..c9aeee0 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/PermissionConstants.java @@ -0,0 +1,38 @@ +package com.mosty.common.base.constant; + +/** + * 权限通用常量 + * + * @author ruoyi + */ +public class PermissionConstants { + /** + * 新增权限 + */ + public static final String ADD_PERMISSION = "add"; + + /** + * 修改权限 + */ + public static final String EDIT_PERMISSION = "edit"; + + /** + * 删除权限 + */ + public static final String REMOVE_PERMISSION = "remove"; + + /** + * 导出权限 + */ + public static final String EXPORT_PERMISSION = "export"; + + /** + * 显示权限 + */ + public static final String VIEW_PERMISSION = "view"; + + /** + * 查询权限 + */ + public static final String LIST_PERMISSION = "list"; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/ScheduleConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/ScheduleConstants.java new file mode 100644 index 0000000..b8cc821 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/ScheduleConstants.java @@ -0,0 +1,56 @@ +package com.mosty.common.base.constant; + +/** + * 任务调度通用常量 + * + * @author ruoyi + */ +public class ScheduleConstants { + public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; + + /** + * 执行目标key + */ + public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; + + /** + * 默认 + */ + public static final String MISFIRE_DEFAULT = "0"; + + /** + * 立即触发执行 + */ + public static final String MISFIRE_IGNORE_MISFIRES = "1"; + + /** + * 触发一次执行 + */ + public static final String MISFIRE_FIRE_AND_PROCEED = "2"; + + /** + * 不触发立即执行 + */ + public static final String MISFIRE_DO_NOTHING = "3"; + + public enum Status { + /** + * 正常 + */ + NORMAL("0"), + /** + * 暂停 + */ + PAUSE("1"); + + private String value; + + private Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/ShiroConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/ShiroConstants.java new file mode 100644 index 0000000..3c0fcba --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/ShiroConstants.java @@ -0,0 +1,78 @@ +package com.mosty.common.base.constant; + +/** + * Shiro通用常量 + * + * @author ruoyi + */ +public class ShiroConstants { + /** + * 当前登录的用户 + */ + public static final String CURRENT_USER = "currentUser"; + + /** + * 用户名字段 + */ + public static final String CURRENT_USERNAME = "username"; + + /** + * 锁定屏幕字段 + */ + public static final String LOCK_SCREEN = "lockscreen"; + + /** + * 消息key + */ + public static final String MESSAGE = "message"; + + /** + * 错误key + */ + public static final String ERROR = "errorMsg"; + + /** + * 编码格式 + */ + public static final String ENCODING = "UTF-8"; + + /** + * 当前在线会话 + */ + public static final String ONLINE_SESSION = "online_session"; + + /** + * 验证码key + */ + public static final String CURRENT_CAPTCHA = "captcha"; + + /** + * 验证码开关 + */ + public static final String CURRENT_ENABLED = "captchaEnabled"; + + /** + * 验证码类型 + */ + public static final String CURRENT_TYPE = "captchaType"; + + /** + * 验证码 + */ + public static final String CURRENT_VALIDATECODE = "validateCode"; + + /** + * 验证码错误 + */ + public static final String CAPTCHA_ERROR = "captchaError"; + + /** + * 登录记录缓存 + */ + public static final String LOGINRECORDCACHE = "loginRecordCache"; + + /** + * 系统活跃用户缓存 + */ + public static final String SYS_USERCACHE = "sys-userCache"; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/SystemConfigConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/SystemConfigConstants.java new file mode 100644 index 0000000..05dda1b --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/SystemConfigConstants.java @@ -0,0 +1,26 @@ +package com.mosty.common.base.constant; + +/** + * 系统配置相关 + * @author kevin + * @date 2022/3/21 10:46 PM + * @since 1.0.0 + */ +public class SystemConfigConstants { + + // token请求的 Header头 key + public static final String TOKEN_HEADER = "Authorization"; + + // token加密key + public static final String TOKEN_KEY = "RVvjAORWxgmDyvGP8RkD7HuaYEuekN7rXyaDaLn2jbk6OJvFupTXzicR883pFUmI"; + + // token 主题 + public static final String TOKEN_ISSUER = "mosty-admin"; + + // token redis的key + public static final String TOKEN_PREFIX = "token:"; + + // redis中缓存的所有用户的登录信息 +// public static final String USER_INFO_LIST = "user_info_list:"; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/UserConstants.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/UserConstants.java new file mode 100644 index 0000000..cf59650 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/UserConstants.java @@ -0,0 +1,148 @@ +package com.mosty.common.base.constant; + +/** + * 用户常量信息 + * + * @author ruoyi + */ +public class UserConstants { + + /** + * 平台内系统用户的唯一标志 + */ + public static final String SYS_USER = "SYS_USER"; + + /** + * 正常状态 + */ + public static final String NORMAL = "0"; + + /** + * 异常状态 + */ + public static final String EXCEPTION = "1"; + + /** + * 用户封禁状态 + */ + public static final String USER_DISABLE = "1"; + + /** + * 角色封禁状态 + */ + public static final String ROLE_DISABLE = "1"; + + /** + * 部门正常状态 + */ + public static final String DEPT_NORMAL = "0"; + + /** + * 部门停用状态 + */ + public static final String DEPT_DISABLE = "1"; + + /** + * 字典正常状态 + */ + public static final String DICT_NORMAL = "0"; + + /** + * 是否为系统默认(是) + */ + public static final String YES = "Y"; + + /** + * 用户名长度限制 + */ + public static final int USERNAME_MIN_LENGTH = 2; + public static final int USERNAME_MAX_LENGTH = 20; + + /** + * 登录名称是否唯一的返回结果码 + */ + public final static String USER_NAME_UNIQUE = "0"; + public final static String USER_NAME_NOT_UNIQUE = "1"; + + /** + * 手机号码是否唯一的返回结果 + */ + public final static String USER_PHONE_UNIQUE = "0"; + public final static String USER_PHONE_NOT_UNIQUE = "1"; + + /** + * e-mail 是否唯一的返回结果 + */ + public final static String USER_EMAIL_UNIQUE = "0"; + public final static String USER_EMAIL_NOT_UNIQUE = "1"; + + /** + * 部门名称是否唯一的返回结果码 + */ + public final static String DEPT_NAME_UNIQUE = "0"; + public final static String DEPT_NAME_NOT_UNIQUE = "1"; + + /** + * 角色名称是否唯一的返回结果码 + */ + public final static String ROLE_NAME_UNIQUE = "0"; + public final static String ROLE_NAME_NOT_UNIQUE = "1"; + + /** + * 岗位名称是否唯一的返回结果码 + */ + public final static String POST_NAME_UNIQUE = "0"; + public final static String POST_NAME_NOT_UNIQUE = "1"; + + /** + * 角色权限是否唯一的返回结果码 + */ + public final static String ROLE_KEY_UNIQUE = "0"; + public final static String ROLE_KEY_NOT_UNIQUE = "1"; + + /** + * 岗位编码是否唯一的返回结果码 + */ + public final static String POST_CODE_UNIQUE = "0"; + public final static String POST_CODE_NOT_UNIQUE = "1"; + + /** + * 菜单名称是否唯一的返回结果码 + */ + public final static String MENU_NAME_UNIQUE = "0"; + public final static String MENU_NAME_NOT_UNIQUE = "1"; + + /** + * 字典类型是否唯一的返回结果码 + */ + public final static String DICT_TYPE_UNIQUE = "0"; + public final static String DICT_TYPE_NOT_UNIQUE = "1"; + + /** + * 参数键名是否唯一的返回结果码 + */ + public final static String CONFIG_KEY_UNIQUE = "0"; + public final static String CONFIG_KEY_NOT_UNIQUE = "1"; + + /** + * 密码长度限制 + */ + public static final int PASSWORD_MIN_LENGTH = 5; + public static final int PASSWORD_MAX_LENGTH = 20; + + /** + * 用户类型 + */ + public static final String SYSTEM_USER_TYPE = "00"; + public static final String REGISTER_USER_TYPE = "01"; + + /** + * 手机号码格式限制 + */ + public static final String MOBILE_PHONE_NUMBER_PATTERN = "^0{0,1}(13[0-9]|15[0-9]|14[0-9]|18[0-9])[0-9]{8}$"; + + /** + * 邮箱格式限制 + */ + public static final String EMAIL_PATTERN = "^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?"; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/ConfigKeyEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/ConfigKeyEnum.java new file mode 100644 index 0000000..2a6ef0a --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/ConfigKeyEnum.java @@ -0,0 +1,21 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 系统配置key + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum ConfigKeyEnum { + /** 密码等级 */ + PASSWORD_LEVEL("password.level", "密码等级"); + + + /** key */ + public final String code; + + /** 描述 */ + public final String desc; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DeletedEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DeletedEnum.java new file mode 100644 index 0000000..fe5bbcd --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DeletedEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 数据是否删除标识 + * @author kevin + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum DeletedEnum { + + /** 正常状态 */ + NATURE(0, "正常状态"), + + /** 注销状态 */ + DELETED(1, "注销状态"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DictTypeEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DictTypeEnum.java new file mode 100644 index 0000000..b2e3499 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/DictTypeEnum.java @@ -0,0 +1,27 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 字典类型枚举 + * + * @author kevin + * @date 2022/2/20 3:52 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum DictTypeEnum { + + /** 正常字典 */ + NATURE(1, "正常字典【列表】"), + + /** 树型字典 */ + TREE(2, "树型结构"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/MenuTypeEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/MenuTypeEnum.java new file mode 100644 index 0000000..600fcef --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/MenuTypeEnum.java @@ -0,0 +1,43 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 菜单类型枚举 + * @author kevin + * @date 2022/2/22 12:53 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum MenuTypeEnum { + + MENU_GROUP(1, "菜单组"), + MENU(2, "菜单"), + PAGE(3, "页面"), + RESOURCE(4, "资源"), + ; + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + + /** + * 根据编码匹配菜单类型 + * @param code 编码 + * @return 菜单类型枚举 + */ + public static MenuTypeEnum valueOf(Integer code) { + if (code == null) { + return null; + } + for (MenuTypeEnum menuTypeEnum : MenuTypeEnum.values()) { + if (menuTypeEnum.code.equals(code)) { + return menuTypeEnum; + } + } + return null; + } + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PasswordLevelEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PasswordLevelEnum.java new file mode 100644 index 0000000..de93501 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PasswordLevelEnum.java @@ -0,0 +1,22 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 密码等级和对应规则 + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum PasswordLevelEnum { + + /** 密码等级 */ + PASSWORD_LEVEL_ONE(1, ""); + + + /** 等级 */ + public final Integer code; + + /** 规则 */ + public final String rule; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PermissionLevelEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PermissionLevelEnum.java new file mode 100644 index 0000000..5220bda --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/constant/enums/PermissionLevelEnum.java @@ -0,0 +1,38 @@ +package com.mosty.common.base.constant.enums; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum PermissionLevelEnum { + + + /** + * 全部 + */ + ALL("1", "全部"), + + /** + * 部门及以下 + */ + DEPT_AND_CHILD("2", "部门及以下"), + /** + * 部门 + */ + DEPT("3", "仅部门权限"), + /** + * 部门及以下 + */ + ONESELF("4", "仅查看本人"); + + + /** + * 等级 + */ + public String level; + + /** + * 描述 + */ + public String desc; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/data/scope/DataScope.java b/common-base-starter/src/main/java/com/mosty/common/base/data/scope/DataScope.java new file mode 100644 index 0000000..5f7ffdc --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/data/scope/DataScope.java @@ -0,0 +1,24 @@ +package com.mosty.common.base.data.scope; + +import java.lang.annotation.*; + +/** + * 数据权限过滤注解 + * + * @author ruoyi + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataScope { + + /** + * 部门表的别名 + */ + String deptAlias() default ""; + + /** + * 用户表的别名 + */ + String userAlias() default ""; +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/BaseController.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/BaseController.java new file mode 100644 index 0000000..1546ef1 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/BaseController.java @@ -0,0 +1,207 @@ +package com.mosty.common.base.domain; + +import com.github.pagehelper.PageInfo; +import com.mosty.common.base.domain.page.PageUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; + +import java.beans.PropertyEditorSupport; +import java.text.ParseException; +import java.util.Date; +import java.util.List; + +/** + * web层通用数据处理 + * + * @author ruoyi + */ +@Slf4j +public class BaseController { + + /** + * 将前台传递过来的日期格式的字符串,自动转化为Date类型 + */ + @InitBinder + public void initBinder(WebDataBinder binder) { + // Date 类型转换 + binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { + @Override + public void setAsText(String text) { + try { + setValue(DateUtils.parseDate(text)); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }); + } + + /** + * 设置请求分页数据 + */ + protected void startPage() { + PageUtils.startPage(); + } +// +// /** +// * 设置请求排序数据 +// */ +// protected void startOrderBy() +// { +// PageDomain pageDomain = TableSupport.buildPageRequest(); +// if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) +// { +// String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); +// PageHelper.orderBy(orderBy); +// } +// } +// +// /** +// * 获取request +// */ +// public HttpServletRequest getRequest() +// { +// return ServletUtils.getRequest(); +// } +// +// /** +// * 获取response +// */ +// public HttpServletResponse getResponse() +// { +// return ServletUtils.getResponse(); +// } +// +// /** +// * 获取session +// */ +// public HttpSession getSession() +// { +// return getRequest().getSession(); +// } +// + + /** + * 响应请求分页数据 + */ + @SuppressWarnings({"rawtypes", "unchecked"}) + protected TableDataInfo getDataTable(List list) { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(0); + rspData.setRows(list); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } +// +// /** +// * 响应返回结果 +// * +// * @param rows 影响行数 +// * @return 操作结果 +// */ +// protected AjaxResult toAjax(int rows) +// { +// return rows > 0 ? success() : error(); +// } +// +// /** +// * 响应返回结果 +// * +// * @param result 结果 +// * @return 操作结果 +// */ +// protected AjaxResult toAjax(boolean result) +// { +// return result ? success() : error(); +// } +// +// /** +// * 返回成功 +// */ +// public AjaxResult success() +// { +// return AjaxResult.success(); +// } +// +// /** +// * 返回失败消息 +// */ +// public AjaxResult error() +// { +// return AjaxResult.error(); +// } +// +// /** +// * 返回成功消息 +// */ +// public AjaxResult success(String message) +// { +// return AjaxResult.success(message); +// } +// +// /** +// * 返回成功数据 +// */ +// public static AjaxResult success(Object data) +// { +// return AjaxResult.success("操作成功", data); +// } +// +// /** +// * 返回失败消息 +// */ +// public AjaxResult error(String message) +// { +// return AjaxResult.error(message); +// } +// +// /** +// * 返回错误码消息 +// */ +// public AjaxResult error(Type type, String message) +// { +// return new AjaxResult(type, message); +// } +// +// /** +// * 页面跳转 +// */ +// public String redirect(String url) +// { +// return StringUtils.format("redirect:{}", url); +// } +// +// /** +// * 获取用户缓存信息 +// */ +// public SysUser getSysUser() +// { +// return ShiroUtils.getSysUser(); +// } +// +// /** +// * 设置用户缓存信息 +// */ +// public void setSysUser(SysUser user) +// { +// ShiroUtils.setSysUser(user); +// } +// +// /** +// * 获取登录用户id +// */ +// public Long getUserId() +// { +// return getSysUser().getUserId(); +// } +// +// /** +// * 获取登录用户名 +// */ +// public String getLoginName() +// { +// return getSysUser().getLoginName(); +// } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/CxSelect.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/CxSelect.java new file mode 100644 index 0000000..015c5d0 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/CxSelect.java @@ -0,0 +1,60 @@ +package com.mosty.common.base.domain; + +import java.io.Serializable; +import java.util.List; + +/** + * CxSelect树结构实体类 + * + * @author ruoyi + */ +public class CxSelect implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 数据值字段名称 + */ + private String v; + + /** + * 数据标题字段名称 + */ + private String n; + + /** + * 子集数据字段名称 + */ + private List s; + + public CxSelect() { + } + + public CxSelect(String v, String n) { + this.v = v; + this.n = n; + } + + public List getS() { + return s; + } + + public void setN(String n) { + this.n = n; + } + + public String getN() { + return n; + } + + public void setS(List s) { + this.s = s; + } + + public String getV() { + return v; + } + + public void setV(String v) { + this.v = v; + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/ResponseResult.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/ResponseResult.java new file mode 100644 index 0000000..3f0bf53 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/ResponseResult.java @@ -0,0 +1,99 @@ +package com.mosty.common.base.domain; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Objects; + +/** + * 基础请求返回类 + * @author kevin + * @date 2022/1/22 8:29 PM + * @since 1.0.0 + */ +@Data +@SuppressWarnings("unused") +public class ResponseResult implements Serializable { + + /** 调用成功编码 */ + private static final int SUCCESS_CODE = 10000; + + /** 调用失败编码 */ + private static final int FAIL_CODE = -1; + + /** 编号 */ + private int code = SUCCESS_CODE; + + /** 消息 */ + private String message; + + /** 数据 */ + private T data; + + public ResponseResult() { + } + + public ResponseResult(T data) { + this.message = "OK"; + this.data = data; + } + + public ResponseResult(int code, String msg) { + this.code = code; + this.message = msg; + this.data = null; + } + + public ResponseResult(int code, String msg, T data) { + this.code = code; + this.message = msg; + this.data = data; + } + + public static ResponseResult success() { + return new ResponseResult(SUCCESS_CODE, "OK", null); + } + + public static ResponseResult success(int code, String message, T data) { + return new ResponseResult(code, message, data); + } + + public static ResponseResult success(String message, T data) { + return new ResponseResult(SUCCESS_CODE, message, data); + } + + public static ResponseResult success(T data) { + return new ResponseResult(SUCCESS_CODE, "OK", data); + } + + public static ResponseResult fail(String message) { + return new ResponseResult(FAIL_CODE, message, (Object)null); + } + + public static ResponseResult fail(int code, String message) { + return new ResponseResult(code, message, (Object)null); + } + + public static ResponseResult fail(int code, String message, T t) { + return new ResponseResult(code, message, t); + } + + public boolean isSuccess() { + return SUCCESS_CODE == code; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseResult that = (ResponseResult) o; + return Objects.equals(code, that.code) && Objects.equals(message, that.message) && Objects.equals(data, that.data); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, data); + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/TableDataInfo.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/TableDataInfo.java new file mode 100644 index 0000000..ca35811 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/TableDataInfo.java @@ -0,0 +1,82 @@ +package com.mosty.common.base.domain; + +import java.io.Serializable; +import java.util.List; + +/** + * 表格分页数据对象 + * + * @author ruoyi + */ +public class TableDataInfo implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 总记录数 + */ + private long total; + + /** + * 列表数据 + */ + private List rows; + + /** + * 消息状态码 + */ + private int code; + + /** + * 消息内容 + */ + private String msg; + + /** + * 表格数据对象 + */ + public TableDataInfo() { + } + + /** + * 分页 + * + * @param list 列表数据 + * @param total 总记录数 + */ + public TableDataInfo(List list, int total) { + this.rows = list; + this.total = total; + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageDomain.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageDomain.java new file mode 100644 index 0000000..43e8e09 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageDomain.java @@ -0,0 +1,86 @@ +package com.mosty.common.base.domain.page; + + +import com.mosty.common.base.util.StringUtils; + +/** + * 分页数据 + * + * @author ruoyi + */ +public class PageDomain { + /** + * 当前记录起始索引 + */ + private Integer pageNum; + + /** + * 每页显示记录数 + */ + private Integer pageSize; + + /** + * 排序列 + */ + private String orderByColumn; + + /** + * 排序的方向desc或者asc + */ + private String isAsc = "asc"; + + /** + * 分页参数合理化 + */ + private Boolean reasonable = true; + + public String getOrderBy() { + if (StringUtils.isEmpty(orderByColumn)) { + return ""; + } + return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; + } + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getOrderByColumn() { + return orderByColumn; + } + + public void setOrderByColumn(String orderByColumn) { + this.orderByColumn = orderByColumn; + } + + public String getIsAsc() { + return isAsc; + } + + public void setIsAsc(String isAsc) { + this.isAsc = isAsc; + } + + public Boolean getReasonable() { + if (StringUtils.isNull(reasonable)) { + return Boolean.TRUE; + } + return reasonable; + } + + public void setReasonable(Boolean reasonable) { + this.reasonable = reasonable; + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageUtils.java new file mode 100644 index 0000000..28861e7 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/PageUtils.java @@ -0,0 +1,27 @@ +package com.mosty.common.base.domain.page; + +import com.github.pagehelper.PageHelper; + +import java.util.Objects; + +/** + * 分页工具类 + * + * @author ruoyi + */ +public class PageUtils extends PageHelper { + + /** + * 设置请求分页数据 + */ + public static void startPage() { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (!Objects.isNull(pageNum) && !Objects.isNull(pageSize)) { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); + } + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/page/ServletUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/ServletUtils.java new file mode 100644 index 0000000..6d1d269 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/ServletUtils.java @@ -0,0 +1,156 @@ +package com.mosty.common.base.domain.page; + +import cn.hutool.core.convert.Convert; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +/** + * 客户端工具类 + * + * @author ruoyi + */ +public class ServletUtils { + /** + * 定义移动端请求的所有可能类型 + */ + private final static String[] agent = {"Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser"}; + + /** + * 获取String参数 + */ + public static String getParameter(String name) { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + * @return null + */ + public static String renderString(HttpServletResponse response, String string) { + try { + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().print(string); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ +// public static boolean isAjaxRequest(HttpServletRequest request) { +// String accept = request.getHeader("accept"); +// if (accept != null && accept.indexOf("application/json") != -1) { +// return true; +// } +// +// String xRequestedWith = request.getHeader("X-Requested-With"); +// if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) { +// return true; +// } +// +// String uri = request.getRequestURI(); +// if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { +// return true; +// } +// +// String ajax = request.getParameter("__ajax"); +// if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) { +// return true; +// } +// return false; +// } + + /** + * 判断User-Agent 是不是来自于手机 + */ + public static boolean checkAgentIsMobile(String ua) { + boolean flag = false; + if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) { + // 排除 苹果桌面系统 + if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) { + for (String item : agent) { + if (ua.contains(item)) { + flag = true; + break; + } + } + } + } + return flag; + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/page/SqlUtil.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/SqlUtil.java new file mode 100644 index 0000000..17f5a06 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/SqlUtil.java @@ -0,0 +1,53 @@ +package com.mosty.common.base.domain.page; + +import com.mosty.common.base.exception.BusinessException; +import org.apache.commons.lang3.StringUtils; + +/** + * sql操作工具类 + * + * @author ruoyi + */ +public class SqlUtil { + /** + * 定义常用的 sql关键字 + */ + public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; + + /** + * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) + */ + public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { + throw new BusinessException("参数不符合规范,不能进行查询"); + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) { + return value.matches(SQL_PATTERN); + } + + /** + * SQL关键字检查 + */ + public static void filterKeyword(String value) { + if (StringUtils.isEmpty(value)) { + return; + } + String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); + for (int i = 0; i < sqlKeywords.length; i++) { + if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1) { + throw new BusinessException("参数存在SQL注入风险"); + } + } + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/domain/page/TableSupport.java b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/TableSupport.java new file mode 100644 index 0000000..70b28ac --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/domain/page/TableSupport.java @@ -0,0 +1,51 @@ +package com.mosty.common.base.domain.page; + + +/** + * 表格数据处理 + * + * @author ruoyi + */ +public class TableSupport { + /** + * 当前记录起始索引 + */ + public static final String PAGE_NUM = "pageNum"; + + /** + * 每页显示记录数 + */ + public static final String PAGE_SIZE = "pageSize"; + + /** + * 排序列 + */ + public static final String ORDER_BY_COLUMN = "orderByColumn"; + + /** + * 排序的方向 "desc" 或者 "asc". + */ + public static final String IS_ASC = "isAsc"; + + /** + * 分页参数合理化 + */ + public static final String REASONABLE = "reasonable"; + + /** + * 封装分页对象 + */ + public static PageDomain getPageDomain() { + PageDomain pageDomain = new PageDomain(); + pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); + pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); + pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); + pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); + pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); + return pageDomain; + } + + public static PageDomain buildPageRequest() { + return getPageDomain(); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BaseEntity.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BaseEntity.java new file mode 100644 index 0000000..3c687e4 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BaseEntity.java @@ -0,0 +1,141 @@ +package com.mosty.common.base.entity.log; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Entity基类 + * + * @author ruoyi + */ +public class BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 搜索值 + */ + private String searchValue; + + /** + * 创建者id + */ + private Long createBy; + + /** + * 创建者名称 + */ + private String createName; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 更新者id + */ + private Long updateBy; + + /** + * 更新者名称 + */ + private String updateName; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 请求参数 + */ + private Map params; + + public String getSearchValue() { + return searchValue; + } + + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + public Long getCreateBy() { + return createBy; + } + + public void setCreateBy(Long createBy) { + this.createBy = createBy; + } + + public String getCreateName() { + return createName; + } + + public void setCreateName(String createName) { + this.createName = createName; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Long updateBy) { + this.updateBy = updateBy; + } + + public String getUpdateName() { + return updateName; + } + + public void setUpdateName(String updateName) { + this.updateName = updateName; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Map getParams() { + if (params == null) { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) { + this.params = params; + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BusinessType.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BusinessType.java new file mode 100644 index 0000000..f6fabbb --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/BusinessType.java @@ -0,0 +1,38 @@ +package com.mosty.common.base.entity.log; + +/** + * 业务操作类型 + * + * @author ruoyi + */ +public enum BusinessType { + // 其它 + OTHER, + + // 新增 + INSERT, + + // 修改 + UPDATE, + + // 删除 + DELETE, + + // 授权 + GRANT, + + // 导出 + EXPORT, + + // 导入 + IMPORT, + + // 强退 + FORCE, + + // 生成代码 + GENCODE, + + // 清空 + CLEAN, +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/CharsetKit.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/CharsetKit.java new file mode 100644 index 0000000..83c945d --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/CharsetKit.java @@ -0,0 +1,87 @@ +package com.mosty.common.base.entity.log; + +import org.apache.commons.lang3.StringUtils; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * 字符集工具类 + * + * @author ruoyi + */ +public class CharsetKit +{ + /** ISO-8859-1 */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** UTF-8 */ + public static final String UTF_8 = "UTF-8"; + /** GBK */ + public static final String GBK = "GBK"; + + /** ISO-8859-1 */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** UTF-8 */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** GBK */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) + { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) + { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) + { + if (null == srcCharset) + { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) + { + destCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) + { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() + { + return Charset.defaultCharset().name(); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Convert.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Convert.java new file mode 100644 index 0000000..73ac91f --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Convert.java @@ -0,0 +1,1013 @@ +package com.mosty.common.base.entity.log; + +import org.apache.commons.lang3.StringUtils; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.math.RoundingMode; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; + +/** + * 类型转换器 + * + * @author ruoyi + */ +public class Convert +{ + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof String) + { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) + { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof Character) + { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) + { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Byte) + { + return (Byte) value; + } + if (value instanceof Number) + { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Byte.parseByte(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) + { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Short) + { + return (Short) value; + } + if (value instanceof Number) + { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Short.parseShort(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) + { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Number) + { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return NumberFormat.getInstance().parse(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) + { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Integer) + { + return (Integer) value; + } + if (value instanceof Number) + { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Integer.parseInt(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) + { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) + { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) + { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Integer[] {}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Long[] {}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) + { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) + { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Long) + { + return (Long) value; + } + if (value instanceof Number) + { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) + { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Double) + { + return (Double) value; + } + if (value instanceof Number) + { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) + { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Float) + { + return (Float) value; + } + if (value instanceof Number) + { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Float.parseFloat(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) + { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Boolean) + { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) + { + case "true": + case "yes": + case "ok": + case "1": + return true; + case "false": + case "no": + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) + { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) + { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Enum.valueOf(clazz, valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) + { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigInteger) + { + return (BigInteger) value; + } + if (value instanceof Long) + { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigInteger(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) + { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigDecimal) + { + return (BigDecimal) value; + } + if (value instanceof Long) + { + return new BigDecimal((Long) value); + } + if (value instanceof Double) + { + return BigDecimal.valueOf((Double) value); + } + if (value instanceof Integer) + { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigDecimal(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) + { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ + public static String utf8Str(Object obj) + { + return str(obj, CharsetKit.CHARSET_UTF_8); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) + { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) + { + if (null == obj) + { + return null; + } + + if (obj instanceof String) + { + return (String) obj; + } + else if (obj instanceof byte[] || obj instanceof Byte[]) + { + if (obj instanceof byte[]) + { + return str((byte[]) obj, charset); + } + else + { + Byte[] bytes = (Byte[]) obj; + int length = bytes.length; + byte[] dest = new byte[length]; + for (int i = 0; i < length; i++) + { + dest[i] = bytes[i]; + } + return str(dest, charset); + } + } + else if (obj instanceof ByteBuffer) + { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) + { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) + { + if (data == null) + { + return null; + } + + if (null == charset) + { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) + { + if (data == null) + { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) + { + if (null == charset) + { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) + { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) + { + char[] c = input.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') + { + c[i] = '\u3000'; + } + else if (c[i] < '\177') + { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) + { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) + { + char[] c = text.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') + { + c[i] = ' '; + } + else if (c[i] > '\uFF00' && c[i] < '\uFF5F') + { + c[i] = (char) (c[i] - 65248); + } + } + return new String(c); + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) + { + String[] fraction = { "角", "分" }; + String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; + String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) + { + // 优化double计算精度丢失问题 + BigDecimal nNum = new BigDecimal(n); + BigDecimal decimal = new BigDecimal(10); + BigDecimal scale = nNum.multiply(decimal).setScale(2, RoundingMode.HALF_EVEN); + double d = scale.doubleValue(); + s += (digit[(int) (Math.floor(d * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) + { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) + { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) + { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excel.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excel.java new file mode 100644 index 0000000..c883bad --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excel.java @@ -0,0 +1,188 @@ +package com.mosty.common.base.entity.log; + +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.math.BigDecimal; + +/** + * 自定义导出Excel数据注解 + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel { + /** + * 导出时在excel中排序 + */ + public int sort() default Integer.MAX_VALUE; + + /** + * 导出到Excel中的名字. + */ + public String name() default ""; + + /** + * 日期格式, 如: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + public String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + public String separator() default ","; + + /** + * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) + */ + public int scale() default -1; + + /** + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN + */ + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + + /** + * 导出时在excel中每个列的高度 + */ + public double height() default 14; + + /** + * 导出时在excel中每个列的宽度 + */ + public double width() default 16; + + /** + * 文字后缀,如% 90 变成90% + */ + public String suffix() default ""; + + /** + * 当值为空时,字段的默认值 + */ + public String defaultValue() default ""; + + /** + * 提示信息 + */ + public String prompt() default ""; + + /** + * 设置只能选择不能输入的列内容. + */ + public String[] combo() default {}; + + /** + * 是否需要纵向合并单元格,应对需求:含有list集合单元格) + */ + public boolean needMerge() default false; + + /** + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. + */ + public boolean isExport() default true; + + /** + * 另一个类中的属性名称,支持多级获取,以小数点隔开 + */ + public String targetAttr() default ""; + + /** + * 是否自动统计数据,在最后追加一行统计数据总和 + */ + public boolean isStatistics() default false; + + + /** + * 如果是字典类型,请设置字典的type值 + * >>>>>>>特别提醒,如若配置该字段,则“combo”和“readConverterExp”不启用 + */ + public String dictType() default ""; + + /** + * 导出类型(0数字 1字符串) + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 导出列头背景颜色 + */ + public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT; + + /** + * 导出列头字体颜色 + */ + public IndexedColors headerColor() default IndexedColors.WHITE; + + /** + * 导出单元格背景颜色 + */ + public IndexedColors backgroundColor() default IndexedColors.WHITE; + + /** + * 导出单元格字体颜色 + */ + public IndexedColors color() default IndexedColors.BLACK; + + /** + * 导出字段对齐方式 + */ + public HorizontalAlignment align() default HorizontalAlignment.CENTER; + + /** + * 自定义数据处理器 + */ + public Class handler() default ExcelHandlerAdapter.class; + + /** + * 自定义数据处理器参数 + */ + public String[] args() default {}; + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1), IMAGE(2); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ExcelHandlerAdapter.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ExcelHandlerAdapter.java new file mode 100644 index 0000000..2f62ae4 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ExcelHandlerAdapter.java @@ -0,0 +1,17 @@ +package com.mosty.common.base.entity.log; + +/** + * Excel数据格式处理适配器 + * + * @author ruoyi + */ +public interface ExcelHandlerAdapter { + /** + * 格式化 + * + * @param value 单元格数据值 + * @param args excel注解args参数组 + * @return 处理后的值 + */ + Object format(Object value, String[] args); +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excels.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excels.java new file mode 100644 index 0000000..3eb5930 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Excels.java @@ -0,0 +1,18 @@ +package com.mosty.common.base.entity.log; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel注解集 + * + * @author ruoyi + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Excels { + + Excel[] value(); +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Log.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Log.java new file mode 100644 index 0000000..41684e6 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/Log.java @@ -0,0 +1,36 @@ +package com.mosty.common.base.entity.log; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义操作日志记录注解 + * + * @author kevin + * @date 2022/1/25 9:10 PM + * @since 1.0.0 + */ +@Target({ ElementType.PARAMETER, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Log { + + // 模块 + String title() default ""; + + // 功能 + BusinessType businessType() default BusinessType.OTHER; + + // 操作人类别 + OperatorType operatorType() default OperatorType.MANAGE; + + // 是否保存请求的参数 + boolean isSaveRequestData() default true; + + // 是否保存响应的参数 + boolean isSaveResponseData() default true; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/LogConst.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/LogConst.java new file mode 100644 index 0000000..094eb30 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/LogConst.java @@ -0,0 +1,15 @@ +package com.mosty.common.base.entity.log; + +/** + * 操作日志静态变量 + * + * @author kevin + * @date 2022/1/25 9:36 PM + * @since 1.0.0 + */ +public class LogConst { + + // 操作日志线程池名称 + public static final String LOG_THREAD_POOL = "OPERATION_LOG"; + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/OperatorType.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/OperatorType.java new file mode 100644 index 0000000..b678431 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/OperatorType.java @@ -0,0 +1,25 @@ +package com.mosty.common.base.entity.log; + +/** + * 操作人类别 + * + * @author kevin + * @date 2022/1/25 9:10 PM + * @since 1.0.0 + */ +public enum OperatorType { + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ReflectUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ReflectUtils.java new file mode 100644 index 0000000..763adaa --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/ReflectUtils.java @@ -0,0 +1,410 @@ +package com.mosty.common.base.entity.log; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Date; + +import com.mosty.common.base.util.DateUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.poi.ss.usermodel.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * + * @author ruoyi + */ +@SuppressWarnings("rawtypes") +public class ReflectUtils +{ + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + private static final String CGLIB_CLASS_SEPARATOR = "$$"; + + private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class); + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) + { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + return (E) object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, E value) + { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i = 0; i < names.length; i++) + { + if (i < names.length - 1) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + else + { + String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); + invokeMethodByName(object, setterMethodName, new Object[] { value }); + } + } + } + + /** + * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数. + */ + @SuppressWarnings("unchecked") + public static E getFieldValue(final Object obj, final String fieldName) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return null; + } + E result = null; + try + { + result = (E) field.get(obj); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常{}", e.getMessage()); + } + return result; + } + + /** + * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数. + */ + public static void setFieldValue(final Object obj, final String fieldName, final E value) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + // throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return; + } + try + { + field.set(obj, value); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常: {}", e.getMessage()); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符. + * 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用. + * 同时匹配方法名+参数类型, + */ + @SuppressWarnings("unchecked") + public static E invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, + final Object[] args) + { + if (obj == null || methodName == null) + { + return null; + } + Method method = getAccessibleMethod(obj, methodName, parameterTypes); + if (method == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符, + * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用. + * 只匹配函数名,如果有多个同名函数调用第一个。 + */ + @SuppressWarnings("unchecked") + public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) + { + Method method = getAccessibleMethodByName(obj, methodName, args.length); + if (method == null) + { + // 如果为空不报错,直接返回空。 + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + // 类型转换(将参数数据类型转换为目标方法参数类型) + Class[] cs = method.getParameterTypes(); + for (int i = 0; i < cs.length; i++) + { + if (args[i] != null && !args[i].getClass().equals(cs[i])) + { + if (cs[i] == String.class) + { + args[i] = Convert.toStr(args[i]); + if (StringUtils.endsWith((String) args[i], ".0")) + { + args[i] = StringUtils.substringBefore((String) args[i], ".0"); + } + } + else if (cs[i] == Integer.class) + { + args[i] = Convert.toInt(args[i]); + } + else if (cs[i] == Long.class) + { + args[i] = Convert.toLong(args[i]); + } + else if (cs[i] == Double.class) + { + args[i] = Convert.toDouble(args[i]); + } + else if (cs[i] == Float.class) + { + args[i] = Convert.toFloat(args[i]); + } + else if (cs[i] == Date.class) + { + if (args[i] instanceof String) + { + args[i] = DateUtils.parseDate(args[i]); + } + else + { + args[i] = DateUtil.getJavaDate((Double) args[i]); + } + } + else if (cs[i] == boolean.class || cs[i] == Boolean.class) + { + args[i] = Convert.toBool(args[i]); + } + } + } + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + */ + public static Field getAccessibleField(final Object obj, final String fieldName) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(fieldName, "fieldName can't be blank"); + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) + { + try + { + Field field = superClass.getDeclaredField(fieldName); + makeAccessible(field); + return field; + } + catch (NoSuchFieldException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 匹配函数名+参数类型。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethod(final Object obj, final String methodName, + final Class... parameterTypes) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + try + { + Method method = searchType.getDeclaredMethod(methodName, parameterTypes); + makeAccessible(method); + return method; + } + catch (NoSuchMethodException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 只匹配函数名。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + Method[] methods = searchType.getDeclaredMethods(); + for (Method method : methods) + { + if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) + { + makeAccessible(method); + return method; + } + } + } + return null; + } + + /** + * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Method method) + { + if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) + && !method.isAccessible()) + { + method.setAccessible(true); + } + } + + /** + * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Field field) + { + if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) + || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) + { + field.setAccessible(true); + } + } + + /** + * 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处 + * 如无法找到, 返回Object.class. + */ + @SuppressWarnings("unchecked") + public static Class getClassGenricType(final Class clazz) + { + return getClassGenricType(clazz, 0); + } + + /** + * 通过反射, 获得Class定义中声明的父类的泛型参数的类型. + * 如无法找到, 返回Object.class. + */ + public static Class getClassGenricType(final Class clazz, final int index) + { + Type genType = clazz.getGenericSuperclass(); + + if (!(genType instanceof ParameterizedType)) + { + logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); + return Object.class; + } + + Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); + + if (index >= params.length || index < 0) + { + logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + + params.length); + return Object.class; + } + if (!(params[index] instanceof Class)) + { + logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); + return Object.class; + } + + return (Class) params[index]; + } + + public static Class getUserClass(Object instance) + { + if (instance == null) + { + throw new RuntimeException("Instance must not be null"); + } + Class clazz = instance.getClass(); + if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) + { + Class superClass = clazz.getSuperclass(); + if (superClass != null && !Object.class.equals(superClass)) + { + return superClass; + } + } + return clazz; + + } + + /** + * 将反射时的checked exception转换为unchecked exception. + */ + public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) + { + if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException + || e instanceof NoSuchMethodException) + { + return new IllegalArgumentException(msg, e); + } + else if (e instanceof InvocationTargetException) + { + return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException()); + } + return new RuntimeException(msg, e); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SpringUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SpringUtils.java new file mode 100644 index 0000000..ae19071 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SpringUtils.java @@ -0,0 +1,114 @@ +package com.mosty.common.base.entity.log; + +import org.springframework.aop.framework.AopContext; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.stereotype.Component; + +/** + * spring工具类 方便在非spring管理环境中获取bean + * + * @author ruoyi + */ +@Component +public final class SpringUtils implements BeanFactoryPostProcessor +{ + /** Spring应用上下文环境 */ + private static ConfigurableListableBeanFactory beanFactory; + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + { + SpringUtils.beanFactory = beanFactory; + } + + /** + * 获取对象 + * + * @param name + * @return Object 一个以所给名字注册的bean的实例 + * @throws org.springframework.beans.BeansException + * + */ + @SuppressWarnings("unchecked") + public static T getBean(String name) throws BeansException + { + return (T) beanFactory.getBean(name); + } + + /** + * 获取类型为requiredType的对象 + * + * @param clz + * @return + * @throws org.springframework.beans.BeansException + * + */ + public static T getBean(Class clz) throws BeansException + { + T result = (T) beanFactory.getBean(clz); + return result; + } + + /** + * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true + * + * @param name + * @return boolean + */ + public static boolean containsBean(String name) + { + return beanFactory.containsBean(name); + } + + /** + * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) + * + * @param name + * @return boolean + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.isSingleton(name); + } + + /** + * @param name + * @return Class 注册对象的类型 + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static Class getType(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getType(name); + } + + /** + * 如果给定的bean名字在bean定义中有别名,则返回这些别名 + * + * @param name + * @return + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getAliases(name); + } + + /** + * 获取aop代理对象 + * + * @param invoker + * @return + */ + @SuppressWarnings("unchecked") + public static T getAopProxy(T invoker) + { + return (T) AopContext.currentProxy(); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/StringUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/StringUtils.java new file mode 100644 index 0000000..ee4eb5c --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/StringUtils.java @@ -0,0 +1,562 @@ +package com.mosty.common.base.entity.log; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import cn.hutool.core.text.StrFormatter; +import com.mosty.common.base.constant.Constants; +import org.springframework.util.AntPathMatcher; + +/** + * 字符串工具类 + * + * @author ruoyi + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils +{ + /** 空字符串 */ + private static final String NULLSTR = ""; + + /** 下划线 */ + private static final char SEPARATOR = '_'; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) + { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) + { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) + { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + ** @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) + { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) + { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) + { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) + { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) + { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) + { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) + { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) + { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) + { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) + { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) + { + if (str == null) + { + return NULLSTR; + } + + if (start < 0) + { + start = str.length() + start; + } + + if (start < 0) + { + start = 0; + } + if (start > str.length()) + { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) + { + if (str == null) + { + return NULLSTR; + } + + if (end < 0) + { + end = str.length() + end; + } + if (start < 0) + { + start = str.length() + start; + } + + if (end > str.length()) + { + end = str.length(); + } + + if (start > end) + { + return NULLSTR; + } + + if (start < 0) + { + start = 0; + } + if (end < 0) + { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 判断是否为空,并且不是空白字符 + * + * @param str 要判断的value + * @return 结果 + */ + public static boolean hasText(String str) + { + return (str != null && !str.isEmpty() && containsText(str)); + } + + private static boolean containsText(CharSequence str) + { + int strLen = str.length(); + for (int i = 0; i < strLen; i++) + { + if (!Character.isWhitespace(str.charAt(i))) + { + return true; + } + } + return false; + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) + { + if (isEmpty(params) || isEmpty(template)) + { + return template; + } + return StrFormatter.format(template, params); + } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ + public static boolean ishttp(String link) + { + return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); + } + + /** + * 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value + * + * @param collection 给定的集合 + * @param array 给定的数组 + * @return boolean 结果 + */ + public static boolean containsAny(Collection collection, String... array) + { + if (isEmpty(collection) || isEmpty(array)) + { + return false; + } + else + { + for (String str : array) + { + if (collection.contains(str)) + { + return true; + } + } + return false; + } + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) + { + if (str == null) + { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) + { + char c = str.charAt(i); + if (i > 0) + { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } + else + { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) + { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) + { + sb.append(SEPARATOR); + } + else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) + { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) + { + if (str != null && strs != null) + { + for (String s : strs) + { + if (str.equalsIgnoreCase(trim(s))) + { + return true; + } + } + } + return false; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) + { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) + { + // 没必要转换 + return ""; + } + else if (!name.contains("_")) + { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) + { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) + { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 + * 例如:user_name->userName + */ + public static String toCamelCase(String s) + { + if (s == null) + { + return null; + } + if (s.indexOf(SEPARATOR) == -1) + { + return s; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) + { + char c = s.charAt(i); + + if (c == SEPARATOR) + { + upperCase = true; + } + else if (upperCase) + { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } + else + { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) + { + if (isEmpty(str) || isEmpty(strs)) + { + return false; + } + for (String pattern : strs) + { + if (isMatch(pattern, str)) + { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) + { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) + { + return (T) obj; + } + + /** + * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 + * + * @param num 数字对象 + * @param size 字符串指定长度 + * @return 返回数字的字符串格式,该字符串为指定长度。 + */ + public static final String padl(final Number num, final int size) + { + return padl(num.toString(), size, '0'); + } + + /** + * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 + * + * @param s 原始字符串 + * @param size 字符串指定长度 + * @param c 用于补齐的字符 + * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 + */ + public static final String padl(final String s, final int size, final char c) + { + final StringBuilder sb = new StringBuilder(size); + if (s != null) + { + final int len = s.length(); + if (s.length() <= size) + { + for (int i = size - len; i > 0; i--) + { + sb.append(c); + } + sb.append(s); + } + else + { + return s.substring(len - size, len); + } + } + else + { + for (int i = size; i > 0; i--) + { + sb.append(c); + } + } + return sb.toString(); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SysOperLog.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SysOperLog.java new file mode 100644 index 0000000..3adc0dd --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/log/SysOperLog.java @@ -0,0 +1,96 @@ +package com.mosty.common.base.entity.log; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.springframework.validation.annotation.Validated; + +import java.io.Serializable; +import java.util.Date; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel(value = "巡防力量表", description = "") +@TableName("sys_oper_log") +@Validated +public class SysOperLog implements Serializable { + + private static final long serialVersionUID = 2222248015038776527L; + + @Excel(name = "操作序号", cellType = Excel.ColumnType.NUMERIC) + private Long operId; + + @Excel(name = "模块名称") + @ApiModelProperty(value = "模块名称") + private String mkmc; + + @Excel(name = "操作模块") + @ApiModelProperty(value = "操作模块") + private String title; + + @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") + @ApiModelProperty(value = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") + private Integer businessType; + + @Excel(name = "请求方法") + @ApiModelProperty(value = "请求方法") + private String method; + + @Excel(name = "请求方式") + private String requestMethod; + + @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") + private Integer operatorType; + + @Excel(name = "操作人员") + @ApiModelProperty(value = "操作人员") + private String operName; + + @Excel(name = "操作人员ID") + @ApiModelProperty(value = "操作人员ID") + private String operUserId; + + @Excel(name = "操作人员身份证号") + @ApiModelProperty(value = "操作人员身份证号") + private String operSfzh; + + @Excel(name = "部门ID") + private String ssbmid; + + @Excel(name = "部门代码") + private String ssbmdm; + + @Excel(name = "部门名称") + private String ssbm; + + @Excel(name = "请求地址") + private String operUrl; + + @Excel(name = "操作地址") + private String operIp; + + @Excel(name = "请求参数") + private String operParam; + + @Excel(name = "返回参数") + private String jsonResult; + + @Excel(name = "状态", readConverterExp = "0=正常,1=异常") + private Integer status; + + @Excel(name = "错误消息") + private String errorMsg; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date operTime = new Date(); +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/entity/realm/SysUser.java b/common-base-starter/src/main/java/com/mosty/common/base/entity/realm/SysUser.java new file mode 100644 index 0000000..186f3e1 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/entity/realm/SysUser.java @@ -0,0 +1,380 @@ +package com.mosty.common.base.entity.realm; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.mosty.common.base.entity.log.BaseEntity; +import com.mosty.common.base.entity.log.Excel; +import com.mosty.common.base.entity.log.Excels; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 用户对象 sys_user + * + * @author ruoyi + */ +public class SysUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号") + private Long userId; + + /** 部门ID */ + @Excel(name = "部门编号", type = Excel.Type.IMPORT) + private Long deptId; + + /** 部门父ID */ + private Long parentId; + + /** 角色ID */ + private Long roleId; + + /** 登录名称 */ + @Excel(name = "登录名称") + private String loginName; + + /** 用户名称 */ + @Excel(name = "用户名称") + private String userName; + + /** 用户类型 */ + private String userType; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 用户性别 */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 盐加密 */ + private String salt; + + /** 帐号状态(0正常 1停用) */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + @Excel(name = "最后登录IP", type = Excel.Type.EXPORT) + private String loginIp; + + /** 最后登录时间 */ + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT) + private Date loginDate; + + /** 密码最后更新时间 */ + private Date pwdUpdateDate; + + /** 部门对象 */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT) + }) +// private SysDept dept; +// +// private List roles; + + /** 角色组 */ + private Long[] roleIds; + + /** 岗位组 */ + private Long[] postIds; + + public SysUser() + { + + } + + public SysUser(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public boolean isAdmin() + { + return isAdmin(this.userId); + } + + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + +// @Xss(message = "登录账号不能包含脚本字符") +// @NotBlank(message = "登录账号不能为空") +// @Size(min = 0, max = 30, message = "登录账号长度不能超过30个字符") + public String getLoginName() + { + return loginName; + } + + public void setLoginName(String loginName) + { + this.loginName = loginName; + } + +// @Xss(message = "用户昵称不能包含脚本字符") +// @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserType() + { + return userType; + } + + public void setUserType(String userType) + { + this.userType = userType; + } + +// @Email(message = "邮箱格式不正确") +// @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + +// @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") + public String getPhonenumber() + { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) + { + this.phonenumber = phonenumber; + } + + public String getSex() + { + return sex; + } + + public void setSex(String sex) + { + this.sex = sex; + } + + public String getAvatar() + { + return avatar; + } + + public void setAvatar(String avatar) + { + this.avatar = avatar; + } + + @JsonIgnore + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getSalt() + { + return salt; + } + + public void setSalt(String salt) + { + this.salt = salt; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getLoginIp() + { + return loginIp; + } + + public void setLoginIp(String loginIp) + { + this.loginIp = loginIp; + } + + public Date getLoginDate() + { + return loginDate; + } + + public void setLoginDate(Date loginDate) + { + this.loginDate = loginDate; + } + + public Date getPwdUpdateDate() + { + return pwdUpdateDate; + } + + public void setPwdUpdateDate(Date pwdUpdateDate) + { + this.pwdUpdateDate = pwdUpdateDate; + } + +// public SysDept getDept() +// { +// if (dept == null) +// { +// dept = new SysDept(); +// } +// return dept; +// } +// +// public void setDept(SysDept dept) +// { +// this.dept = dept; +// } +// +// public List getRoles() +// { +// return roles; +// } +// +// public void setRoles(List roles) +// { +// this.roles = roles; +// } + + public Long[] getRoleIds() + { + return roleIds; + } + + public void setRoleIds(Long[] roleIds) + { + this.roleIds = roleIds; + } + + public Long[] getPostIds() + { + return postIds; + } + + public void setPostIds(Long[] postIds) + { + this.postIds = postIds; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("deptId", getDeptId()) + .append("loginName", getLoginName()) + .append("userName", getUserName()) + .append("userType", getUserType()) + .append("email", getEmail()) + .append("phonenumber", getPhonenumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("password", getPassword()) + .append("salt", getSalt()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) +// .append("dept", getDept()) +// .append("roles", getRoles()) + .toString(); + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/Asserts.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/Asserts.java new file mode 100644 index 0000000..6095fe0 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/Asserts.java @@ -0,0 +1,97 @@ +package com.mosty.common.base.exception; + + +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpStatus; + +/** + * 断言,快速业务异常 + * @author kevin + * @date 2022/4/28 1:49 下午 + * @since 1.0.0 + */ +@SuppressWarnings("unused") +public class Asserts { + + private Asserts() { + } + + + public static void directThrow(RuntimeException exception) { + throw exception; + } + + /** + * 断言 抛出 {@link BusinessExceptionEnum} 对应的业务异常 + * @param expression 表达式 + * @param message 异常信息 + */ + public static void checkAuth(boolean expression, String message) { + if (expression) { + throw new BusinessException(HttpStatus.UNAUTHORIZED.value(), message); + } + } + + /** + * 断言 抛出 {@link BusinessExceptionEnum} 对应的业务异常 + * @param expression 表达式 + * @param message 异常信息 + * @param args 参数信息 + */ + public static void checkAuth(boolean expression, String message, Object... args) { + if (expression) { + throw new BusinessException(HttpStatus.UNAUTHORIZED.value(), String.format(message, args)); + } + } + + public static void check(boolean expression, String message) { + if (expression) { + throw new BusinessException(message); + } + } + + /** + * 断言 抛出 {@link BusinessExceptionEnum} 对应的业务异常 + * @param expression 表达式 + * @param exceptionEnum 业务异常 + */ + public static void check(boolean expression, BusinessExceptionEnum exceptionEnum) { + check(expression, exceptionEnum.message); + } + + public static void check(boolean expression, RuntimeException e) { + if (expression) { + throw e; + } + } + + public static void check(boolean expression, String message, Object... args) { + if (expression) { + throw new BusinessException(String.format(message, args)); + } + } + + public static void check(boolean expression, String message, Object arg) { + if (expression) { + throw new BusinessException(String.format(message, arg)); + } + } + + public static void notNull(Object object, String name) { + if (object == null) { + throw new BusinessException(name + " is null"); + } + } + + public static void notEmpty(CharSequence s, String name) { + if (StringUtils.isEmpty(s)) { + throw new BusinessException(name + " is empty"); + } + } + + public static void notBlank(CharSequence s, String name) { + if (StringUtils.isBlank(s)) { + throw new BusinessException(name + " is blank"); + } + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessException.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessException.java new file mode 100644 index 0000000..6bd9a3d --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessException.java @@ -0,0 +1,51 @@ +package com.mosty.common.base.exception; + +import io.swagger.models.auth.In; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 业务异常处理器 + * @author kevin + * @date 2022/1/22 4:38 PM + * @since 1.0.0 + */ +@Data +@SuppressWarnings("unused") +@EqualsAndHashCode(callSuper = true) +public class BusinessException extends RuntimeException { + + /** 异常编码 */ + private Integer code; + + /** + * 数据 + */ + private Object data; + + public BusinessException(String message) { + super(message); + } + + public BusinessException(String message, Object data) { + super(message); + this.data = data; + } + + public BusinessException(Integer code, String message, Object data) { + super(message); + this.code = code; + this.data = data; + } + + public BusinessException(Integer code, String message) { + super(message); + this.code = code; + this.data = null; + } + + public BusinessException(String message, Throwable arg) { + super(message, arg); + } + +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessExceptionEnum.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessExceptionEnum.java new file mode 100644 index 0000000..2df7d91 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessExceptionEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.base.exception; + + +/** + * 业务异常枚举, code 为{@code 0} 表示默认值 + * + * @author hongmin.li + * @date 2021/8/17 10:55 + * @since 1.6.5 + */ +public enum BusinessExceptionEnum { + + /** 门店功能配置获取异常 */ + STORE_FUNCTION_EXCEPTION(0, "获取换货比例远程服务异常"), + ; + + public final int code; + + public final String message; + + BusinessExceptionEnum(int code, String message) { + this.code = code; + this.message = message; + } + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessStatus.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessStatus.java new file mode 100644 index 0000000..912c36e --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/BusinessStatus.java @@ -0,0 +1,19 @@ +package com.mosty.common.base.exception; + +/** + * 操作状态 + * + * @author ruoyi + * + */ +public enum BusinessStatus { + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/MostyExceptionHandler.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/MostyExceptionHandler.java new file mode 100644 index 0000000..0e6c6cd --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/MostyExceptionHandler.java @@ -0,0 +1,76 @@ +package com.mosty.common.base.exception; + +import com.mosty.common.base.domain.ResponseResult; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.context.support.DefaultMessageSourceResolvable; +import org.springframework.stereotype.Component; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 全局异常处理 + * @author kevin + * @date 2022/2/22 1:50 PM + * @since 1.0.0 + */ +@Slf4j +@Component +@SuppressWarnings("unused") +@ControllerAdvice(basePackages = "com.mosty") +public class MostyExceptionHandler { + + /** + * 业务异常捕获 + * 需要使用spring mvc的全局异常拦截器处理 + * @param throwable 全局异常 + * @return 信息体 + */ + @ResponseBody + @ExceptionHandler(Throwable.class) + public ResponseResult throwableHandler(Throwable throwable) { + throwable.printStackTrace(); + log.warn("throwable异常:message={}", throwable.getMessage()); + log.warn("throwable异常:stack={}", throwable.getStackTrace()); + return ResponseResult.fail("系统异常,请稍后重试"); + } + + /** + * spring valid框架验证器异常捕获 + * 需要使用spring mvc的全局异常拦截器处理 + * @param validException 验证异常 + * @return 信息体 + */ + @ResponseBody + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseResult validHandler(MethodArgumentNotValidException validException) { + StringBuilder sb = new StringBuilder(); + List allErrors = validException.getBindingResult().getAllErrors(); + String message = allErrors.stream().map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining(";")); + log.warn("调用接口验证异常:message={}", message); + return ResponseResult.fail(message); + } + + /** + * 业务异常捕获 + * 需要使用spring mvc的全局异常拦截器处理 + * @param businessException 业务异常 + * @return 信息体 + */ + @ResponseBody + @ExceptionHandler(BusinessException.class) + public ResponseResult businessHandler(BusinessException businessException) { + log.warn("业务异常:message={}", businessException.getMessage()); + if (businessException.getCode() != null) { + return ResponseResult.fail(businessException.getCode(), businessException.getMessage()); + } + return ResponseResult.fail(businessException.getMessage()); + } + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/ServiceException.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/ServiceException.java new file mode 100644 index 0000000..f81734c --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/ServiceException.java @@ -0,0 +1,50 @@ +package com.mosty.common.base.exception; + +/** + * 业务异常 + * + * @author ruoyi + */ +public final class ServiceException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + *

+ */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public String getDetailMessage() { + return detailMessage; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } + + public String getMessage() { + return message; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } +} \ No newline at end of file diff --git a/common-base-starter/src/main/java/com/mosty/common/base/exception/UtilException.java b/common-base-starter/src/main/java/com/mosty/common/base/exception/UtilException.java new file mode 100644 index 0000000..c80ca24 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/exception/UtilException.java @@ -0,0 +1,26 @@ +package com.mosty.common.base.exception; + +/** + * 工具类异常 + * + * @author ruoyi + */ +public class UtilException extends RuntimeException +{ + private static final long serialVersionUID = 8247610319171014183L; + + public UtilException(Throwable e) + { + super(e.getMessage(), e); + } + + public UtilException(String message) + { + super(message); + } + + public UtilException(String message, Throwable throwable) + { + super(message, throwable); + } +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/AopTargetUtils.java b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/AopTargetUtils.java new file mode 100644 index 0000000..ff6405a --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/AopTargetUtils.java @@ -0,0 +1,48 @@ +package com.mosty.common.base.lock.optimistic; + +import org.springframework.aop.framework.AdvisedSupport; +import org.springframework.aop.framework.AopProxy; +import org.springframework.aop.support.AopUtils; + +import java.lang.reflect.Field; + +public class AopTargetUtils { + + /** + * 递归获取代理的 目标对象 + * @param proxy 代理对象 + * @return 目标对象 + * @throws Exception + */ + public static Object getTarget(Object proxy) throws Exception { + if (!AopUtils.isAopProxy(proxy)) { + return proxy; + } + if (AopUtils.isJdkDynamicProxy(proxy)) { + proxy = getJdkDynamicProxyTargetObject(proxy); + } else { + proxy = getCglibProxyTargetObject(proxy); + } + return getTarget(proxy); + } + + private static Object getCglibProxyTargetObject(Object proxy) throws Exception { + Field h = proxy.getClass().getDeclaredField("CGLIB$CALLBACK_0"); + h.setAccessible(true); + Object dynamicAdvisedInterceptor = h.get(proxy); + Field advised = dynamicAdvisedInterceptor.getClass().getDeclaredField("advised"); + advised.setAccessible(true); + Object target = ((AdvisedSupport) advised.get(dynamicAdvisedInterceptor)).getTargetSource().getTarget(); + return target; + } + + private static Object getJdkDynamicProxyTargetObject(Object proxy) throws Exception { + Field h = proxy.getClass().getSuperclass().getDeclaredField("h"); + h.setAccessible(true); + AopProxy aopProxy = (AopProxy) h.get(proxy); + Field advised = aopProxy.getClass().getDeclaredField("advised"); + advised.setAccessible(true); + Object target = ((AdvisedSupport) advised.get(aopProxy)).getTargetSource().getTarget(); + return target; + } + } diff --git a/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/EnableOptimisticLock.java b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/EnableOptimisticLock.java new file mode 100644 index 0000000..728b059 --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/EnableOptimisticLock.java @@ -0,0 +1,32 @@ +package com.mosty.common.base.lock.optimistic; + + +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.support.AbstractApplicationContext; + +import java.lang.annotation.*; + + +/** + * 允许启动乐观锁自定义插件 + * + * @author kevin + * @date 2020/8/11 0:03 + * @since 1.0.0 + * @see AbstractApplicationContext#refresh() + * @see AbstractApplicationContext {@code invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory) } + * @see org.springframework.context.annotation + * {@code ConfigurationClassParser#processImports(ConfigurationClass, ConfigurationClassParser.SourceClass, Collection, boolean)} + * + * @see OptimisticLockException 需要关注跑出的检查异常,后面根据业务给予处理 + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Configuration +//@Import(OptimisticLockConfiguration.class) +@Deprecated +public @interface EnableOptimisticLock { + +} diff --git a/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/OptimisticLock.java b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/OptimisticLock.java new file mode 100644 index 0000000..35a6f1a --- /dev/null +++ b/common-base-starter/src/main/java/com/mosty/common/base/lock/optimistic/OptimisticLock.java @@ -0,0 +1,300 @@ +//package com.mosty.common.base.lock.optimistic; +// +//import lombok.extern.slf4j.Slf4j; +//import org.apache.ibatis.binding.MapperMethod; +//import org.apache.ibatis.executor.Executor; +//import org.apache.ibatis.executor.parameter.ParameterHandler; +//import org.apache.ibatis.executor.statement.StatementHandler; +//import org.apache.ibatis.mapping.BoundSql; +//import org.apache.ibatis.mapping.MappedStatement; +//import org.apache.ibatis.mapping.ParameterMapping; +//import org.apache.ibatis.mapping.SqlCommandType; +//import org.apache.ibatis.plugin.*; +//import org.apache.ibatis.reflection.MetaObject; +//import org.apache.ibatis.reflection.SystemMetaObject; +//import org.apache.ibatis.session.Configuration; +//import org.apache.ibatis.session.SqlSessionFactory; +//import org.apache.ibatis.type.JdbcType; +//import org.apache.ibatis.type.TypeException; +//import org.apache.ibatis.type.TypeHandler; +// +//import java.lang.reflect.Proxy; +//import java.sql.Connection; +//import java.sql.PreparedStatement; +//import java.sql.SQLException; +//import java.util.Objects; +//import java.util.Properties; +//import java.util.regex.Pattern; +// +// +///** +// * Mybatis 自定义插件,{@link OptimisticLock} 就是一个{@link Plugin} +// * +// * 使用:1、如果某些 Mapper 不想使用乐观锁,可以在Mapper.xml 中不添加 乐观锁字段即可,如: +// * +// * UPDATE CONF_ORDER_APPROVE +// * +// * ORDER_TYPE_CODE = #{orderTypeCode}, +// * RECEIVE_ORG_CODE = #{receiveOrgCode}, +// * +// * OBJECT_VERSION_NUMBER = #{objectVersionNumber}, +// * +// * WHERE ID = #{id} +// * +// * 2、业务端自行根据update的条数进行处理(给用户相应的提示等)或不处理(可能update本身就可能不会修改任何数据) +// * 3、乐观锁的字段类型必须为{@link Long} ,可以对乐观锁的数据库的java pojo字段进行定义,【注意: OptimisticLock只能放在SqlInterceptor和ResultInterceptor之后】如下: +// * +// * +// * +// * +// * +// * +// * +// * +// * +// * +// * +// * 每一个拦截器可以拦截下面的四种,当前只拦截了三种 +// * Executor (update, query, flushStatements, commit, rollback, getTransaction, close, isClosed) +// * ParameterHandler (getParameterObject, setParameters) +// * ResultSetHandler (handleResultSets, handleOutputParameters) +// * StatementHandler (prepare, parameterize, batch, update, query) +// * +// * @author kevin +// * @date 2020/8/10 22:14 +// * @since 1.0.0 +// * @see org.apache.ibatis.session.Configuration#interceptorChain +// * @see Plugin#signatureMap 其中:Map, Set> Class 为所有需要实现乐观锁的Mapper,Set集合为需要乐观锁的方法集合【原则上是所有写的方法】 +// * @see Invocation#proceed() 直接执行被代理对象的方法 +// * @see MappedStatement 对应每个mapper中的 + select * FROM sys_dict + + + zdmc like CONCAT('%',#{dictName,jdbcType=VARCHAR},'%') + + + zdmc = #{dictCode} + + + + + diff --git a/common-config-starter/src/main/resources/mapper/SysVersionManageMapper.xml b/common-config-starter/src/main/resources/mapper/SysVersionManageMapper.xml new file mode 100644 index 0000000..07a3ad7 --- /dev/null +++ b/common-config-starter/src/main/resources/mapper/SysVersionManageMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-config-starter/target/classes/META-INF/spring.factories b/common-config-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..86b5520 --- /dev/null +++ b/common-config-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,5 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.config.CommonConfigAutoConfiguration,\ +com.mosty.common.config.ConfigServiceFactory,\ +com.mosty.common.config.config.DictElementConfig,\ +com.mosty.common.config.config.SystemConfig \ No newline at end of file diff --git a/common-config-starter/target/classes/com/mosty/common/config/CommonConfigAutoConfiguration.class b/common-config-starter/target/classes/com/mosty/common/config/CommonConfigAutoConfiguration.class new file mode 100644 index 0000000..c75df2a Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/CommonConfigAutoConfiguration.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/ConfigServiceFactory.class b/common-config-starter/target/classes/com/mosty/common/config/ConfigServiceFactory.class new file mode 100644 index 0000000..e3994e2 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/ConfigServiceFactory.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/Excel/DictUtils.class b/common-config-starter/target/classes/com/mosty/common/config/Excel/DictUtils.class new file mode 100644 index 0000000..0ce1728 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/Excel/DictUtils.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelExp.class b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelExp.class new file mode 100644 index 0000000..c55bdd8 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelExp.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtil.class b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtil.class new file mode 100644 index 0000000..38fc6b4 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtil.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtilManySheet.class b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtilManySheet.class new file mode 100644 index 0000000..619d165 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/Excel/ExcelUtilManySheet.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/config/DictElementConfig.class b/common-config-starter/target/classes/com/mosty/common/config/config/DictElementConfig.class new file mode 100644 index 0000000..d3d3329 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/config/DictElementConfig.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/config/SystemConfig.class b/common-config-starter/target/classes/com/mosty/common/config/config/SystemConfig.class new file mode 100644 index 0000000..92a1cc2 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/config/SystemConfig.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/constant/enums/DictElementEnum.class b/common-config-starter/target/classes/com/mosty/common/config/constant/enums/DictElementEnum.class new file mode 100644 index 0000000..5b67c6d Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/constant/enums/DictElementEnum.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/controller/SysConfigController.class b/common-config-starter/target/classes/com/mosty/common/config/controller/SysConfigController.class new file mode 100644 index 0000000..482ae60 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/controller/SysConfigController.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictController.class b/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictController.class new file mode 100644 index 0000000..22d02fc Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictController.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictItemController.class b/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictItemController.class new file mode 100644 index 0000000..91ba56f Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/controller/SysDictItemController.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/controller/SysVersionManageController.class b/common-config-starter/target/classes/com/mosty/common/config/controller/SysVersionManageController.class new file mode 100644 index 0000000..1e67af6 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/controller/SysVersionManageController.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/SysConfig.class b/common-config-starter/target/classes/com/mosty/common/config/entity/SysConfig.class new file mode 100644 index 0000000..100352e Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/SysConfig.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/SysDict.class b/common-config-starter/target/classes/com/mosty/common/config/entity/SysDict.class new file mode 100644 index 0000000..c78b292 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/SysDict.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/SysDictItem.class b/common-config-starter/target/classes/com/mosty/common/config/entity/SysDictItem.class new file mode 100644 index 0000000..cb227d9 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/SysDictItem.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/SysVersionManage.class b/common-config-starter/target/classes/com/mosty/common/config/entity/SysVersionManage.class new file mode 100644 index 0000000..88a670a Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/SysVersionManage.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddDictItemVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddDictItemVO.class new file mode 100644 index 0000000..c52aacb Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddDictItemVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddPositionVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddPositionVO.class new file mode 100644 index 0000000..2a97d26 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddPositionVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysConfigVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysConfigVO.class new file mode 100644 index 0000000..70ac32e Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysConfigVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysDictVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysDictVO.class new file mode 100644 index 0000000..af6fae8 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddSysDictVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddVersionManageVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddVersionManageVO.class new file mode 100644 index 0000000..f8d291b Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/AddVersionManageVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/ConfigPage.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/ConfigPage.class new file mode 100644 index 0000000..d75302d Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/ConfigPage.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DeleteVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DeleteVO.class new file mode 100644 index 0000000..18590c3 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DeleteVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DictPage.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DictPage.class new file mode 100644 index 0000000..fca2c5d Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/DictPage.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditDictItemVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditDictItemVO.class new file mode 100644 index 0000000..354ea1c Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditDictItemVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditPositionVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditPositionVO.class new file mode 100644 index 0000000..657265b Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditPositionVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysConfigVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysConfigVO.class new file mode 100644 index 0000000..e21e1e0 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysConfigVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictItemVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictItemVO.class new file mode 100644 index 0000000..869c266 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictItemVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictVO.class new file mode 100644 index 0000000..e8ca663 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditSysDictVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditVersionManageVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditVersionManageVO.class new file mode 100644 index 0000000..5c9164c Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/EditVersionManageVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictItemVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictItemVO.class new file mode 100644 index 0000000..3265475 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictItemVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryPage.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryPage.class new file mode 100644 index 0000000..2a59ed2 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryPage.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryVo.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryVo.class new file mode 100644 index 0000000..7dfd9ea Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictQueryVo.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictVO.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictVO.class new file mode 100644 index 0000000..0d0a811 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/SysDictVO.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/entity/vo/VersionManagePage.class b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/VersionManagePage.class new file mode 100644 index 0000000..2d12d67 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/entity/vo/VersionManagePage.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/mapper/SysConfigMapper.class b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysConfigMapper.class new file mode 100644 index 0000000..846cc06 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysConfigMapper.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictItemMapper.class b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictItemMapper.class new file mode 100644 index 0000000..4b64870 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictItemMapper.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictMapper.class b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictMapper.class new file mode 100644 index 0000000..376d455 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysDictMapper.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/mapper/SysVersionManageMapper.class b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysVersionManageMapper.class new file mode 100644 index 0000000..4e17431 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/mapper/SysVersionManageMapper.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/SysConfigService.class b/common-config-starter/target/classes/com/mosty/common/config/service/SysConfigService.class new file mode 100644 index 0000000..8aaab36 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/SysConfigService.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/SysDictItemService.class b/common-config-starter/target/classes/com/mosty/common/config/service/SysDictItemService.class new file mode 100644 index 0000000..175fc50 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/SysDictItemService.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/SysDictService.class b/common-config-starter/target/classes/com/mosty/common/config/service/SysDictService.class new file mode 100644 index 0000000..8607685 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/SysDictService.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/SysVersionManageService.class b/common-config-starter/target/classes/com/mosty/common/config/service/SysVersionManageService.class new file mode 100644 index 0000000..cbf9c5c Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/SysVersionManageService.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysConfigServiceImpl.class b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysConfigServiceImpl.class new file mode 100644 index 0000000..dde35e7 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysConfigServiceImpl.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictItemServiceImpl.class b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictItemServiceImpl.class new file mode 100644 index 0000000..4283cfc Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictItemServiceImpl.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictServiceImpl.class b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictServiceImpl.class new file mode 100644 index 0000000..7687e44 Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysDictServiceImpl.class differ diff --git a/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysVersionManageServiceImpl.class b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysVersionManageServiceImpl.class new file mode 100644 index 0000000..412242a Binary files /dev/null and b/common-config-starter/target/classes/com/mosty/common/config/service/impl/SysVersionManageServiceImpl.class differ diff --git a/common-config-starter/target/classes/mapper/SysConfigMapper.xml b/common-config-starter/target/classes/mapper/SysConfigMapper.xml new file mode 100644 index 0000000..2da6eea --- /dev/null +++ b/common-config-starter/target/classes/mapper/SysConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-config-starter/target/classes/mapper/SysDictItemMapper.xml b/common-config-starter/target/classes/mapper/SysDictItemMapper.xml new file mode 100644 index 0000000..df53459 --- /dev/null +++ b/common-config-starter/target/classes/mapper/SysDictItemMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-config-starter/target/classes/mapper/SysDictMapper.xml b/common-config-starter/target/classes/mapper/SysDictMapper.xml new file mode 100644 index 0000000..6d34a17 --- /dev/null +++ b/common-config-starter/target/classes/mapper/SysDictMapper.xml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/common-config-starter/target/classes/mapper/SysVersionManageMapper.xml b/common-config-starter/target/classes/mapper/SysVersionManageMapper.xml new file mode 100644 index 0000000..07a3ad7 --- /dev/null +++ b/common-config-starter/target/classes/mapper/SysVersionManageMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-config-starter/target/common-config-starter-1.0.0-SNAPSHOT.jar b/common-config-starter/target/common-config-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..ae3f404 Binary files /dev/null and b/common-config-starter/target/common-config-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-config-starter/target/maven-archiver/pom.properties b/common-config-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..32f2ba7 --- /dev/null +++ b/common-config-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:15 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-config-starter diff --git a/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..fef343b --- /dev/null +++ b/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,48 @@ +com\mosty\common\config\CommonConfigAutoConfiguration.class +com\mosty\common\config\entity\vo\EditSysDictVO.class +com\mosty\common\config\controller\SysConfigController.class +com\mosty\common\config\config\DictElementConfig.class +com\mosty\common\config\service\impl\SysVersionManageServiceImpl.class +com\mosty\common\config\entity\vo\AddVersionManageVO.class +com\mosty\common\config\mapper\SysVersionManageMapper.class +com\mosty\common\config\entity\SysConfig.class +com\mosty\common\config\ConfigServiceFactory.class +com\mosty\common\config\controller\SysDictController.class +com\mosty\common\config\service\impl\SysDictItemServiceImpl.class +com\mosty\common\config\mapper\SysDictItemMapper.class +com\mosty\common\config\service\impl\SysDictServiceImpl.class +com\mosty\common\config\Excel\ExcelUtilManySheet.class +com\mosty\common\config\entity\vo\EditSysDictItemVO.class +com\mosty\common\config\entity\vo\AddSysConfigVO.class +com\mosty\common\config\Excel\ExcelExp.class +com\mosty\common\config\entity\SysDict.class +com\mosty\common\config\entity\vo\SysDictQueryPage.class +com\mosty\common\config\entity\vo\VersionManagePage.class +com\mosty\common\config\controller\SysVersionManageController.class +com\mosty\common\config\entity\vo\SysDictQueryVo.class +com\mosty\common\config\mapper\SysConfigMapper.class +com\mosty\common\config\service\SysDictService.class +com\mosty\common\config\service\SysVersionManageService.class +com\mosty\common\config\controller\SysDictItemController.class +com\mosty\common\config\entity\vo\AddDictItemVO.class +com\mosty\common\config\Excel\ExcelUtil.class +com\mosty\common\config\service\SysConfigService.class +com\mosty\common\config\entity\vo\EditDictItemVO.class +com\mosty\common\config\entity\vo\SysDictItemVO.class +com\mosty\common\config\entity\SysVersionManage.class +com\mosty\common\config\constant\enums\DictElementEnum.class +com\mosty\common\config\config\SystemConfig.class +com\mosty\common\config\entity\vo\EditPositionVO.class +com\mosty\common\config\entity\vo\AddPositionVO.class +com\mosty\common\config\entity\vo\EditVersionManageVO.class +com\mosty\common\config\entity\vo\AddSysDictVO.class +com\mosty\common\config\entity\SysDictItem.class +com\mosty\common\config\mapper\SysDictMapper.class +com\mosty\common\config\entity\vo\EditSysConfigVO.class +com\mosty\common\config\service\impl\SysConfigServiceImpl.class +com\mosty\common\config\entity\vo\SysDictVO.class +com\mosty\common\config\entity\vo\ConfigPage.class +com\mosty\common\config\Excel\DictUtils.class +com\mosty\common\config\entity\vo\DeleteVO.class +com\mosty\common\config\entity\vo\DictPage.class +com\mosty\common\config\service\SysDictItemService.class diff --git a/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..cf731cb --- /dev/null +++ b/common-config-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,48 @@ +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\controller\SysConfigController.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditPositionVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\SysDictVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditVersionManageVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\CommonConfigAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\SysDict.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\mapper\SysConfigMapper.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\ConfigServiceFactory.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditSysDictVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\mapper\SysVersionManageMapper.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\SysVersionManage.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\config\DictElementConfig.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\ConfigPage.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\AddVersionManageVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\impl\SysVersionManageServiceImpl.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\SysDictItem.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\controller\SysDictItemController.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\AddSysDictVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\SysDictQueryPage.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\SysDictItemService.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\SysDictService.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\AddDictItemVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditSysConfigVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\config\SystemConfig.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\Excel\ExcelUtil.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\impl\SysDictServiceImpl.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\Excel\ExcelUtilManySheet.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\DeleteVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditDictItemVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\SysDictItemVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\EditSysDictItemVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\Excel\ExcelExp.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\AddSysConfigVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\AddPositionVO.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\SysConfigService.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\SysVersionManageService.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\constant\enums\DictElementEnum.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\SysDictQueryVo.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\Excel\DictUtils.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\mapper\SysDictMapper.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\impl\SysConfigServiceImpl.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\SysConfig.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\VersionManagePage.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\service\impl\SysDictItemServiceImpl.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\controller\SysDictController.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\mapper\SysDictItemMapper.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\controller\SysVersionManageController.java +C:\tools\dy外网\mosty-common\common-config-starter\src\main\java\com\mosty\common\config\entity\vo\DictPage.java diff --git a/common-core-starter/common-core-starter.iml b/common-core-starter/common-core-starter.iml new file mode 100644 index 0000000..c70e5ea --- /dev/null +++ b/common-core-starter/common-core-starter.iml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-core-starter/pom.xml b/common-core-starter/pom.xml new file mode 100644 index 0000000..cad3794 --- /dev/null +++ b/common-core-starter/pom.xml @@ -0,0 +1,112 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-core-starter + + + 8 + 8 + 1.8.0 + 2.3.2 + + + + + com.mosty + common-config-starter + 1.0.0-SNAPSHOT + + + com.mosty + common-token-starter + 1.0.0-SNAPSHOT + + + + org.projectlombok + lombok + 1.16.18 + provided + + + + + org.apache.shiro + shiro-core + + + + + org.apache.shiro + shiro-ehcache + + + + + org.springframework.boot + spring-boot-starter-validation + ${spring-boot-dependencies.version} + + + + + com.github.penggle + kaptcha + ${kaptcha.version} + + + com.mosty + common-redis-starter + 1.0.0-SNAPSHOT + + + + com.auth0 + java-jwt + 3.8.1 + + + + + io.minio + minio + 8.0.3 + + + + org.apache.httpcomponents + httpclient + 4.5.12 + + + + + + mosty-nexus-releases + release version + http://47.108.232.77:8181/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://47.108.232.77:8181/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/CoreAutoConfiguration.java b/common-core-starter/src/main/java/com/mosty/common/core/CoreAutoConfiguration.java new file mode 100644 index 0000000..7a2e9c0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/CoreAutoConfiguration.java @@ -0,0 +1,16 @@ +package com.mosty.common.core; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Configuration; + +/** + * + * @author kevin + * @date 2022/2/3 7:28 PM + * @since 1.0.0 + */ +@Configuration +@MapperScan("com.mosty.common.core.business.mapper") +public class CoreAutoConfiguration { + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigController.java new file mode 100644 index 0000000..7654249 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigController.java @@ -0,0 +1,107 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysAppHomeconfig; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.service.SysAppHomeconfigService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * app首页表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app首页接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysAppHomeconfig") +public class SysAppHomeconfigController { + + private SysAppHomeconfigService sysAppHomeconfigService; + + /** + * 添加首页应用 + * @param configVO 部门 + * @return 添加结果 + */ + @PostMapping("addAppHome") + @JwtSysUser + @ApiOperation(value = "添加首页应用", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用",businessType = BusinessType.INSERT) + public ResponseResult addApp(@RequestBody @Valid SysAppHomeconfigVO configVO, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigService.saveInfo(configVO, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改首页 + * @param configVO 首页信息 + * @return 修改结果 + */ + @PostMapping("updateAppHome") + @JwtSysUser + @Log(title = "首页应用",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改首页", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateAppHome(@RequestBody @Valid SysAppHomeconfigVO configVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigService.updateInfo(configVO, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除应用信息 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "应用功能",businessType = BusinessType.DELETE) + @PostMapping("deleteApp") + @JwtSysUser + @ApiOperation(value = "删除应用信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteApp(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysAppHomeconfigService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysAppHomeconfigPage deptPage) { + IPage deptIPage = sysAppHomeconfigService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + + @GetMapping("queryConfig") + @ApiOperation(value = "查询应用配置", httpMethod = "GET", response = SysDept.class) + public ResponseResult queryConfig(SysAppHomeconfigQuery configQuery) { + SysAppHomeconfigRsVO vo = sysAppHomeconfigService.queryConfig(configQuery); + return ResponseResult.success(vo); + } + + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.java new file mode 100644 index 0000000..8ec4c1c --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.java @@ -0,0 +1,127 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlatePage; +import com.mosty.common.core.business.service.SysAppHomeconfigPlateService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * app首页-板块表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app首页板块接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysAppHomeconfigPlate") +public class SysAppHomeconfigPlateController { + + private SysAppHomeconfigPlateService sysAppHomeconfigPlateService; + + /** + * 添加首页应用 + * @param plate 部门 + * @return 添加结果 + */ + @PostMapping("addPlate") + @JwtSysUser + @ApiOperation(value = "添加首页应用板块", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult addPlate(@RequestBody @Valid SysAppHomeconfigPlate plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateService.saveInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 添加首页应用 + * @param plates 部门 + * @return 添加结果 + */ + @PostMapping("addBatch") + @JwtSysUser + @ApiOperation(value = "批量添加首页应用板块", httpMethod = "POST", response = Boolean.class) + @Log(title = "批量添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult addPlateBatch(@RequestBody List plates, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateService.saveInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改首页板块 + * @param plate 首页板块信息 + * @return 修改结果 + */ + @PostMapping("updatePlate") + @JwtSysUser + @Log(title = "首页应用板块",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改首页应用板块", httpMethod = "POST", response = Boolean.class) + public ResponseResult updatePlate(@RequestBody @Valid SysAppHomeconfigPlate plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateService.updateInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 批量修改首页应用板块 + * @param plates 首页板块信息 + * @return 修改结果 + */ + @PostMapping("updateBatch") + @JwtSysUser + @Log(title = "批量修改首页应用板块",businessType = BusinessType.UPDATE) + @ApiOperation(value = "批量修改首页应用板块", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateBatch(@RequestBody List plates, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateService.updateInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除应用板块信息 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "删除应用板块功能",businessType = BusinessType.DELETE) + @PostMapping("deletePlate") + @JwtSysUser + @ApiOperation(value = "删除应用信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deletePlate(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysAppHomeconfigPlateService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysAppHomeconfigPlatePage deptPage) { + IPage deptIPage = sysAppHomeconfigPlateService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.java new file mode 100644 index 0000000..78d36b7 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.java @@ -0,0 +1,127 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlateListPage; +import com.mosty.common.core.business.service.SysAppHomeconfigPlateListService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * app首页配置-板块内容表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app板块内容接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysAppHomeconfigPlatelList") +public class SysAppHomeconfigPlateListController { + + private SysAppHomeconfigPlateListService sysAppHomeconfigPlateListService; + + /** + * 添加首页应用板块内容 + * @param plate 部门 + * @return 添加结果 + */ + @PostMapping("addPlate") + @JwtSysUser + @ApiOperation(value = "添加首页应用板块内容", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult addPlate(@RequestBody SysAppHomeconfigPlateList plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateListService.saveInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 添加首页应用板块内容 + * @param plates 部门 + * @return 添加结果 + */ + @PostMapping("addBatch") + @JwtSysUser + @ApiOperation(value = "批量添加首页应用板块内容", httpMethod = "POST", response = Boolean.class) + @Log(title = "批量添加首页应用板块内容",businessType = BusinessType.INSERT) + public ResponseResult addPlateBatch(@RequestBody List plates, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateListService.saveInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改首页板块 + * @param plate 首页板块内容信息 + * @return 修改结果 + */ + @PostMapping("updatePlate") + @JwtSysUser + @Log(title = "首页应用板块内容",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改首页应用板块内容", httpMethod = "POST", response = Boolean.class) + public ResponseResult updatePlate(@RequestBody @Valid SysAppHomeconfigPlateList plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateListService.updateInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 批量修改首页应用板块内容 + * @param plates 首页板块信息内容 + * @return 修改结果 + */ + @PostMapping("updateBatch") + @JwtSysUser + @Log(title = "批量修改首页应用板块内容",businessType = BusinessType.UPDATE) + @ApiOperation(value = "批量修改首页应用板块内容", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateBatch(@RequestBody List plates, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysAppHomeconfigPlateListService.updateInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除应用板块信息内容 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "删除应用板块内容功能",businessType = BusinessType.DELETE) + @PostMapping("deletePlate") + @JwtSysUser + @ApiOperation(value = "删除应用板块内容功能", httpMethod = "POST", response = Boolean.class) + public ResponseResult deletePlate(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysAppHomeconfigPlateListService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysAppHomeconfigPlateListPage deptPage) { + IPage deptIPage = sysAppHomeconfigPlateListService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysDeptController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysDeptController.java new file mode 100644 index 0000000..299b2e4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysDeptController.java @@ -0,0 +1,227 @@ +package com.mosty.common.core.business.controller; + + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.service.SysDeptService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * 部门表 前端控制器 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Slf4j +@SuppressWarnings("unused") +@RestController +@AllArgsConstructor +@RequestMapping("/sysDept") +@Api(tags = "部门信息接口") +public class SysDeptController { + + private final SysDeptService sysDeptService; + + @PostMapping("addSysDept") + @JwtSysUser + @ApiOperation(value = "添加部门", httpMethod = "POST", response = Boolean.class) + @Log(title = "部门功能-添加部门", businessType = BusinessType.INSERT) + public ResponseResult addSysDept(@RequestBody @Valid AddDeptVO addDeptVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysDeptService.saveInfo(addDeptVO, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + @PostMapping("updateSysDept") + @JwtSysUser + @Log(title = "部门功能-修改部门", businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改部门", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateSysDept(@RequestBody @Valid SysDeptVO sysDept, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysDeptService.updateInfo(sysDept, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + @Log(title = "部门功能-删除部门信息", businessType = BusinessType.DELETE) + @PostMapping("deleteSysDept") + @JwtSysUser + @ApiOperation(value = "删除部门信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteSysDept(@RequestBody DeleteDeptVO deleteDeptVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + UserInfo userInfo = UserInfoManager.get(); + sysDeptService.delete(deleteDeptVO, ipAddress, userInfo); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询部门信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(DeptPage deptPage) { + + IPage deptIPage = sysDeptService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + + @PostMapping("getChildDeptList") + @ApiOperation(value = "查询子部门集合", httpMethod = "POST", response = SysDeptVO.class) + public ResponseResult> getChildDeptList(Long deptId) { + List list = sysDeptService.getChildDeptList(deptId); + + List resultList = Lists.newArrayList(); + if (CollectionUtils.isNotEmpty(list)) { + resultList = BeanUtil.copyToList(resultList, SysDeptVO.class); + } + return ResponseResult.success(resultList); + } + + @GetMapping("getChildDeptList") + @ApiOperation(value = "查询子部门集合", httpMethod = "POST", response = SysDeptVO.class) + public ResponseResult getDeptByOrgCode(@RequestParam("orgCode") String orgCode) { + Asserts.check(StringUtils.isBlank(orgCode), "查询的组织机构编码不能为空!"); + SysDept sysDept = sysDeptService.getDeptByOrgCode(orgCode); + Asserts.check(sysDept == null, "组织机构编码对应的部门不存在!"); + SysDeptVO sysDeptVO = BeanUtil.copyProperties(sysDept, SysDeptVO.class); + return ResponseResult.success(sysDeptVO); + } + + @JwtSysUser + @PostMapping("getRootDept") + @ApiOperation(value = "获取当前token对应的部门信息", httpMethod = "POST", response = SysDeptVO.class) + public ResponseResult getRootDept(/*Long deptId*/) { + UserInfo userInfo = UserInfoManager.get(); + SysDept sysDept = sysDeptService.getById(userInfo.getDeptId()); + Asserts.check(sysDept == null || DeletedEnum.DELETED.code.equals(sysDept.getXtZxbz()), + "部门不存在,请重新登陆"); + SysDeptVO sysDeptVO = BeanUtil.copyProperties(sysDept, SysDeptVO.class); + return ResponseResult.success(sysDeptVO); + } + + @JwtSysUser + // @PostMapping("getAllChildDeptList") + @ApiOperation(value = "查询所有子部门树", httpMethod = "POST", response = SysDeptVO.class) + public ResponseResult getAllChildDeptList(@RequestBody DeptTreeVO deptTreeVO) { + UserInfo userInfo = UserInfoManager.get(); + SysDept sysDept = sysDeptService.getById(userInfo.getDeptId()); + Asserts.check(sysDept == null || DeletedEnum.DELETED.code.equals(sysDept.getXtZxbz()), + "部门不存在,请求重新登陆"); + SysDeptVO rootSysDeptVo = sysDeptService.getAllChildDeptList(sysDept, deptTreeVO); + return ResponseResult.success(rootSysDeptVo); + } + + @GetMapping("selectUserPageByDept") + @ApiOperation(value = "分页查询部门下用户信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectUserPageByDept(UserByDeptPage userByDeptPage) { + IPage deptIPage = sysDeptService.selectUserPageByDept(userByDeptPage); + return ResponseResult.success(deptIPage); + } + + @GetMapping("selectRolePageByDept") + @ApiOperation(value = "分页查询部门下角色信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectRolePageByDept(RoleByDeptPage roleByDeptPage) { + IPage deptIPage = sysDeptService.selectRolePageByDept(roleByDeptPage); + return ResponseResult.success(deptIPage); + } + + @PostMapping("saveUserDeptInfo") + @JwtSysUser + @Log(title = "部门功能", businessType = BusinessType.GRANT) + @ApiOperation(value = "添加用户部门关联关系", httpMethod = "POST", response = Boolean.class) + public ResponseResult saveUserDeptInfo(@RequestBody AddUserDeptVO addUserDeptVO) { + sysDeptService.saveUserDeptInfo(addUserDeptVO); + return ResponseResult.success(Boolean.TRUE); + } + + @PostMapping("saveRoleDeptInfo") + @JwtSysUser + @Log(title = "部门功能", businessType = BusinessType.GRANT) + @ApiOperation(value = "添加角色部门关联关系", httpMethod = "POST", response = Boolean.class) + public ResponseResult saveRoleDeptInfo(@RequestBody AddRoleDeptVO roleDeptVO) { + sysDeptService.saveRoleDeptInfo(roleDeptVO); + return ResponseResult.success(Boolean.TRUE); + } + + @PostMapping("deleteUserDeptInfo") + @JwtSysUser + @Log(title = "部门功能", businessType = BusinessType.OTHER) + @ApiOperation(value = "删除用户部门关联关系", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteUserDeptInfo(@RequestBody DeleteUserDeptVO deleteUserDeptVO) { + sysDeptService.deleteUserDeptInfo(deleteUserDeptVO); + return ResponseResult.success(Boolean.TRUE); + } + + @JwtSysUser + @GetMapping("selectDept") + @ApiOperation(value = "查询部门列表信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectDept(DeptQuery dto) { + return ResponseResult.success(sysDeptService.selectDept(dto)); + } + + +// @PostMapping("deleteRoleDeptInfo") +// @JwtSysUser +// @Log(title = "部门功能", businessType = BusinessType.OTHER) +// @ApiOperation(value = "删除角色部门关联关系", httpMethod = "POST", response = Boolean.class) +// public ResponseResult deleteRoleDeptInfo(@RequestBody DeleteRoleDeptVO deleteRoleDeptVO) { +// sysDeptService.deleteRoleDeptInfo(deleteRoleDeptVO); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// @JwtSysUser +// @GetMapping("selectNextPage") +// @ApiOperation(value = "根据部门编码分页查询当前及下级部门信息", httpMethod = "GET", response = SysDept.class) +// public ResponseResult> selectNextPage(DeptPage deptPage) { +// IPage deptIPage = sysDeptService.selectNextPage(deptPage); +// return ResponseResult.success(deptIPage); +// } + + @GetMapping("getDeptList") + @ApiOperation(value = "根据部门编码分页查询当前及下级部门信息--第三方接口", httpMethod = "GET", response = SysDept.class) + public ResponseResult> getDeptList(DeptPage deptPage) { + IPage deptIPage = sysDeptService.getDeptList(deptPage); + return ResponseResult.success(deptIPage); + } + + @GetMapping("deptSys") + @ApiOperation(value = "部门信息同步", httpMethod = "GET", response = Boolean.class) + public ResponseResult deptSys() { + Boolean bool = sysDeptService.deptSys(); + return ResponseResult.success(bool); + } + + @ApiOperation("查询部门下的所有子部门信息") + @GetMapping("getChildDept/{deptid}") + public ResponseResult> getChildDept(@PathVariable("deptid") String deptid) { + return ResponseResult.success(this.sysDeptService.getChildDept(deptid)); + } + + @ApiOperation("查询部门下的所有子部门信息") + @GetMapping("getChildDeptByOrgCode/{orgcode}") + public ResponseResult> getChildDeptByOrgCode(@PathVariable("orgcode") String orgcode) { + return ResponseResult.success(this.sysDeptService.getChildDeptByOrgCode(orgcode)); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysLogininforController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysLogininforController.java new file mode 100644 index 0000000..d005362 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysLogininforController.java @@ -0,0 +1,75 @@ +package com.mosty.common.core.business.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.common.config.Excel.ExcelUtil; +import com.mosty.common.core.business.entity.SysLogininfor; +import com.mosty.common.core.business.entity.request.LoginLogPage; +import com.mosty.common.core.business.entity.vo.DeleteListVO; +import com.mosty.common.core.business.service.SysLogininforService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@Slf4j +@SuppressWarnings("unused") +@RestController +@AllArgsConstructor +@RequestMapping("/sysLoginLog") +@Api(tags = "登录日志") +public class SysLogininforController { + + private final SysLogininforService sysLogininforService; + + @PostMapping("/list") + @JwtSysUser + @Log(title = "查询登录日志列表", businessType = BusinessType.DELETE) + public ResponseResult> list(@RequestBody LoginLogPage loginLogPage) { + IPage sysOperLogPage = sysLogininforService.selectByPage(loginLogPage); + return ResponseResult.success(sysOperLogPage); + } + + @Log(title = "登录日志删除", businessType = BusinessType.OTHER) + @PostMapping("/remove") + public ResponseResult remove(@RequestBody DeleteListVO vo) { + sysLogininforService.deleteOperLogByIds(vo.getIds()); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("/detail/{id}") + public ResponseResult detail(@PathVariable("id") Long id) { + SysLogininfor log = sysLogininforService.getOne(new LambdaQueryWrapper() + .eq(SysLogininfor::getInfoId,id)); + return ResponseResult.success(log); + } + + @Log(title = "登录日志", businessType = BusinessType.CLEAN) + @PostMapping("/clean") + @ResponseBody + public ResponseResult clean() { + sysLogininforService.cleanOperLog(); + return ResponseResult.success(Boolean.TRUE); + } + + +// @Log(title = "导出巡防力量", businessType = BusinessType.EXPORT) +// @PostMapping("/exportZY") +// @JwtSysUser +// public void export(HttpServletResponse response) { +// List list = sysLogininforService.export(); +// ExcelUtil util = new ExcelUtil< +// >(SysLogininfor.class); +// util.exportExcel(response, list, "登录日志"); +// } + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysMenuController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysMenuController.java new file mode 100644 index 0000000..b45644d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysMenuController.java @@ -0,0 +1,186 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.constant.enums.MenuTypeEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.config.entity.vo.DeleteVO; +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.business.entity.vo.AddSysMenuVO; +import com.mosty.common.core.business.entity.vo.EditSysMenuVO; +import com.mosty.common.core.business.entity.vo.MenuPage; +import com.mosty.common.core.business.entity.vo.MenuQuery; +import com.mosty.common.core.business.service.SysMenuService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +/** + *

+ * 菜单表 前端控制器 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Slf4j +@RestController +@AllArgsConstructor +@SuppressWarnings("unused") +@RequestMapping("/sysMenu") +@Api(tags = "菜单信息接口") +public class SysMenuController { + + private final SysMenuService sysMenuService; + + /** + * 添加菜单 + * @param addSysMenuVo 添加菜单请求 + * @return 添加结果 + */ + @JwtSysUser + @PostMapping("addSysMenu") + @Log(title = "菜单功能",businessType = BusinessType.INSERT) + @ApiOperation(value = "添加菜单", httpMethod = "POST", response = Boolean.class) + public ResponseResult addSysMenu(@RequestBody @Valid AddSysMenuVO addSysMenuVo) { + + MenuTypeEnum menuTypeEnum = MenuTypeEnum.valueOf(addSysMenuVo.getMenuType()); + Asserts.check(menuTypeEnum == null, "菜单类型有误,请检查"); + /* Asserts.check(menuTypeEnum == MenuTypeEnum.RESOURCE && StringUtils.isNotBlank(addSysMenuVo.getMenuUrl()), + "资源类型菜单不能配置url地址");*/ + + String menuCode = addSysMenuVo.getMenuCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("menu_code", menuCode); + queryWrapper.eq("xt_zxbz", DeletedEnum.NATURE.code); + List list = sysMenuService.list(queryWrapper); + Asserts.check(CollectionUtils.isNotEmpty(list), "菜单编码%s已存在,请修改", menuCode); + + SysMenu parentMenu = null; + if (addSysMenuVo.getParentId() != null) { + parentMenu = sysMenuService.getById(addSysMenuVo.getParentId()); + Asserts.check(parentMenu == null || DeletedEnum.DELETED.code.equals(parentMenu.getXtZxbz()), + "父菜单不存在或已删除"); + } + // 添加菜单信息 + sysMenuService.addSysMenuInfo(addSysMenuVo, parentMenu); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改菜单 + * @param editSysMenuVo 修改菜单请求 + * @return 修改结果 + */ + @JwtSysUser + @Log(title = "菜单功能",businessType = BusinessType.UPDATE) + @PostMapping("updateSysMenu") + @ApiOperation(value = "修改菜单", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateSysMenu(@RequestBody @Valid EditSysMenuVO editSysMenuVo) { + Asserts.check(editSysMenuVo.getId() == null, "主键id不能为空!"); + SysMenu oldSysMenu = sysMenuService.getBaseMapper().selectById(editSysMenuVo.getId()); + Asserts.check(oldSysMenu == null, "主键为 %s 的菜单信息不存在", editSysMenuVo.getId()); + + String menuCode = editSysMenuVo.getMenuCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.ne("id", editSysMenuVo.getId()); + queryWrapper.eq("menu_code", menuCode); + queryWrapper.eq("xt_zxbz", DeletedEnum.NATURE.code); + List list = sysMenuService.list(queryWrapper); + Asserts.check(CollectionUtils.isNotEmpty(list), "菜单编码%s已存在,请修改", menuCode); + + oldSysMenu.setMenuName(editSysMenuVo.getMenuName()); + oldSysMenu.setMenuCode(editSysMenuVo.getMenuCode()); + oldSysMenu.setMenuUrl(editSysMenuVo.getMenuUrl()); + + oldSysMenu.setOrderNo(editSysMenuVo.getOrderNo()); + oldSysMenu.setShowMode(editSysMenuVo.getShowMode()); + oldSysMenu.setBz(editSysMenuVo.getBz()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + + UserInfo userInfo = UserInfoManager.get(); + Asserts.checkAuth(userInfo == null, "用户信息为空,请登陆"); + oldSysMenu.setXtZhxgsj(new Date()); + oldSysMenu.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysMenu.setXtZhxgrxm(userInfo.getUserName()); + oldSysMenu.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysMenu.setXtZhxgrbm(userInfo.getDeptName()); + oldSysMenu.setXtZhxgip(ipAddress); + + sysMenuService.getBaseMapper().updateById(oldSysMenu); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除菜单信息 + * @param deleteVO 菜单id + * @return 删除结果 + */ + @PostMapping("deleteSysMenu") + @JwtSysUser + @Log(title = "菜单功能",businessType = BusinessType.DELETE) + @ApiOperation(value = "删除菜单信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteSysMenu(@RequestBody DeleteVO deleteVO) { + SysMenu oldSysMenu = sysMenuService.getBaseMapper().selectById(deleteVO.getId()); + Asserts.check(oldSysMenu == null, "主键为 %s 的岗位信息不存在", deleteVO.getId()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + + UserInfo userInfo = UserInfoManager.get(); + Asserts.checkAuth(userInfo == null, "用户信息为空,请登陆"); + oldSysMenu.setXtZhxgsj(new Date()); + oldSysMenu.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysMenu.setXtZhxgrxm(userInfo.getUserName()); + oldSysMenu.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysMenu.setXtZhxgrbm(userInfo.getDeptName()); + oldSysMenu.setXtZhxgip(ipAddress); + + oldSysMenu.setXtZxbz(DeletedEnum.DELETED.code); + oldSysMenu.setXtZxyy(deleteVO.getZxyy()); + + sysMenuService.getBaseMapper().updateById(oldSysMenu); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询菜单信息", httpMethod = "GET", response = SysMenu.class) + public ResponseResult> selectPage(MenuPage positionPage) { + IPage positionIPage = sysMenuService.selectByPage(positionPage); + return ResponseResult.success(positionIPage); + } + + @GetMapping("getMenuChild/{menuId}") + @ApiOperation(value = "根据菜单id查询菜单和子页面信息", httpMethod = "GET", response = SysMenu.class) + public ResponseResult getMenuChild(@PathVariable("menuId") Long menuId) { + SysMenu menus= sysMenuService.getMenuChild(menuId); + return ResponseResult.success(menus); + } + + @GetMapping("selectList") + @ApiOperation(value = "查询菜单信息树形", httpMethod = "GET", response = SysMenu.class) + public ResponseResult> selectList(MenuQuery menuQuery) { + List menus = sysMenuService.selectList(menuQuery); + return ResponseResult.success(menus); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysPositionController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysPositionController.java new file mode 100644 index 0000000..057831d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysPositionController.java @@ -0,0 +1,153 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.config.entity.vo.AddPositionVO; +import com.mosty.common.config.entity.vo.DeleteVO; +import com.mosty.common.config.entity.vo.EditPositionVO; +import com.mosty.common.core.business.entity.SysPosition; +import com.mosty.common.core.business.entity.vo.PositionPage; +import com.mosty.common.core.business.service.SysPositionService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; + +/** + *

+ * 岗位表 前端控制器 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Slf4j +@RestController +@AllArgsConstructor +@SuppressWarnings("unused") +@RequestMapping("/sysPosition") +@Api(tags = "岗位信息接口") +public class SysPositionController { + + private final SysPositionService sysPositionService; + + /** + * 添加岗位 + * @param addPositionVO 添加岗位请求 + * @return 添加结果 + */ + @JwtSysUser + @PostMapping("addSysPosition") + @Log(title = "岗位功能",businessType = BusinessType.INSERT) + @ApiOperation(value = "添加岗位", httpMethod = "POST", response = Boolean.class) + public ResponseResult addSysPosition(@RequestBody @Valid AddPositionVO addPositionVO) { + + SysPosition position = new SysPosition(); + + position.setPostDesc(addPositionVO.getPostDesc()); + position.setPostCode(addPositionVO.getPostCode()); + position.setPostName(addPositionVO.getPostName()); + position.setBz(addPositionVO.getBz()); + + UserInfo userInfo = UserInfoManager.get(); + position.setXtZxbz(DeletedEnum.NATURE.code); + + position.setXtCjsj(new Date()); + position.setXtZhxgsj(new Date()); + position.setXtZhxgrid(userInfo.getUserId().toString()); + position.setXtZhxgrxm(userInfo.getUserName()); + position.setXtZhxgrbmid(userInfo.getDeptId().toString()); + position.setXtZhxgrbm(userInfo.getDeptName()); + + position.setXtLrsj(new Date()); + position.setXtLrrid(userInfo.getUserId().toString()); + position.setXtLrrxm(userInfo.getUserName()); + position.setXtLrrbmid(userInfo.getDeptId().toString()); + position.setXtLrrbm(userInfo.getDeptName()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + position.setXtLrip(ipAddress); + position.setXtZhxgip(ipAddress); + + sysPositionService.getBaseMapper().insert(position); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改岗位 + * @param editPositionVO 修改岗位请求 + * @return 修改结果 + */ + @JwtSysUser + @PostMapping("updateSysPosition") + @Log(title = "岗位功能",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改岗位", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateSysPosition(@RequestBody @Valid EditPositionVO editPositionVO) { + Asserts.check(editPositionVO.getId() == null, "主键id不能为空!"); + SysPosition oldSysPosition = sysPositionService.getBaseMapper().selectById(editPositionVO.getId()); + Asserts.check(oldSysPosition == null, "主键为 %s 的岗位信息不存在", editPositionVO.getId()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + oldSysPosition.setXtZhxgip(ipAddress); + + sysPositionService.updateSysPost(oldSysPosition, editPositionVO); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除岗位信息 + * @param deleteVO 岗位id + * @return 删除结果 + */ + @PostMapping("deleteSysPosition") + @JwtSysUser + @Log(title = "岗位功能",businessType = BusinessType.DELETE) + @ApiOperation(value = "删除岗位信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteSysPosition(@RequestBody DeleteVO deleteVO) { + SysPosition oldSysPosition = sysPositionService.getBaseMapper().selectById(deleteVO.getId()); + Asserts.check(oldSysPosition == null, "主键为 %s 的岗位信息不存在", deleteVO.getId()); + + oldSysPosition.setXtZxbz(DeletedEnum.DELETED.code); + oldSysPosition.setXtZxyy(deleteVO.getZxyy()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + + UserInfo userInfo = UserInfoManager.get(); + Asserts.checkAuth(userInfo == null, "用户信息为空,请登陆"); + oldSysPosition.setXtZhxgsj(new Date()); + oldSysPosition.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysPosition.setXtZhxgrxm(userInfo.getUserName()); + oldSysPosition.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysPosition.setXtZhxgrbm(userInfo.getDeptName()); + oldSysPosition.setXtZhxgip(ipAddress); + + sysPositionService.getBaseMapper().updateById(oldSysPosition); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询岗位信息", httpMethod = "GET", response = SysPosition.class) + public ResponseResult> selectPage(PositionPage positionPage) { + IPage positionIPage = sysPositionService.selectByPage(positionPage); + return ResponseResult.success(positionIPage); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysRoleController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysRoleController.java new file mode 100644 index 0000000..cebb826 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysRoleController.java @@ -0,0 +1,281 @@ +package com.mosty.common.core.business.controller; + + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.entity.log.OperatorType; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.config.entity.vo.DeleteVO; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.service.*; +import com.mosty.common.core.config.DefaultRoleConfig; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +/** + *

+ * 角色表 前端控制器 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@SuppressWarnings("unused") +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/sysRole") +@Api(tags = "角色信息接口") +public class SysRoleController { + + private final SysUserService sysUserService; + private final SysRoleService sysRoleService; + private final SysDeptService sysDeptService; + private final SysUserRoleService sysUserRoleService; + private final SysRoleDeptService sysRoleDeptService; + private final DefaultRoleConfig defaultRoleConfig; + private final LoginService loginService; + + @JwtSysUser + @PostMapping("addSysRole") + @Log(title = "角色功能--添加角色", businessType = BusinessType.INSERT) + @ApiOperation(value = "添加角色", httpMethod = "POST", response = Boolean.class) + public ResponseResult addSysRole(@RequestBody @Valid AddRoleVO addRoleVo, + HttpServletRequest servletRequest) { + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(servletRequest); + + String roleCode = addRoleVo.getRoleCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("role_code", roleCode); + queryWrapper.eq("xt_zxbz", DeletedEnum.NATURE.code); + List list = sysRoleService.list(queryWrapper); + Asserts.check(CollectionUtils.isNotEmpty(list), "角色编码%s已存在,请修改", roleCode); + + sysRoleService.insertRole(addRoleVo, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + @JwtSysUser + @PostMapping("updateSysRole") + @Log(title = "角色功能--修改角色信息", businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改角色信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateSysRole(@RequestBody @Valid SysRoleVO sysRoleVO, + HttpServletRequest servletRequest) { + + Asserts.check(sysRoleVO.getId() == null, "主键id不能为空!"); + SysRole oldSysRole = sysRoleService.getBaseMapper().selectById(sysRoleVO.getId()); + Asserts.check(oldSysRole == null, "主键为 %s 的角色信息不存在", sysRoleVO.getId()); + + String roleCode = sysRoleVO.getRoleCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.ne("id", sysRoleVO.getId()); + queryWrapper.eq("role_code", roleCode); + queryWrapper.eq("xt_zxbz", DeletedEnum.NATURE.code); + List list = sysRoleService.list(queryWrapper); + Asserts.check(CollectionUtils.isNotEmpty(list), "角色编码%s已存在,请修改", roleCode); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(servletRequest); + + UserInfo userInfo = UserInfoManager.get(); + oldSysRole.setXtZhxgsj(new Date()); + oldSysRole.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysRole.setXtZhxgrxm(userInfo.getUserName()); + oldSysRole.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysRole.setXtZhxgrbm(userInfo.getDeptName()); + oldSysRole.setXtZhxgip(ipAddress); + + oldSysRole.setRoleName(sysRoleVO.getRoleName()); + oldSysRole.setRoleCode(sysRoleVO.getRoleCode()); + oldSysRole.setRoleDesc(sysRoleVO.getRoleDesc()); + oldSysRole.setBz(sysRoleVO.getBz()); + oldSysRole.setOrderNo(sysRoleVO.getOrderNo()); + oldSysRole.setDataPermissionLevel(sysRoleVO.getDataPermissionLevel()); + + sysRoleService.getBaseMapper().updateById(oldSysRole); + return ResponseResult.success(Boolean.TRUE); + } + + @JwtSysUser + @PostMapping("deleteSysRole") + @Log(title = "角色功能--删除角色信息", businessType = BusinessType.DELETE) + @ApiOperation(value = "删除角色信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteSysRole(@RequestBody DeleteVO deleteVO, HttpServletRequest servletRequest) { + SysRole oldSysRole = sysRoleService.getBaseMapper().selectById(deleteVO.getId()); + Asserts.check(oldSysRole == null, "主键为 %s 的角色信息不存在", deleteVO.getId()); + + QueryWrapper countUserWrapper = new QueryWrapper<>(); + countUserWrapper.eq("role_id", oldSysRole.getId()); + Integer countUser = sysUserRoleService.getBaseMapper().selectCount(countUserWrapper); + Asserts.check(countUser > 0, "存在用户角色,请先删除!"); + + QueryWrapper countDeptWrapper = new QueryWrapper<>(); + countDeptWrapper.eq("role_id", oldSysRole.getId()); + Integer countDept = sysRoleDeptService.getBaseMapper().selectCount(countDeptWrapper); + Asserts.check(countDept > 0, "存在部门角色,请先删除!"); + + // 默认角色不能进行删除 + defaultRoleConfig.getDefaultRoleList().forEach(roleId -> + Asserts.check(oldSysRole.getId().equals(roleId), "默认角色不能进行删除!")); + + oldSysRole.setXtZxbz(DeletedEnum.DELETED.code); + oldSysRole.setXtZxyy(deleteVO.getZxyy()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(servletRequest); + + UserInfo userInfo = UserInfoManager.get(); + oldSysRole.setXtZhxgsj(new Date()); + oldSysRole.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysRole.setXtZhxgrxm(userInfo.getUserName()); + oldSysRole.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysRole.setXtZhxgrbm(userInfo.getDeptName()); + oldSysRole.setXtZhxgip(ipAddress); + + sysRoleService.getBaseMapper().updateById(oldSysRole); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectUnAccreditPage") + @ApiOperation(value = "分页查询未绑定当前用户的角色", httpMethod = "GET", response = SysRole.class) + public ResponseResult> selectUnAccreditPage(RolePage rolePage) { + IPage roleIPage = sysRoleService.selectUnAccreditPage(rolePage); + return ResponseResult.success(roleIPage); + } + + @JwtSysUser + @GetMapping("selectPage") + @ApiOperation(value = "分页查询角色信息", httpMethod = "GET", response = SysRole.class) + public ResponseResult> selectPage(RolePage rolePage) { + + IPage roleIPage = sysRoleService.selectByPage(rolePage); + return ResponseResult.success(roleIPage); + } + + @JwtSysUser + @GetMapping("roleUserList") + @Log(title = "角色功能", businessType = BusinessType.GRANT) + @ApiOperation(value = "查询角色管理的用户【需要控制当前人的权限】", httpMethod = "GET", response = SysUserVO.class) + public ResponseResult> roleUserList(RoleUserPage roleUserPage) { + UserInfo userInfo = UserInfoManager.get(); + SysDept sysDept = sysDeptService.getById(userInfo.getDeptId()); + IPage userPage = sysUserRoleService.roleUserList(sysDept.getRootPath(), roleUserPage); + return ResponseResult.success(userPage); + } + + @JwtSysUser + @PostMapping("grantRoleToUser") + @Log(title = "角色功能--为用户授予角色", businessType = BusinessType.GRANT) + @ApiOperation(value = "为用户授予角色", httpMethod = "POST", response = Boolean.class) + public ResponseResult grantRoleToUser(@RequestBody UserRoleVO userRoleVo) { + UserInfo userInfo = UserInfoManager.get(); + boolean save = sysUserRoleService.grantRoleToUser(userRoleVo); + return ResponseResult.success(save); + } + + @PostMapping("grantUserToRole") + @Log(title = "角色功能--为角色授予用户", businessType = BusinessType.GRANT) + @ApiOperation(value = "为角色授予用户", httpMethod = "POST", response = Boolean.class) + public ResponseResult grantUserToRole(@RequestBody RoleUserVO roleUserVO) { + boolean save = sysUserRoleService.grantUserToRole(roleUserVO); + return ResponseResult.success(save); + } + + @JwtSysUser + @PostMapping("batchUnboundUserRole") + @Log(title = "角色功能--批量解绑用户角色", businessType = BusinessType.OTHER) + @ApiOperation(value = "批量解绑用户角色", httpMethod = "POST", response = Boolean.class) + public ResponseResult batchUnboundUserRole(@RequestBody UnboundUserRoleVO unboundUserRoleVo) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.in("id", unboundUserRoleVo.getIds())); + boolean save = sysUserRoleService.remove(queryWrapper); + return ResponseResult.success(save); + } + + @GetMapping("getUserRoleList/{userId}") + @ApiOperation(value = "查询用户角色列表", httpMethod = "GET", response = SysRoleVO.class) + public ResponseResult> getUserRoleList(@PathVariable Long userId) { + List userRoleList = sysRoleService.getUserRoleList(userId); + return ResponseResult.success(userRoleList); + } + + + @GetMapping("getRoleUserList") + @ApiOperation(value = "查询角色下用户列表", httpMethod = "GET", response = SysRoleVO.class) + public ResponseResult> getRoleUserList(GetUserRoleListVo vo) { + IPage deptIPage = sysRoleService.getRoleUserList(vo); + return ResponseResult.success(deptIPage); + + } + + @PostMapping("saveRoleMenuInfo") + @JwtSysUser + @Log(title = "角色功能--添加角色菜单关联关系", businessType = BusinessType.GRANT) + @ApiOperation(value = "添加角色菜单关联关系", httpMethod = "POST", response = Boolean.class) + public ResponseResult saveRoleMenuInfo(@RequestBody AddRoleMenuVO roleMenuVO) { + log.info("添加角色菜单关联关系 roleMenuVO={}", JSON.toJSONString(roleMenuVO)); + + SysRole sysRole = sysRoleService.getById(roleMenuVO.getRoleId()); + Asserts.check(sysRole == null || DeletedEnum.DELETED.code.equals(sysRole.getXtZxbz()), + "角色id不存在或已删除"); + + sysRoleService.saveRoleMenuInfo(roleMenuVO); + return ResponseResult.success(Boolean.TRUE); + } + + @PostMapping("saveDataPermission") + @JwtSysUser + @Log(title = "角色功能", businessType = BusinessType.GRANT) + @ApiOperation(value = "添加数据权限", httpMethod = "POST", response = Boolean.class) + public ResponseResult saveDataPermission(@RequestBody AddRoleDataPartitionVO addRoleDataPartitionVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysRoleService.saveDataPermission(addRoleDataPartitionVO, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 根据菜单标识查询数据权限 + * + * @param menuUrl 菜单URL + * @return 删除结果 + */ + @PostMapping("getDataPermission/{menuUrl}") + @ApiOperation(value = "根据菜单标识查询数据权限", httpMethod = "GET", response = Boolean.class) + public ResponseResult getDataPermission(@PathVariable("menuUrl") String menuUrl) { + DataPermissionVO dataPermissionVO = sysRoleService.getDataPermission(menuUrl); + return ResponseResult.success(dataPermissionVO); + } + + @GetMapping("getRoleMenuIds/{roleId}") + @ApiOperation(value = "查询用户绑定的菜单ids", httpMethod = "GET", response = SysRoleVO.class) + public ResponseResult> getRoleMenuIds(@PathVariable Long roleId) { + List menuIds = sysRoleService.getRoleMenuIds(roleId); + return ResponseResult.success(menuIds); + + } + + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.java new file mode 100644 index 0000000..e7b3b0f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.java @@ -0,0 +1,157 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUserAppHomeconfig; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.SysAppHomeconfigRsVO; +import com.mosty.common.core.business.entity.vo.SysUserAppHomeconfigVo; +import com.mosty.common.core.business.entity.vo.SysUserHomeconfigVo; +import com.mosty.common.core.business.service.SysUserAppHomeconfigService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * 用户app首页配置表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app用户首页接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysUserAppHomeconfig") +public class SysUserAppHomeconfigController { + + private SysUserAppHomeconfigService sysUserAppHomeconfigService; + + /** + * 添加用户首页应用 + * @param config + * @return 添加结果 + */ + @PostMapping("add") + @JwtSysUser + @ApiOperation(value = "添加首页应用", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult add(@RequestBody @Valid SysUserAppHomeconfig config, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigService.saveInfo(config, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 添加用户首页应用 + * @param plates 部门 + * @return 添加结果 + */ + @PostMapping("addBatch") + @JwtSysUser + @ApiOperation(value = "批量添加首页应用板块", httpMethod = "POST", response = Boolean.class) + @Log(title = "批量添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult addBatch(@RequestBody List plates, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigService.saveInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改用户首页应用 + * @param config 修改用户首页应用信息 + * @return 修改结果 + */ + @PostMapping("update") + @JwtSysUser + @Log(title = "用户首页应用",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改用户首页应用", httpMethod = "POST", response = Boolean.class) + public ResponseResult update(@RequestBody @Valid SysUserAppHomeconfig config, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigService.updateInfo(config, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 批量修改用户首页应用 + * @param plates 首页板块信息 + * @return 修改结果 + */ + @PostMapping("updateBatch") + @JwtSysUser + @Log(title = "批量修改用户首页应用",businessType = BusinessType.UPDATE) + @ApiOperation(value = "批量修改用户首页应用", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateBatch(@RequestBody List plates, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigService.updateInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除用户应用信息 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "删除用户应用功能",businessType = BusinessType.DELETE) + @PostMapping("deletePlate") + @JwtSysUser + @ApiOperation(value = "删除用户应用信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deletePlate(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysUserAppHomeconfigService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysUserAppHomeconfigPage deptPage) { + IPage deptIPage = sysUserAppHomeconfigService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + + @GetMapping("queryUserConfig") + @ApiOperation(value = "查询用户配置", httpMethod = "GET", response = SysDept.class) + public ResponseResult> queryUserConfig(SysUserAppHomeconfigQuery cofigQuery) { + List vos = sysUserAppHomeconfigService.queryUserConfig(cofigQuery); + return ResponseResult.success(vos); + } + + + /** + * 添加用户默认配置 + * @param config + * @return 添加结果 + */ + @PostMapping("addDefaultConfig") + @JwtSysUser + @ApiOperation(value = "添加用户默认配置", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加用户默认配置",businessType = BusinessType.INSERT) + public ResponseResult addDefaultConfig(@RequestBody @Valid SysUserHomeconfigVo config, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigService.saveDefaultConfig(config, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.java new file mode 100644 index 0000000..36fd0f0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.java @@ -0,0 +1,130 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUserAppHomeconfig; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlate; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlatePage; +import com.mosty.common.core.business.mapper.SysUserAppHomeconfigPlateMapper; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * 用户app首页配置-板块表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app用户首页板块接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysuserAppHomeconfigPlate") +public class SysUserAppHomeconfigPlateController { + + private SysUserAppHomeconfigPlateService sysUserAppHomeconfigPlateService; + + /** + * 添加用户首页应用板块 + * @param config + * @return 添加结果 + */ + @PostMapping("add") + @JwtSysUser + @ApiOperation(value = "添加用户首页应用板块", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult add(@RequestBody @Valid SysUserAppHomeconfigPlate config, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateService.saveInfo(config, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 添加用户首页应用 + * @param plates 部门 + * @return 添加结果 + */ + @PostMapping("addBatch") + @JwtSysUser + @ApiOperation(value = "批量添加用户首页应用板块", httpMethod = "POST", response = Boolean.class) + @Log(title = "批量添加首页应用板块",businessType = BusinessType.INSERT) + public ResponseResult addBatch(@RequestBody List plates, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateService.saveInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改用户首页应用 + * @param plate 修改用户首页应用信息 + * @return 修改结果 + */ + @PostMapping("update") + @JwtSysUser + @Log(title = "首页应用板块",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改用户首页应用板块", httpMethod = "POST", response = Boolean.class) + public ResponseResult update(@RequestBody @Valid SysUserAppHomeconfigPlate plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateService.updateInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 批量修改用户首页应用板块 + * @param plates 首页板块信息 + * @return 修改结果 + */ + @PostMapping("updateBatch") + @JwtSysUser + @Log(title = "批量修改用户首页应用板块",businessType = BusinessType.UPDATE) + @ApiOperation(value = "批量修改用户首页应用板块", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateBatch(@RequestBody List plates, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateService.updateInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除应用板块信息 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "删除用户应用板块功能",businessType = BusinessType.DELETE) + @PostMapping("deletePlate") + @JwtSysUser + @ApiOperation(value = "删除用户应用板块信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deletePlate(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysUserAppHomeconfigPlateService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用板块信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysUserAppHomeconfigPlatePage deptPage) { + IPage deptIPage = sysUserAppHomeconfigPlateService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.java new file mode 100644 index 0000000..4d59f17 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.java @@ -0,0 +1,127 @@ +package com.mosty.common.core.business.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlateListPage; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateListService; +import com.mosty.common.token.JwtSysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + *

+ * 用户app首页配置-板块内容表 前端控制器 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Api(tags = "app用户首页板块内容接口") +@RestController +@AllArgsConstructor +@RequestMapping("/sysUserAppHomeconfigPlateList") +public class SysUserAppHomeconfigPlateListController { + + private SysUserAppHomeconfigPlateListService sysUserAppHomeconfigPlateListService; + + /** + * 添加用户首页应用板块内容 + * @param config + * @return 添加结果 + */ + @PostMapping("add") + @JwtSysUser + @ApiOperation(value = "添加用户首页应用板块内容", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加首页应用板块内容",businessType = BusinessType.INSERT) + public ResponseResult add(@RequestBody @Valid SysUserAppHomeconfigPlateList config, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateListService.saveInfo(config, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 添加用户首页应用内容 + * @param plates + * @return 添加结果 + */ + @PostMapping("addBatch") + @JwtSysUser + @ApiOperation(value = "批量添加用户首页应用板块内容", httpMethod = "POST", response = Boolean.class) + @Log(title = "批量添加首页应用板块内容",businessType = BusinessType.INSERT) + public ResponseResult addBatch(@RequestBody List plates, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateListService.saveInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改用户首页应用 + * @param plate 修改用户首页应用信息 + * @return 修改结果 + */ + @PostMapping("update") + @JwtSysUser + @Log(title = "首页应用板块内容",businessType = BusinessType.UPDATE) + @ApiOperation(value = "修改用户首页应用板块内容", httpMethod = "POST", response = Boolean.class) + public ResponseResult update(@RequestBody @Valid SysUserAppHomeconfigPlateList plate, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateListService.updateInfo(plate, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 批量修改用户首页应用板块 + * @param plates 首页板块信息 + * @return 修改结果 + */ + @PostMapping("updateBatch") + @JwtSysUser + @Log(title = "批量修改用户首页应用板块内容",businessType = BusinessType.UPDATE) + @ApiOperation(value = "批量修改用户首页应用板块内容", httpMethod = "POST", response = Boolean.class) + public ResponseResult updateBatch(@RequestBody List plates, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserAppHomeconfigPlateListService.updateInfoBatch(plates, ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除应用板块信息 + * @param list 应用id + * @return 删除结果 + */ + @Log(title = "删除用户应用板块内容功能",businessType = BusinessType.DELETE) + @PostMapping("deletePlate") + @JwtSysUser + @ApiOperation(value = "删除用户应用板块内容信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult deletePlate(@RequestBody List list, + HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); +// UserInfo userInfo = UserInfoManager.get(); + sysUserAppHomeconfigPlateListService.delete(list, ipAddress, null); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("selectPage") + @ApiOperation(value = "分页查询应用板块内容信息", httpMethod = "GET", response = SysDept.class) + public ResponseResult> selectPage(SysUserAppHomeconfigPlateListPage deptPage) { + IPage deptIPage = sysUserAppHomeconfigPlateListService.selectByPage(deptPage); + return ResponseResult.success(deptIPage); + } + +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserController.java new file mode 100644 index 0000000..e671078 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/SysUserController.java @@ -0,0 +1,313 @@ +package com.mosty.common.core.business.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.constant.enums.ConfigKeyEnum; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.constant.enums.PasswordLevelEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.config.entity.SysConfig; +import com.mosty.common.config.entity.vo.DeleteVO; +import com.mosty.common.config.service.SysConfigService; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.request.SysUserEditPasswordRequest; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.mapper.SysUserDeptMapper; +import com.mosty.common.core.business.mapper.SysUserRoleMapper; +import com.mosty.common.core.business.mapper.YbmjMapper; +import com.mosty.common.core.business.service.*; +import com.mosty.common.redis.service.RedisService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; +import java.util.Objects; + + +/** + * 用户控制类 + * + * @author kevin + * @date 2022/2/12 10:17 PM + * @since 1.0.0 + */ +@SuppressWarnings("unused") +@RestController +@AllArgsConstructor +@RequestMapping("/sysUser") +@Api(tags = "用户接口") +public class SysUserController { + + private final SysUserService sysUserService; + private final SysDeptService sysDeptService; + private final SysPositionService sysPositionService; + private final SysConfigService sysConfigService; + private final SysUserDeptService sysUserDeptService; + private final SysUserRoleService sysUserRoleService; + private final RedisService redisService; + private final SysUserRoleMapper sysUserRoleMapper; + private final SysUserDeptMapper sysUserDeptMapper; + private final YbmjMapper ybmjMapper; + + @JwtSysUser + @PostMapping("addUser") + @Log(title = "添加用户信息", businessType = BusinessType.INSERT) + @ApiOperation(value = "添加用户信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult addSysUser(@RequestBody @Valid AddSysUserVO sysUserVo, + HttpServletRequest servletRequest) { + +/* QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("login_name", sysUserVo.getLoginName()); + SysUser sysUser = sysUserService.getBaseMapper().selectOne(queryWrapper); + if (sysUser != null) + return ResponseResult.fail("登录账号重复!!");*/ + + if (sysUserService.getBaseMapper().selectCount(new LambdaQueryWrapper().eq(SysUser::getIdEntityCard, sysUserVo.getIdEntityCard())) > 0) + return ResponseResult.fail("身份证重复!!"); + + if (sysUserService.getBaseMapper().selectCount(new LambdaQueryWrapper().eq(SysUser::getInDustRialId, sysUserVo.getInDustRialId())) > 0) + return ResponseResult.fail("警号重复!!"); + + + // 验证岗位信息并且设置岗位名称 + SysPosition sysPosition = sysPositionService.getById(sysUserVo.getPositionId()); +// if (sysPosition == null || sysPosition.getXtZxbz() != 0) +// return ResponseResult.fail("岗位 %s 不存在!"); + sysUserVo.setPositionName(sysPosition != null ? sysPosition.getPostName() : ""); + + UserInfo userInfo = UserInfoManager.get(); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserVo.setXtLrip(ipAddress); + sysUserVo.setXtZhxgrip(ipAddress); + + // 保存用户信息 + sysUserService.saveInfo(sysUserVo); + + return ResponseResult.success(Boolean.TRUE); + } + + + @JwtSysUser + @PostMapping("addUserTbYb") + @Log(title = "同步宜宾人员", businessType = BusinessType.INSERT) + @ApiOperation(value = "同步宜宾人员", httpMethod = "POST", response = Boolean.class) + public ResponseResult addUserTbYb() { + + List ybmjs = ybmjMapper.selectList(new QueryWrapper<>()); + if (!CollectionUtils.isEmpty(ybmjs)) { + for (Ybmj ybmj : ybmjs) { + SysUser sysUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper().eq("id_entity_card", ybmj.getSfzh())); + if (sysUser == null) { + AddSysUserVO sysUserVo = new AddSysUserVO(); + sysUserVo.setSsbmdm(ybmj.getSsbmdm()); + sysUserVo.setLoginName(ybmj.getXm()); + sysUserVo.setPassword("E10ADC3949BA59ABBEcm9OiHRC56E057F20F883E"); + sysUserVo.setUserName(ybmj.getXm()); + sysUserVo.setUserType("00"); + sysUserVo.setMobile(ybmj.getDh()); + sysUserVo.setTelePhone(ybmj.getDh()); + sysUserVo.setIdEntityCard(ybmj.getSfzh()); + sysUserVo.setInDustRialId(ybmj.getJh()); + //计算男女 + int gender = Integer.parseInt(ybmj.getSfzh().substring(16, 17)); + if (gender % 2 == 1) { + sysUserVo.setSex("0"); + } else { + sysUserVo.setSex("1"); + } + sysUserVo.setNation("01"); + sysUserVo.setType("01"); + sysUserVo.setIsVirtualUser("2"); + sysUserVo.setSfrh("0"); + UserInfo userInfo = UserInfoManager.get(); + // 获取ip地址 +// String ipAddress = IpUtil.getIpAddress(servletRequest); +// sysUserVo.setXtLrip(ipAddress); +// sysUserVo.setXtZhxgrip(ipAddress); + // 保存用户信息 + sysUserService.saveInfo(sysUserVo); + ybmjMapper.deleteById(ybmj); + } else { + if (DeletedEnum.DELETED.code.equals(sysUser.getXtZxbz())) + return ResponseResult.fail("用户不存在!"); + SysUserEditVO sysUserEditVo = new SysUserEditVO(); + sysUserEditVo.setSsbmdm(ybmj.getSsbmdm()); + sysUserEditVo.setLoginName(ybmj.getXm()); +// sysUserEditVo.setPassword("E10ADC3949BA59ABBEcm9OiHRC56E057F20F883E"); + sysUserEditVo.setUserName(ybmj.getXm()); + sysUserEditVo.setUserType("01"); + sysUserEditVo.setMobile(ybmj.getDh()); + sysUserEditVo.setTelePhone(ybmj.getDh()); + sysUserEditVo.setIdEntityCard(ybmj.getSfzh()); + sysUserEditVo.setInDustRialId(ybmj.getJh()); + //计算男女 + int gender = Integer.parseInt(ybmj.getSfzh().substring(16, 17)); + if (gender % 2 == 1) { + sysUserEditVo.setSex("1"); + } else { + sysUserEditVo.setSex("2"); + } + sysUserEditVo.setNation("01"); + sysUserEditVo.setType("01"); + sysUserEditVo.setIsVirtualUser("2"); + sysUserEditVo.setSfrh("0"); + sysUserEditVo.setId(sysUser.getId()); + UserInfo userInfo = UserInfoManager.get(); + sysUserService.editInfo(sysUserEditVo, sysUser); + ybmjMapper.deleteById(ybmj); + } + } + return ResponseResult.success(Boolean.TRUE); + } + return null; + } + + + @JwtSysUser + @PostMapping("editSysUser") + @Log(title = "用户功能--编辑用户信息", businessType = BusinessType.UPDATE) + @ApiOperation(value = "编辑用户信息", httpMethod = "POST", response = Boolean.class) + public ResponseResult editSysUser(@RequestBody @Valid SysUserEditVO sysUserEditVo) { + + Long id = sysUserEditVo.getId(); + SysUser sysUser = sysUserService.getUserInfo(id); + if (sysUser == null || DeletedEnum.DELETED.code.equals(sysUser.getXtZxbz())) + return ResponseResult.fail("用户不存在!"); + sysUserService.editInfo(sysUserEditVo, sysUser); + return ResponseResult.success(Boolean.TRUE); + } + + @JwtSysUser + @PostMapping("editPassword") + @Log(title = "用户功能--编辑密码", businessType = BusinessType.UPDATE) + @ApiOperation(value = "编辑密码", httpMethod = "POST", response = Boolean.class) + public ResponseResult editPassword(@RequestBody @Valid SysUserEditPasswordRequest sysUserEditPasswordRequest) { + sysUserService.editPassword(sysUserEditPasswordRequest); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("resetPassword") + @Log(title = "用户功能--重置密码", businessType = BusinessType.UPDATE) + @ApiOperation(value = "重置密码", httpMethod = "POST", response = Boolean.class) + public ResponseResult resetPassword(@RequestParam("userId") Long userId) { + SysUser user = sysUserService.getUserInfo(userId); + + Asserts.check(user == null || DeletedEnum.DELETED.code.equals(user.getXtZxbz()), + "用户不存在或已删除"); + + sysUserService.resetPassword(user); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("getUserInfo/{id}") + @JwtSysUser + @ApiOperation(value = "查询用户信息", httpMethod = "GET", response = SysUserInfoVO.class) + public ResponseResult getUserInfo(@PathVariable("id") Long id) { + UserInfo user1 = UserInfoManager.get(); + SysUser user = sysUserService.getUserInfo(id); + Asserts.check(user == null || DeletedEnum.DELETED.code.equals(user.getXtZxbz()), + "用户不存在或已删除"); + List deptIds = sysUserDeptService.listByUserId(user.getId()); + SysUserInfoVO sysUserInfoVO = BeanUtil.copyProperties(user, SysUserInfoVO.class); + if (!CollectionUtils.isEmpty(deptIds)) { + sysUserInfoVO.setDeptIds(deptIds); + SysDept dept = sysDeptService.getById(deptIds.get(0)); + if (dept != null) { + sysUserInfoVO.setSsbm(dept.getOrgName()); + sysUserInfoVO.setSsbmdm(dept.getOrgCode()); + } + } + return ResponseResult.success(sysUserInfoVO); + } + + @GetMapping("selectUnAccreditPage") + @ApiOperation(value = "分页查询未绑定当前角色的用户", httpMethod = "GET", response = SysRole.class) + public ResponseResult> selectUnAccreditPage(UserPage userPage) { + IPage roleIPage = sysUserService.selectUnAccreditPage(userPage); + return ResponseResult.success(roleIPage); + } + + @GetMapping("selectPage") + @JwtSysUser + @ApiOperation(value = "分页查询用户信息", httpMethod = "GET", response = SysUserVO.class) + public ResponseResult> selectPage(UserPage userPage) { + IPage userVoPage = sysUserService.selectByPage(userPage); + return ResponseResult.success(userVoPage); + } + + @GetMapping("getUserList") + @JwtSysUser + @ApiOperation(value = "根据条件查询用户信息", httpMethod = "GET", response = SysUserVO.class) + public ResponseResult> getUserList(GetUserPage dto) { + return ResponseResult.success(sysUserService.getUserList(dto)); + } + + + @PostMapping("selectUserDeptPage") + @JwtSysUser + @ApiOperation(value = "查询用户和部门分页", httpMethod = "POST", response = SysRole.class) + public ResponseResult> selectUserDeptPage(@RequestBody UserDeptPage userDeptPage) { + IPage sysUserDeptVOIPage = sysUserService.selectUserDeptPage(userDeptPage); + return ResponseResult.success(sysUserDeptVOIPage); + } + + @JwtSysUser + @GetMapping("getPasswordLevel") + @ApiOperation(value = "当前系统的密码等级", httpMethod = "GET", response = Integer.class) + public ResponseResult getPasswordLevel() { + UserInfo userInfo = UserInfoManager.get(); + SysConfig config = sysConfigService.getOneByKey(ConfigKeyEnum.PASSWORD_LEVEL); + if (Objects.isNull(config)) { + return ResponseResult.success(PasswordLevelEnum.PASSWORD_LEVEL_ONE.code); + } + return ResponseResult.success(Integer.valueOf(config.getPzz())); + } + + @JwtSysUser + @PostMapping("deleteSysUser") + @Log(title = "删除用户", businessType = BusinessType.DELETE) + @ApiOperation(value = "删除用户", httpMethod = "POST", response = Boolean.class) + public ResponseResult deleteSysRole(@RequestBody DeleteVO deleteVO, HttpServletRequest servletRequest) { + SysUser oldSysUser = sysUserService.getBaseMapper().selectById(deleteVO.getId()); + if (oldSysUser == null) + return ResponseResult.fail("用户不存在或已删除"); + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysUserService.delById(oldSysUser.getId()); + // 删除关联角色 + this.sysUserRoleMapper.delete( + new LambdaQueryWrapper() + .eq(SysUserRole::getUserId, oldSysUser.getId()) + ); + // 删除关联部门 + this.sysUserDeptMapper.delete( + new LambdaQueryWrapper() + .eq(SysUserDept::getUserId, oldSysUser.getId()) + ); + return ResponseResult.success(Boolean.TRUE); + } + + @GetMapping("userSys") + @ApiOperation(value = "用户信息同步", httpMethod = "GET", response = Boolean.class) + public ResponseResult userSys() { + Boolean bool = sysUserService.userSys(); + return ResponseResult.success(bool); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/controller/TokenController.java b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/TokenController.java new file mode 100644 index 0000000..e2b8169 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/controller/TokenController.java @@ -0,0 +1,106 @@ +package com.mosty.common.core.business.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Maps; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.core.business.entity.vo.LoginResponseVO; +import com.mosty.common.core.util.HttpClientUtil; +import com.mosty.common.core.util.RSAUtil; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.Header; +import org.apache.http.HttpResponse; +import org.apache.http.util.EntityUtils; +import org.springframework.web.bind.annotation.*; + +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Objects; + +import static com.google.common.base.Charsets.UTF_8; + +/** + *

+ * 应用信息表 前端控制器 + *

+ * + * @author kevin + * @since 2022-04-21 + */ +@RestController +@AllArgsConstructor +@RequestMapping("yjxx/token") +@Api(tags = "获取托尔思预警token") +@Slf4j +public class TokenController { + + /** + * 获取预警token + * + * @param idCard 添加应用信息请求 + * @return 添加结果 + */ + @GetMapping("getToken") + public ResponseResult getToken(@RequestParam("idCard") String idCard) throws Exception { + String rsa = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKtrYCRHk/++b/yZteGW5pSfKynGjfNZ9TkC/+v8SrAZ8Gb24lEbB0zUp/rXabNHfSY6X3z6tCCA7pCig0TQIQT5iIz1eBuMPWcY61U1sySqVANu4IxchLzaPmKamttz2GXKby94rVa71eTVZ2kC0Vi424PjfL7C/iBQsgvoPV8wIDAQAB"; + String url = "https://80.35.1.27:7001/login/app?key="; + log.info("公钥:{}", rsa); + log.info("身份证号:{}", idCard); + String rsaStr = RSAUtil.encryptByPubKey(idCard, rsa); + String idCardRas = URLEncoder.encode(rsaStr, "UTF-8"); + String urls = url + idCardRas; + + HashMap loginMap = Maps.newHashMap(); + loginMap.put("Content-Type", "multipart/form-data"); + loginMap.put("Authorization", "Basic eXE6YWRtaW4="); + loginMap.put("User-Agent", "trs"); + + HttpResponse response = HttpClientUtil.postRequest(urls, loginMap); + String body = EntityUtils.toString(response.getEntity(), UTF_8); + + JSONObject jsonObject = JSONObject.parseObject(body); + String accessToken = jsonObject.getString("access_token"); + log.info("获取到的access_token={}", accessToken); + + if (response.getStatusLine().getStatusCode() != 200) { + log.warn("调用登陆服务异常{}", JSON.toJSONString(response)); + throw new RuntimeException("POST调用异常 : " + response.getStatusLine().getStatusCode()); + } + + + HashMap cookieMap = Maps.newHashMap(); + cookieMap.put("Authorization", "Bearer " + accessToken); + + String getCookieUrl = "http://80.35.1.27:7000/dispatchWarning/yjxx/getYjxxList?page=2&pageSize=10&type=9&lev=0&datasource=&datetype=nolimit&startdate=&enddate=&bklx=0&emphasiscode=&searchType=1&otherinfo=&yjlx=0"; + HttpResponse cookieResponse = HttpClientUtil.postRequest(getCookieUrl, cookieMap); + Header firstHeader = cookieResponse.getFirstHeader("Set-Cookie"); + + log.warn("调用cookie接口的 Http status = {}", response.getStatusLine().getStatusCode()); + + if (Objects.isNull(firstHeader)) { + log.warn("响应体cookie为空 ------{}", JSON.toJSONString(response.getAllHeaders())); + throw new RuntimeException("POST调用异常 : " + response.getStatusLine().getStatusCode()); + } + log.info("获取到的cookie={}", firstHeader.getValue()); + + LoginResponseVO loginResponseVO = new LoginResponseVO(); + loginResponseVO.setLoginResponseBody(body); + loginResponseVO.setLoginResponseCookie(firstHeader.getValue()); + + log.info("响应体 ------{}", JSON.toJSONString(loginResponseVO)); + return ResponseResult.success(loginResponseVO); + + } + + public static void main(String[] args) { + try { + LoginResponseVO vo = new TokenController().getToken("510603198807207837").getData(); + System.err.println(vo); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfig.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfig.java new file mode 100644 index 0000000..1af074a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfig.java @@ -0,0 +1,88 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_app_homeconfig") +@ApiModel(value="SysAppHomeconfig对象", description="app首页表") +public class SysAppHomeconfig implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页名称,如:领导端") + private String homename; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.java new file mode 100644 index 0000000..1b4c93f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.java @@ -0,0 +1,103 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_app_homeconfig_plate") +@ApiModel(value="SysAppHomeconfigPlate对象", description="app首页-板块表") +public class SysAppHomeconfigPlate implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页ID") + private Long homeid; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + + @ApiModelProperty(value = "板块样式") + private String dyys; + + @ApiModelProperty(value = "板块顺序") + private Integer bksx; + + @ApiModelProperty(value = "跳转地址") + private String tzdz; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.java new file mode 100644 index 0000000..2046df4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.java @@ -0,0 +1,100 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页配置-板块内容表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_app_homeconfig_plate_list") +@ApiModel(value="SysAppHomeconfigPlateList对象", description="app首页配置-板块内容表") +public class SysAppHomeconfigPlateList implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "板块ID") + private Long plateId; + + @ApiModelProperty(value = "内容名称") + private String nrmc; + + @ApiModelProperty(value = "内容样式") + private String nrys; + + @ApiModelProperty(value = "路由跳转地址") + private String tzdz; + + @ApiModelProperty(value = "内容顺序") + private Integer nrsx; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysDept.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysDept.java new file mode 100644 index 0000000..029427e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysDept.java @@ -0,0 +1,382 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mosty.common.core.business.entity.vo.SysDeptVO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 部门表 + * @TableName sys_dept + */ +@TableName(value ="sys_dept") +@Data +public class SysDept implements Serializable { + /** + * 部门id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 部门代码 + */ + @TableField(value = "org_code") + private String orgCode; + + /** + * 部门名称 + */ + @TableField(value = "org_name") + private String orgName; + + /** + * 根节点开始的id路径 + */ + @TableField(value = "root_path") + private String rootPath; + + /** + * 部门类型 + */ + @TableField(value = "org_type") + private String orgType; + + /** + * 部门等级 + */ + @TableField(value = "org_level") + private String orgLevel; + + /** + * 部门业务类型 + */ + @TableField(value = "org_biz_type") + private String orgBizType; + + /** + * 部门顺序号 + */ + @TableField(value = "org_no") + private String orgNo; + + /** + * 上级部门主键 + */ + @TableField(value = "parent_id") + private Long parentId; + + /** + * 部门名称拼音首字母 + */ + @TableField(value = "bmpyszm") + private String bmpyszm; + + /** + * 部门简称 + */ + @TableField(value = "org_jc") + private String orgJc; + + /** + * 部门全称 + */ + @TableField(value = "org_qc") + private String orgQc; + + /** + * 部门地址 + */ + @TableField(value = "address") + private String address; + + /** + * 部门电话 + */ + @TableField(value = "link_tel") + private String linkTel; + + /** + * 部门联系人 + */ + @TableField(value = "link_man") + private String linkMan; + + /** + * 部门联系人电话 + */ + @TableField(value = "link_man_tel") + private String linkManTel; + + /** + * 部门主页 + */ + @TableField(value = "web_url") + private String webUrl; + + /** + * 部门邮箱 + */ + @TableField(value = "email") + private String email; + + /** + * 部门所属行政区划 + */ + @TableField(value = "xzqh") + private String xzqh; + + /** + * 备注 + */ + @TableField(value = "bz") + private String bz; + + /** + * 注销标志0正常 1.注销 + */ + @TableField(value = "xt_zxbz") + private Integer xtZxbz; + + /** + * 注销原因 + */ + @TableField(value = "xt_zxyy") + private String xtZxyy; + + /** + * 采集时间 + */ + @TableField(value = "xt_cjsj") + private Date xtCjsj; + + /** + * 录入时间 + */ + @TableField(value = "xt_lrsj") + private Date xtLrsj; + + /** + * 录入人姓名 + */ + @TableField(value = "xt_lrrxm") + private String xtLrrxm; + + /** + * 录入人id + */ + @TableField(value = "xt_lrrid") + private Long xtLrrid; + + /** + * 录入人部门 + */ + @TableField(value = "xt_lrrbm") + private String xtLrrbm; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrrbmid") + private String xtLrrbmid; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrip") + private String xtLrip; + + /** + * 最后修改时间 + */ + @TableField(value = "xt_zhxgsj") + private Date xtZhxgsj; + + /** + * 最后修改人姓名 + */ + @TableField(value = "xt_zhxgrxm") + private String xtZhxgrxm; + + /** + * 最后修改人id + */ + @TableField(value = "xt_zhxgid") + private Long xtZhxgid; + + /** + * 最后修改人部门 + */ + @TableField(value = "xt_zhxgrbm") + private String xtZhxgrbm; + + /** + * 最后修改人部门id + */ + @TableField(value = "xt_zhxgrbmid") + private Long xtZhxgrbmid; + + /** + * 最后修改人ip + */ + @TableField(value = "xt_zhxgrip") + private String xtZhxgrip; + + /** + * 子部门集合 + */ + @ApiModelProperty(value = "子部门集合") + @TableField(exist = false) + private List childDeptList; + + /** + * 是否包含下级 + */ + @ApiModelProperty(value = "是否包含下级") + @TableField(exist = false) + private boolean hasChildren; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysDept other = (SysDept) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getOrgCode() == null ? other.getOrgCode() == null : this.getOrgCode().equals(other.getOrgCode())) + && (this.getOrgName() == null ? other.getOrgName() == null : this.getOrgName().equals(other.getOrgName())) + && (this.getOrgType() == null ? other.getOrgType() == null : this.getOrgType().equals(other.getOrgType())) + && (this.getOrgLevel() == null ? other.getOrgLevel() == null : this.getOrgLevel().equals(other.getOrgLevel())) + && (this.getOrgBizType() == null ? other.getOrgBizType() == null : this.getOrgBizType().equals(other.getOrgBizType())) + && (this.getOrgNo() == null ? other.getOrgNo() == null : this.getOrgNo().equals(other.getOrgNo())) + && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId())) + && (this.getBmpyszm() == null ? other.getBmpyszm() == null : this.getBmpyszm().equals(other.getBmpyszm())) + && (this.getOrgJc() == null ? other.getOrgJc() == null : this.getOrgJc().equals(other.getOrgJc())) + && (this.getOrgQc() == null ? other.getOrgQc() == null : this.getOrgQc().equals(other.getOrgQc())) + && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress())) + && (this.getLinkTel() == null ? other.getLinkTel() == null : this.getLinkTel().equals(other.getLinkTel())) + && (this.getLinkMan() == null ? other.getLinkMan() == null : this.getLinkMan().equals(other.getLinkMan())) + && (this.getLinkManTel() == null ? other.getLinkManTel() == null : this.getLinkManTel().equals(other.getLinkManTel())) + && (this.getWebUrl() == null ? other.getWebUrl() == null : this.getWebUrl().equals(other.getWebUrl())) + && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail())) + && (this.getXzqh() == null ? other.getXzqh() == null : this.getXzqh().equals(other.getXzqh())) + && (this.getBz() == null ? other.getBz() == null : this.getBz().equals(other.getBz())) + && (this.getXtZxbz() == null ? other.getXtZxbz() == null : this.getXtZxbz().equals(other.getXtZxbz())) + && (this.getXtZxyy() == null ? other.getXtZxyy() == null : this.getXtZxyy().equals(other.getXtZxyy())) + && (this.getXtCjsj() == null ? other.getXtCjsj() == null : this.getXtCjsj().equals(other.getXtCjsj())) + && (this.getXtLrsj() == null ? other.getXtLrsj() == null : this.getXtLrsj().equals(other.getXtLrsj())) + && (this.getXtLrrxm() == null ? other.getXtLrrxm() == null : this.getXtLrrxm().equals(other.getXtLrrxm())) + && (this.getXtLrrid() == null ? other.getXtLrrid() == null : this.getXtLrrid().equals(other.getXtLrrid())) + && (this.getXtLrrbm() == null ? other.getXtLrrbm() == null : this.getXtLrrbm().equals(other.getXtLrrbm())) + && (this.getXtLrrbmid() == null ? other.getXtLrrbmid() == null : this.getXtLrrbmid().equals(other.getXtLrrbmid())) + && (this.getXtLrip() == null ? other.getXtLrip() == null : this.getXtLrip().equals(other.getXtLrip())) + && (this.getXtZhxgsj() == null ? other.getXtZhxgsj() == null : this.getXtZhxgsj().equals(other.getXtZhxgsj())) + && (this.getXtZhxgrxm() == null ? other.getXtZhxgrxm() == null : this.getXtZhxgrxm().equals(other.getXtZhxgrxm())) + && (this.getXtZhxgid() == null ? other.getXtZhxgid() == null : this.getXtZhxgid().equals(other.getXtZhxgid())) + && (this.getXtZhxgrbm() == null ? other.getXtZhxgrbm() == null : this.getXtZhxgrbm().equals(other.getXtZhxgrbm())) + && (this.getXtZhxgrbmid() == null ? other.getXtZhxgrbmid() == null : this.getXtZhxgrbmid().equals(other.getXtZhxgrbmid())) + && (this.getXtZhxgrip() == null ? other.getXtZhxgrip() == null : this.getXtZhxgrip().equals(other.getXtZhxgrip())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getOrgCode() == null) ? 0 : getOrgCode().hashCode()); + result = prime * result + ((getOrgName() == null) ? 0 : getOrgName().hashCode()); + result = prime * result + ((getOrgType() == null) ? 0 : getOrgType().hashCode()); + result = prime * result + ((getOrgLevel() == null) ? 0 : getOrgLevel().hashCode()); + result = prime * result + ((getOrgBizType() == null) ? 0 : getOrgBizType().hashCode()); + result = prime * result + ((getOrgNo() == null) ? 0 : getOrgNo().hashCode()); + result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode()); + result = prime * result + ((getBmpyszm() == null) ? 0 : getBmpyszm().hashCode()); + result = prime * result + ((getOrgJc() == null) ? 0 : getOrgJc().hashCode()); + result = prime * result + ((getOrgQc() == null) ? 0 : getOrgQc().hashCode()); + result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode()); + result = prime * result + ((getLinkTel() == null) ? 0 : getLinkTel().hashCode()); + result = prime * result + ((getLinkMan() == null) ? 0 : getLinkMan().hashCode()); + result = prime * result + ((getLinkManTel() == null) ? 0 : getLinkManTel().hashCode()); + result = prime * result + ((getWebUrl() == null) ? 0 : getWebUrl().hashCode()); + result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode()); + result = prime * result + ((getXzqh() == null) ? 0 : getXzqh().hashCode()); + result = prime * result + ((getBz() == null) ? 0 : getBz().hashCode()); + result = prime * result + ((getXtZxbz() == null) ? 0 : getXtZxbz().hashCode()); + result = prime * result + ((getXtZxyy() == null) ? 0 : getXtZxyy().hashCode()); + result = prime * result + ((getXtCjsj() == null) ? 0 : getXtCjsj().hashCode()); + result = prime * result + ((getXtLrsj() == null) ? 0 : getXtLrsj().hashCode()); + result = prime * result + ((getXtLrrxm() == null) ? 0 : getXtLrrxm().hashCode()); + result = prime * result + ((getXtLrrid() == null) ? 0 : getXtLrrid().hashCode()); + result = prime * result + ((getXtLrrbm() == null) ? 0 : getXtLrrbm().hashCode()); + result = prime * result + ((getXtLrrbmid() == null) ? 0 : getXtLrrbmid().hashCode()); + result = prime * result + ((getXtLrip() == null) ? 0 : getXtLrip().hashCode()); + result = prime * result + ((getXtZhxgsj() == null) ? 0 : getXtZhxgsj().hashCode()); + result = prime * result + ((getXtZhxgrxm() == null) ? 0 : getXtZhxgrxm().hashCode()); + result = prime * result + ((getXtZhxgid() == null) ? 0 : getXtZhxgid().hashCode()); + result = prime * result + ((getXtZhxgrbm() == null) ? 0 : getXtZhxgrbm().hashCode()); + result = prime * result + ((getXtZhxgrbmid() == null) ? 0 : getXtZhxgrbmid().hashCode()); + result = prime * result + ((getXtZhxgrip() == null) ? 0 : getXtZhxgrip().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", orgCode=").append(orgCode); + sb.append(", orgName=").append(orgName); + sb.append(", orgType=").append(orgType); + sb.append(", orgLevel=").append(orgLevel); + sb.append(", orgBizType=").append(orgBizType); + sb.append(", orgNo=").append(orgNo); + sb.append(", parentId=").append(parentId); + sb.append(", bmpyszm=").append(bmpyszm); + sb.append(", orgJc=").append(orgJc); + sb.append(", orgQc=").append(orgQc); + sb.append(", address=").append(address); + sb.append(", linkTel=").append(linkTel); + sb.append(", linkMan=").append(linkMan); + sb.append(", linkManTel=").append(linkManTel); + sb.append(", webUrl=").append(webUrl); + sb.append(", email=").append(email); + sb.append(", xzqh=").append(xzqh); + sb.append(", bz=").append(bz); + sb.append(", xtZxbz=").append(xtZxbz); + sb.append(", xtZxyy=").append(xtZxyy); + sb.append(", xtCjsj=").append(xtCjsj); + sb.append(", xtLrsj=").append(xtLrsj); + sb.append(", xtLrrxm=").append(xtLrrxm); + sb.append(", xtLrrid=").append(xtLrrid); + sb.append(", xtLrrbm=").append(xtLrrbm); + sb.append(", xtLrrbmid=").append(xtLrrbmid); + sb.append(", xtLrip=").append(xtLrip); + sb.append(", xtZhxgsj=").append(xtZhxgsj); + sb.append(", xtZhxgrxm=").append(xtZhxgrxm); + sb.append(", xtZhxgid=").append(xtZhxgid); + sb.append(", xtZhxgrbm=").append(xtZhxgrbm); + sb.append(", xtZhxgrbmid=").append(xtZhxgrbmid); + sb.append(", xtZhxgrip=").append(xtZhxgrip); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysLogininfor.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysLogininfor.java new file mode 100644 index 0000000..ac421d3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysLogininfor.java @@ -0,0 +1,110 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mosty.common.base.entity.log.Excel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.Data; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@TableName(value = "mosty_base.sys_logininfor") +@Data +public class SysLogininfor implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "info_id", type = IdType.AUTO) + @ApiModelProperty("访问ID") + private Long infoId; + + @TableField(value = "user_id") + @ApiModelProperty("人员ID") + private String userId; + + @TableField(value = "sfzh") + @ApiModelProperty("身份证号") + @Excel(name = "身份证号") + private String sfzh; + + @TableField(value = "user_name") + @ApiModelProperty("用户账号") + @Excel(name = "用户账号") + private String userName; + + @TableField(value = "ipaddr") + @ApiModelProperty("登录IP地址") + @Excel(name = "用户账号") + private String ipaddr; + + @TableField(value = "type") + @ApiModelProperty("登录方式 01.app登录 02.pc端登录") + private String type; + + @TableField(value = "status") + @ApiModelProperty("登录状态(0成功 1失败)") + private String status; + + @TableField(value = "msg") + @ApiModelProperty("提示信息") + @Excel(name = "登录状态") + private String msg; + + @TableField(value = "browser") + @ApiModelProperty("浏览器类型") + @Excel(name = "浏览器类型") + private String browser; + + @TableField(value = "os") + @ApiModelProperty("操作系统") + @Excel(name = "操作系统") + private String os; + + @TableField(value = "access_time") + @ApiModelProperty("访问时间") + @Excel(name = "访问时间") + private LocalDateTime accessTime; + + @ApiModelProperty(value = "所属部门id") + @TableField(value = "ssbmid") + private String ssbmid; + + @ApiModelProperty(value = "所属部门") + @TableField(value = "ssbm") + @Excel(name = "所属部门") + private String ssbm; + + @ApiModelProperty(value = "所属部门代码") + @TableField(value = "ssbmdm") + @Excel(name = "所属部门代码") + private String ssbmdm; + + @ApiModelProperty(value = "所属县公安局") + @TableField(value = "ssxgaj") + private String ssxgaj; + + @ApiModelProperty(value = "所属县公安局id") + @TableField(value = "ssxgajid") + private String ssxgajid; + + @ApiModelProperty(value = "所属县公安局代码") + @TableField(value = "ssxgajdm") + private String ssxgajdm; + + @ApiModelProperty(value = "所属市公安局id") + @TableField(value = "sssgajid") + private String sssgajid; + + @ApiModelProperty(value = "所属市公安局") + @TableField(value = "sssgaj") + private String sssgaj; + + @ApiModelProperty(value = "所属市公安局代码") + @TableField(value = "sssgajdm") + private String sssgajdm; +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysMenu.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysMenu.java new file mode 100644 index 0000000..1c53296 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysMenu.java @@ -0,0 +1,114 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * 菜单表 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_menu") +@ApiModel(value="SysMenu对象", description="菜单表") +public class SysMenu implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "父菜单id") + private Long parentId; + + @ApiModelProperty(value = "父菜单路径,使用逗号间隔") + private String parentPath; + + @ApiModelProperty(value = "菜单名称") + private String menuName; + + @ApiModelProperty(value = "菜单编码") + private String menuCode; + + @ApiModelProperty(value = "菜单地址") + private String menuUrl; + + @ApiModelProperty(value = "菜单类型:1、菜单 2、资源") + private Integer menuType; + + @ApiModelProperty(value = "排序号") + private Integer orderNo; + + @ApiModelProperty(value = "是否展示:1、展示 2、不展示") + private Integer showMode; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + @ApiModelProperty(value = "子菜单集合") + @TableField(exist = false) + private List sysMenuList; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysOss.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysOss.java new file mode 100644 index 0000000..04edc01 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysOss.java @@ -0,0 +1,114 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * OSS云存储表 + *

+ * + * @author zengbo + * @since 2022-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_oss") +@ApiModel(value="SysOss对象", description="OSS云存储表") +public class SysOss implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "云存储主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + private String md5; + + @ApiModelProperty(value = "文件名") + private String fileName; + + @ApiModelProperty(value = "原名") + private String originalName; + + @ApiModelProperty(value = "文件后缀名") + private String fileSuffix; + + @ApiModelProperty(value = "URL地址") + private String url; + + @ApiModelProperty(value = "数据来源(业务表名)") + private String sjlybm; + + @ApiModelProperty(value = "业务ID") + private String ywid; + + @ApiModelProperty(value = "添加顺序") + private Integer tjsx; + + @ApiModelProperty(value = "图片类型:0-缩略图,1-大图") + private String tplx; + + @ApiModelProperty(value = "服务商") + private String service; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private String xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysPosition.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysPosition.java new file mode 100644 index 0000000..c9c9ffa --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysPosition.java @@ -0,0 +1,94 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 岗位表 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_position") +@ApiModel(value="SysPosition对象", description="岗位表") +public class SysPosition implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "岗位编码") + private String postCode; + + @ApiModelProperty(value = "岗位名称") + private String postName; + + @ApiModelProperty(value = "岗位描述") + private String postDesc; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRole.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRole.java new file mode 100644 index 0000000..1a70106 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRole.java @@ -0,0 +1,269 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 角色表 + * @TableName sys_role + */ +@TableName(value ="mosty_base.sys_role") +@Data +public class SysRole implements Serializable { + /** + * 主键id + */ + @ApiModelProperty(value = "角色ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色名称 + */ + @ApiModelProperty(value = "角色名称") + @TableField(value = "role_name") + private String roleName; + + /** + * 角色编码 + */ + @ApiModelProperty(value = "角色编码") + @TableField(value = "role_code") + private String roleCode; + + /** + * 角色描述 + */ + @ApiModelProperty(value = "角色描述") + @TableField(value = "role_desc") + private String roleDesc; + + /** + * 排序号 + */ + @ApiModelProperty(value = "排序号") + @TableField(value = "order_no") + private Integer orderNo; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField(value = "bz") + private String bz; + + /** + * 采集时间 + */ + @ApiModelProperty(value = "采集时间") + @TableField(value = "xt_cjsj") + private Date xtCjsj; + + /** + * 录入时间 + */ + @ApiModelProperty(value = "录入时间") + @TableField(value = "xt_lrsj") + private Date xtLrsj; + + /** + * 录入人姓名 + */ + @ApiModelProperty(value = "录入人姓名") + @TableField(value = "xt_lrrxm") + private String xtLrrxm; + + /** + * 录入人ID + */ + @ApiModelProperty(value = "录入人ID") + @TableField(value = "xt_lrrid") + private String xtLrrid; + + /** + * 录入人部门 + */ + @ApiModelProperty(value = "录入人部门") + @TableField(value = "xt_lrrbm") + private String xtLrrbm; + + /** + * 录入人部门ID + */ + @ApiModelProperty(value = "录入人部门ID") + @TableField(value = "xt_lrrbmid") + private String xtLrrbmid; + + /** + * 录入IP + */ + @ApiModelProperty(value = "录入IP") + @TableField(value = "xt_lrip") + private String xtLrip; + + /** + * 最后修改时间 + */ + @ApiModelProperty(value = "最后修改时间") + @TableField(value = "xt_zhxgsj") + private Date xtZhxgsj; + + /** + * 最后修改人姓名 + */ + @ApiModelProperty(value = "最后修改人姓名") + @TableField(value = "xt_zhxgrxm") + private String xtZhxgrxm; + + /** + * 最后修改人ID + */ + @ApiModelProperty(value = "最后修改人ID") + @TableField(value = "xt_zhxgrid") + private String xtZhxgrid; + + /** + * 最后修改人部门 + */ + @ApiModelProperty(value = "最后修改人部门") + @TableField(value = "xt_zhxgrbm") + private String xtZhxgrbm; + + /** + * 最后修改人部门ID + */ + @ApiModelProperty(value = "最后修改人部门ID") + @TableField(value = "xt_zhxgrbmid") + private String xtZhxgrbmid; + + /** + * 最后修改IP + */ + @ApiModelProperty(value = "最后修改IP") + @TableField(value = "xt_zhxgip") + private String xtZhxgip; + + /** + * 注销标志0正常 1.注销 + */ + @ApiModelProperty(value = "注销标志0正常 1.注销") + @TableField(value = "xt_zxbz") + private Integer xtZxbz; + + /** + * 注销原因 + */ + @ApiModelProperty(value = "注销原因") + @TableField(value = "xt_zxyy") + private String xtZxyy; + + + /** + * 数据权限等级 + */ + @ApiModelProperty(value = "数据权限等级") + @TableField(value = "data_permission_level") + private String dataPermissionLevel; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysRole other = (SysRole) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRoleName() == null ? other.getRoleName() == null : this.getRoleName().equals(other.getRoleName())) + && (this.getRoleDesc() == null ? other.getRoleDesc() == null : this.getRoleDesc().equals(other.getRoleDesc())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) + && (this.getBz() == null ? other.getBz() == null : this.getBz().equals(other.getBz())) + && (this.getXtCjsj() == null ? other.getXtCjsj() == null : this.getXtCjsj().equals(other.getXtCjsj())) + && (this.getXtLrsj() == null ? other.getXtLrsj() == null : this.getXtLrsj().equals(other.getXtLrsj())) + && (this.getXtLrrxm() == null ? other.getXtLrrxm() == null : this.getXtLrrxm().equals(other.getXtLrrxm())) + && (this.getXtLrrid() == null ? other.getXtLrrid() == null : this.getXtLrrid().equals(other.getXtLrrid())) + && (this.getXtLrrbm() == null ? other.getXtLrrbm() == null : this.getXtLrrbm().equals(other.getXtLrrbm())) + && (this.getXtLrrbmid() == null ? other.getXtLrrbmid() == null : this.getXtLrrbmid().equals(other.getXtLrrbmid())) + && (this.getXtLrip() == null ? other.getXtLrip() == null : this.getXtLrip().equals(other.getXtLrip())) + && (this.getXtZhxgsj() == null ? other.getXtZhxgsj() == null : this.getXtZhxgsj().equals(other.getXtZhxgsj())) + && (this.getXtZhxgrxm() == null ? other.getXtZhxgrxm() == null : this.getXtZhxgrxm().equals(other.getXtZhxgrxm())) + && (this.getXtZhxgrid() == null ? other.getXtZhxgrid() == null : this.getXtZhxgrid().equals(other.getXtZhxgrid())) + && (this.getXtZhxgrbm() == null ? other.getXtZhxgrbm() == null : this.getXtZhxgrbm().equals(other.getXtZhxgrbm())) + && (this.getXtZhxgrbmid() == null ? other.getXtZhxgrbmid() == null : this.getXtZhxgrbmid().equals(other.getXtZhxgrbmid())) + && (this.getXtZhxgip() == null ? other.getXtZhxgip() == null : this.getXtZhxgip().equals(other.getXtZhxgip())) + && (this.getXtZxbz() == null ? other.getXtZxbz() == null : this.getXtZxbz().equals(other.getXtZxbz())) + && (this.getXtZxyy() == null ? other.getXtZxyy() == null : this.getXtZxyy().equals(other.getXtZxyy())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); + result = prime * result + ((getRoleDesc() == null) ? 0 : getRoleDesc().hashCode()); + result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); + result = prime * result + ((getBz() == null) ? 0 : getBz().hashCode()); + result = prime * result + ((getXtCjsj() == null) ? 0 : getXtCjsj().hashCode()); + result = prime * result + ((getXtLrsj() == null) ? 0 : getXtLrsj().hashCode()); + result = prime * result + ((getXtLrrxm() == null) ? 0 : getXtLrrxm().hashCode()); + result = prime * result + ((getXtLrrid() == null) ? 0 : getXtLrrid().hashCode()); + result = prime * result + ((getXtLrrbm() == null) ? 0 : getXtLrrbm().hashCode()); + result = prime * result + ((getXtLrrbmid() == null) ? 0 : getXtLrrbmid().hashCode()); + result = prime * result + ((getXtLrip() == null) ? 0 : getXtLrip().hashCode()); + result = prime * result + ((getXtZhxgsj() == null) ? 0 : getXtZhxgsj().hashCode()); + result = prime * result + ((getXtZhxgrxm() == null) ? 0 : getXtZhxgrxm().hashCode()); + result = prime * result + ((getXtZhxgrid() == null) ? 0 : getXtZhxgrid().hashCode()); + result = prime * result + ((getXtZhxgrbm() == null) ? 0 : getXtZhxgrbm().hashCode()); + result = prime * result + ((getXtZhxgrbmid() == null) ? 0 : getXtZhxgrbmid().hashCode()); + result = prime * result + ((getXtZhxgip() == null) ? 0 : getXtZhxgip().hashCode()); + result = prime * result + ((getXtZxbz() == null) ? 0 : getXtZxbz().hashCode()); + result = prime * result + ((getXtZxyy() == null) ? 0 : getXtZxyy().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", roleName=").append(roleName); + sb.append(", roleDesc=").append(roleDesc); + sb.append(", orderNo=").append(orderNo); + sb.append(", bz=").append(bz); + sb.append(", xtCjsj=").append(xtCjsj); + sb.append(", xtLrsj=").append(xtLrsj); + sb.append(", xtLrrxm=").append(xtLrrxm); + sb.append(", xtLrrid=").append(xtLrrid); + sb.append(", xtLrrbm=").append(xtLrrbm); + sb.append(", xtLrrbmid=").append(xtLrrbmid); + sb.append(", xtLrip=").append(xtLrip); + sb.append(", xtZhxgsj=").append(xtZhxgsj); + sb.append(", xtZhxgrxm=").append(xtZhxgrxm); + sb.append(", xtZhxgrid=").append(xtZhxgrid); + sb.append(", xtZhxgrbm=").append(xtZhxgrbm); + sb.append(", xtZhxgrbmid=").append(xtZhxgrbmid); + sb.append(", xtZhxgip=").append(xtZhxgip); + sb.append(", xtZxbz=").append(xtZxbz); + sb.append(", xtZxyy=").append(xtZxyy); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleDept.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleDept.java new file mode 100644 index 0000000..1f683a3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleDept.java @@ -0,0 +1,79 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 角色和部门关联表 + * @TableName sys_role_dept + */ +@TableName(value ="mosty_base.sys_role_dept") +@Data +public class SysRoleDept implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色ID + */ + @TableField(value = "role_id") + private Long roleId; + + /** + * 部门ID + */ + @TableField(value = "dept_id") + private Long deptId; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysRoleDept other = (SysRoleDept) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) + && (this.getDeptId() == null ? other.getDeptId() == null : this.getDeptId().equals(other.getDeptId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); + result = prime * result + ((getDeptId() == null) ? 0 : getDeptId().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", roleId=").append(roleId); + sb.append(", deptId=").append(deptId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleMenu.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleMenu.java new file mode 100644 index 0000000..97fc74c --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysRoleMenu.java @@ -0,0 +1,79 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 角色和菜单关联表 + * @TableName sys_role_menu + */ +@TableName(value ="mosty_base.sys_role_menu") +@Data +public class SysRoleMenu implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色ID + */ + @TableField(value = "role_id") + private Long roleId; + + /** + * 菜单ID + */ + @TableField(value = "menu_id") + private Long menuId; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysRoleMenu other = (SysRoleMenu) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) + && (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); + result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", roleId=").append(roleId); + sb.append(", menuId=").append(menuId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUser.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUser.java new file mode 100644 index 0000000..b67268f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUser.java @@ -0,0 +1,332 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户信息表 + * @TableName sys_user + */ +@Data +@TableName(value ="mosty_base.sys_user") +public class SysUser implements Serializable { + + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "用户ID") + private Long id; + + @TableField(value = "manager_org_id") + @ApiModelProperty(value = "管理部门ID") + private Long managerOrgId; + + @TableField(value = "manager_org_name") + @ApiModelProperty(value = "管理部门名称") + private String managerOrgName; + + @TableField(value = "position_id") + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + @TableField(value = "position_name") + @ApiModelProperty(value = "岗位名称") + private String positionName; + + @TableField(value = "is_virtual_user") + @ApiModelProperty(value = "是否虚拟用户:1、是 2、不是") + private String isVirtualUser; + + @TableField(value = "login_name") + @ApiModelProperty(value = "登录账号") + private String loginName; + + @TableField(value = "password") + @ApiModelProperty(value = "密码") + private String password; + + @TableField(value = "user_name") + @ApiModelProperty(value = "用户昵称") + private String userName; + + @TableField(value = "user_type") + @ApiModelProperty(value = "用户类型(00系统用户 01注册用户)") + private String userType; + + @TableField(value = "email") + @ApiModelProperty(value = "用户邮箱") + private String email; + + @TableField(value = "mobile") + @ApiModelProperty(value = "移动电话") + private String mobile; + + @TableField(value = "tele_phone") + @ApiModelProperty(value = "电话号码") + private String telePhone; + + @TableField(value = "id_entity_card") + @ApiModelProperty(value = "身份证号") + private String idEntityCard; + + @TableField(value = "in_dust_rial_id") + @ApiModelProperty(value = "行业号码(如:警号)") + private String inDustRialId; + + @TableField(value = "sex") + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + @TableField(value = "nation") + @ApiModelProperty(value = "民族") + private String nation; + + @TableField(value = "politic") + @ApiModelProperty(value = "政治面貌") + private String politic; + + @TableField(value = "marital") + @ApiModelProperty(value = "婚姻状态") + private String marital; + + @TableField(value = "type") + @ApiModelProperty(value = "人员类别") + private String type; + + @TableField(value = "type_name") + @ApiModelProperty(value = "人员类别中文") + private String typeName; + + @TableField(value = "whcd") + @ApiModelProperty(value = "文化程度") + private String whcd; + + @TableField(value = "bz") + @ApiModelProperty(value = "备注") + private String bz; + + @TableField(value = "birthday") + @ApiModelProperty(value = "出生日期") + private String birthday; + + @TableField(value = "begin_time") + @ApiModelProperty(value = " 用户有效开始时间,默认为当前日期(用户可改)") + private Date beginTime; + + @TableField(value = "end_time") + @ApiModelProperty(value = " 用户有效结束时间,默认空") + private Date endTime; + + @TableField(value = "salt") + @ApiModelProperty(value = "盐加密") + private String salt; + + @TableField(value = "xzcs") + @ApiModelProperty(value = "选择次数") + private Integer xzcs; + + @TableField(value = "xt_zxbz") + private Integer xtZxbz; + + @TableField(value = "xt_zxyz") + private String xtZxyz; + + @TableField(value = "xt_cjsj") + private Date xtCjsj; + + @TableField(value = "xt_lrsj") + private Date xtLrsj; + + @TableField(value = "xt_lrrxm") + private String xtLrrxm; + + @TableField(value = "xt_lrrid") + private Long xtLrrid; + + @TableField(value = "xt_lrrbm") + private String xtLrrbm; + + @TableField(value = "xt_lrrbmid") + private String xtLrrbmid; + + @TableField(value = "xt_lrip") + private String xtLrip; + + @TableField(value = "xt_zhxgsj") + private Date xtZhxgsj; + + @TableField(value = "xt_zhxgrxm") + private String xtZhxgrxm; + + @TableField(value = "xt_zhxgid") + private Long xtZhxgid; + + @TableField(value = "xt_zhxgrbm") + private String xtZhxgrbm; + + @TableField(value = "xt_zhxgrbmid") + private Long xtZhxgrbmid; + + @TableField(value = "xt_zhxgrip") + private String xtZhxgrip; + + @TableField(value = "sfrh") + private String sfrh; + + @TableField(value = "mk") + private String mk; + + /** 用户头像 */ + @TableField(value = "avatar") + @ApiModelProperty(value = "头像") + private String avatar; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysUser other = (SysUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getManagerOrgId() == null ? other.getManagerOrgId() == null : this.getManagerOrgId().equals(other.getManagerOrgId())) + && (this.getManagerOrgName() == null ? other.getManagerOrgName() == null : this.getManagerOrgName().equals(other.getManagerOrgName())) + && (this.getPositionId() == null ? other.getPositionId() == null : this.getPositionId().equals(other.getPositionId())) + && (this.getPositionName() == null ? other.getPositionName() == null : this.getPositionName().equals(other.getPositionName())) + && (this.getLoginName() == null ? other.getLoginName() == null : this.getLoginName().equals(other.getLoginName())) + && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) + && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) + && (this.getUserType() == null ? other.getUserType() == null : this.getUserType().equals(other.getUserType())) + && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail())) + && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile())) + && (this.getTelePhone() == null ? other.getTelePhone() == null : this.getTelePhone().equals(other.getTelePhone())) + && (this.getIdEntityCard() == null ? other.getIdEntityCard() == null : this.getIdEntityCard().equals(other.getIdEntityCard())) + && (this.getInDustRialId() == null ? other.getInDustRialId() == null : this.getInDustRialId().equals(other.getInDustRialId())) + && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex())) + && (this.getNation() == null ? other.getNation() == null : this.getNation().equals(other.getNation())) + && (this.getWhcd() == null ? other.getWhcd() == null : this.getWhcd().equals(other.getWhcd())) + && (this.getBz() == null ? other.getBz() == null : this.getBz().equals(other.getBz())) + && (this.getBirthday() == null ? other.getBirthday() == null : this.getBirthday().equals(other.getBirthday())) + && (this.getBeginTime() == null ? other.getBeginTime() == null : this.getBeginTime().equals(other.getBeginTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt())) + && (this.getXtZxbz() == null ? other.getXtZxbz() == null : this.getXtZxbz().equals(other.getXtZxbz())) + && (this.getXtZxyz() == null ? other.getXtZxyz() == null : this.getXtZxyz().equals(other.getXtZxyz())) + && (this.getXtCjsj() == null ? other.getXtCjsj() == null : this.getXtCjsj().equals(other.getXtCjsj())) + && (this.getXtLrsj() == null ? other.getXtLrsj() == null : this.getXtLrsj().equals(other.getXtLrsj())) + && (this.getXtLrrxm() == null ? other.getXtLrrxm() == null : this.getXtLrrxm().equals(other.getXtLrrxm())) + && (this.getXtLrrid() == null ? other.getXtLrrid() == null : this.getXtLrrid().equals(other.getXtLrrid())) + && (this.getXtLrrbm() == null ? other.getXtLrrbm() == null : this.getXtLrrbm().equals(other.getXtLrrbm())) + && (this.getXtLrrbmid() == null ? other.getXtLrrbmid() == null : this.getXtLrrbmid().equals(other.getXtLrrbmid())) + && (this.getXtLrip() == null ? other.getXtLrip() == null : this.getXtLrip().equals(other.getXtLrip())) + && (this.getXtZhxgsj() == null ? other.getXtZhxgsj() == null : this.getXtZhxgsj().equals(other.getXtZhxgsj())) + && (this.getXtZhxgrxm() == null ? other.getXtZhxgrxm() == null : this.getXtZhxgrxm().equals(other.getXtZhxgrxm())) + && (this.getXtZhxgid() == null ? other.getXtZhxgid() == null : this.getXtZhxgid().equals(other.getXtZhxgid())) + && (this.getXtZhxgrbm() == null ? other.getXtZhxgrbm() == null : this.getXtZhxgrbm().equals(other.getXtZhxgrbm())) + && (this.getXtZhxgrbmid() == null ? other.getXtZhxgrbmid() == null : this.getXtZhxgrbmid().equals(other.getXtZhxgrbmid())) + && (this.getXtZhxgrip() == null ? other.getXtZhxgrip() == null : this.getXtZhxgrip().equals(other.getXtZhxgrip())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getManagerOrgId() == null) ? 0 : getManagerOrgId().hashCode()); + result = prime * result + ((getManagerOrgName() == null) ? 0 : getManagerOrgName().hashCode()); + result = prime * result + ((getPositionId() == null) ? 0 : getPositionId().hashCode()); + result = prime * result + ((getPositionName() == null) ? 0 : getPositionName().hashCode()); + result = prime * result + ((getLoginName() == null) ? 0 : getLoginName().hashCode()); + result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); + result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); + result = prime * result + ((getUserType() == null) ? 0 : getUserType().hashCode()); + result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode()); + result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode()); + result = prime * result + ((getTelePhone() == null) ? 0 : getTelePhone().hashCode()); + result = prime * result + ((getIdEntityCard() == null) ? 0 : getIdEntityCard().hashCode()); + result = prime * result + ((getInDustRialId() == null) ? 0 : getInDustRialId().hashCode()); + result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode()); + result = prime * result + ((getNation() == null) ? 0 : getNation().hashCode()); + result = prime * result + ((getWhcd() == null) ? 0 : getWhcd().hashCode()); + result = prime * result + ((getBz() == null) ? 0 : getBz().hashCode()); + result = prime * result + ((getBirthday() == null) ? 0 : getBirthday().hashCode()); + result = prime * result + ((getBeginTime() == null) ? 0 : getBeginTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); + result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode()); + result = prime * result + ((getXtZxbz() == null) ? 0 : getXtZxbz().hashCode()); + result = prime * result + ((getXtZxyz() == null) ? 0 : getXtZxyz().hashCode()); + result = prime * result + ((getXtCjsj() == null) ? 0 : getXtCjsj().hashCode()); + result = prime * result + ((getXtLrsj() == null) ? 0 : getXtLrsj().hashCode()); + result = prime * result + ((getXtLrrxm() == null) ? 0 : getXtLrrxm().hashCode()); + result = prime * result + ((getXtLrrid() == null) ? 0 : getXtLrrid().hashCode()); + result = prime * result + ((getXtLrrbm() == null) ? 0 : getXtLrrbm().hashCode()); + result = prime * result + ((getXtLrrbmid() == null) ? 0 : getXtLrrbmid().hashCode()); + result = prime * result + ((getXtLrip() == null) ? 0 : getXtLrip().hashCode()); + result = prime * result + ((getXtZhxgsj() == null) ? 0 : getXtZhxgsj().hashCode()); + result = prime * result + ((getXtZhxgrxm() == null) ? 0 : getXtZhxgrxm().hashCode()); + result = prime * result + ((getXtZhxgid() == null) ? 0 : getXtZhxgid().hashCode()); + result = prime * result + ((getXtZhxgrbm() == null) ? 0 : getXtZhxgrbm().hashCode()); + result = prime * result + ((getXtZhxgrbmid() == null) ? 0 : getXtZhxgrbmid().hashCode()); + result = prime * result + ((getXtZhxgrip() == null) ? 0 : getXtZhxgrip().hashCode()); + return result; + } + + @Override + public String toString() { + return getClass().getSimpleName() + + " [" + + "Hash = " + hashCode() + + ", id=" + id + + ", managerOrgId=" + managerOrgId + + ", managerOrgName=" + managerOrgName + + ", positionId=" + positionId + + ", positionName=" + positionName + + ", loginName=" + loginName + + ", password=" + password + + ", userName=" + userName + + ", userType=" + userType + + ", email=" + email + + ", mobile=" + mobile + + ", telePhone=" + telePhone + + ", idEntityCard=" + idEntityCard + + ", inDustRialId=" + inDustRialId + + ", sex=" + sex + + ", nation=" + nation + + ", whcd=" + whcd + + ", bz=" + bz + + ", birthday=" + birthday + + ", beginTime=" + beginTime + + ", endTime=" + endTime + + ", salt=" + salt + + ", xtZxbz=" + xtZxbz + + ", xtZxyz=" + xtZxyz + + ", xtCjsj=" + xtCjsj + + ", xtLrsj=" + xtLrsj + + ", xtLrrxm=" + xtLrrxm + + ", xtLrrid=" + xtLrrid + + ", xtLrrbm=" + xtLrrbm + + ", xtLrrbmid=" + xtLrrbmid + + ", xtLrip=" + xtLrip + + ", xtZhxgsj=" + xtZhxgsj + + ", xtZhxgrxm=" + xtZhxgrxm + + ", xtZhxgid=" + xtZhxgid + + ", xtZhxgrbm=" + xtZhxgrbm + + ", xtZhxgrbmid=" + xtZhxgrbmid + + ", xtZhxgrip=" + xtZhxgrip + + ", serialVersionUID=" + serialVersionUID + + "]"; + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfig.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfig.java new file mode 100644 index 0000000..2823a06 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfig.java @@ -0,0 +1,109 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 用户app首页配置表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_user_app_homeconfig") +@ApiModel(value="SysUserAppHomeconfig对象", description="用户app首页配置表") +public class SysUserAppHomeconfig implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页id") + private Long homeid; + + @ApiModelProperty(value = "首页名称") + private String homename; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户身份证号") + private String userSfzh; + + @ApiModelProperty(value = "用户姓名") + private String userXm; + + @ApiModelProperty(value = "配置时间") + private Date pzsj; + + @ApiModelProperty(value = "配置板块数") + private Integer pzbks; + + @ApiModelProperty(value = "色调01-蓝色,02-白色") + private String sd; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.java new file mode 100644 index 0000000..ac82d06 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.java @@ -0,0 +1,103 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 用户app首页配置-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_user_app_homeconfig_plate") +@ApiModel(value="SysUserAppHomeconfigPlate对象", description="用户app首页配置-板块表") +public class SysUserAppHomeconfigPlate implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "配置id") + private Long pzId; + + @ApiModelProperty(value = "板块id") + private Long plateId; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + + @ApiModelProperty(value = "板块内容数") + private Integer bknrs; + + @ApiModelProperty(value = "板块顺序") + private Integer bksx; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.java new file mode 100644 index 0000000..5c4ca1b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.java @@ -0,0 +1,103 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 用户app首页配置-板块内容表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("mosty_base.sys_user_app_homeconfig_plate_list") +@ApiModel(value="SysUserAppHomeconfigPlateList对象", description="用户app首页配置-板块内容表") +public class SysUserAppHomeconfigPlateList implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "配置id") + private Long pzId; + + @ApiModelProperty(value = "配置板块ID") + private Long pzPlateId; + + @ApiModelProperty(value = "内容ID") + private Long plateListId; + + @ApiModelProperty(value = "内容名称") + private String nrmc; + + @ApiModelProperty(value = "板块顺序") + private Integer bksx; + + @ApiModelProperty(value = "路由跳转地址") + private String tzdz; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserDept.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserDept.java new file mode 100644 index 0000000..5cddf9f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserDept.java @@ -0,0 +1,90 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 用户和部门关联表 + * @TableName sys_user_dept + */ +@Data +@TableName(value ="mosty_base.sys_user_dept") +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class SysUserDept implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 部门id + */ + @TableField(value = "dept_id") + private Long deptId; + + public SysUserDept(Long userId, Long deptId) { + this.userId = userId; + this.deptId = deptId; + } + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysUserDept other = (SysUserDept) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getDeptId() == null ? other.getDeptId() == null : this.getDeptId().equals(other.getDeptId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getDeptId() == null) ? 0 : getDeptId().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", deptId=").append(deptId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserRole.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserRole.java new file mode 100644 index 0000000..ae6d20a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/SysUserRole.java @@ -0,0 +1,88 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 用户和角色关联表 + * @TableName sys_user_role + */ +@TableName(value ="mosty_base.sys_user_role") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SysUserRole implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 角色ID + */ + @TableField(value = "role_id") + private Long roleId; + + public SysUserRole(Long userId, Long roleId) { + this.userId = userId; + this.roleId = roleId; + } + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SysUserRole other = (SysUserRole) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", roleId=").append(roleId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/TbJcglXfll.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/TbJcglXfll.java new file mode 100644 index 0000000..132a49d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/TbJcglXfll.java @@ -0,0 +1,183 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; + +/** + * 巡防力量表; + * + * @author : Lhh + * @date : 2022-6-4 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel(value = "巡防力量表", description = "") +@TableName("mosty_base.tb_jcgl_xfll") +public class TbJcglXfll implements Serializable, Cloneable { + + private static final long serialVersionUID = 6556387960466677177L; + + @ApiModelProperty(name = "警员管理表标识ID", notes = "", hidden = true) + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + @ApiModelProperty(value = "人员ID(民警对应sys_user表中的ID,辅警为null)", notes = "") + private String ryid; + + @ApiModelProperty(name = "警员分类", notes = "01、民警,02、辅警") + private String fl; + + @ApiModelProperty(name = "警员类型", notes = "01、社区民警,02、治安民警,03、刑侦民警,04、内勤民警,05、巡逻民警") + private String lx; + + @ApiModelProperty(name = "姓名", notes = "") + private String xm; + + @ApiModelProperty(name = "性别代码", notes = "") + private String xbdm; + + @ApiModelProperty(name = "身份证号", notes = "") + private String sfzh; + + @ApiModelProperty(name = "警号", notes = "") + private String jh; + + @ApiModelProperty(name = "警衔", notes = "") + private String jx; + + @ApiModelProperty(name = "政治面貌", notes = "") + private String zzmm; + + @ApiModelProperty(name = "婚姻状况", notes = "0、未婚,1、已婚,2、离异") + private String hyzk; + + @ApiModelProperty(name = "入职时间", notes = "") + private Date rzsj; + + @ApiModelProperty(name = "出生日期", notes = "") + private Date csrq; + + @ApiModelProperty(name = "民族编码", notes = "") + private String mzdm; + + @ApiModelProperty(name = "文化程度", notes = "") + private String whcddm; + + @ApiModelProperty(name = "籍贯", notes = "") + private String jgdm; + + @ApiModelProperty(name = "家庭住址", notes = "") + private String jtzz; + + @ApiModelProperty(name = "联系电话", notes = "") + private String lxdh; + + @ApiModelProperty(name = "电子邮箱", notes = "") + private String dzyx; + + @ApiModelProperty(name = "巡防力量图片") + private String tp; + + @ApiModelProperty(value = "所属部门id") + private String ssbmid; + + @ApiModelProperty(value = "所属部门") + private String ssbm; + + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + @ApiModelProperty(value = "所属县公安局") + private String ssxgaj; + + @ApiModelProperty(value = "所属县公安局id") + private String ssxgajid; + + @ApiModelProperty(value = "所属县公安局代码") + private String ssxgajdm; + + @ApiModelProperty(value = "所属市公安局id") + private String sssgajid; + + @ApiModelProperty(value = "所属市公安局") + private String sssgaj; + + @ApiModelProperty(value = "所属市公安局代码") + private String sssgajdm; + @ApiModelProperty(value = "数据来源:1、PC,2、手机端",name = "xtSjly") + private String xtSjly; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "数据状态:0、注销,1、正常,-1、封存",name = "xtSjzt") + private String xtSjzt; + + @TableLogic + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "删除标识:0、未删除,1、已删除",name = "xtScbz") + private String xtScbz; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建IP",name = "xtCjip") + private String xtCjip; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建时间",name = "xtCjsj") + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8") + private Timestamp xtCjsj; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建人ID",name = "xtCjrId") + private String xtCjrId; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建人名称",name = "xtCjr") + private String xtCjr; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建部门代码",name = "xtCjbmdm") + private String xtCjbmdm; + + @TableField(fill = FieldFill.INSERT) + @ApiModelProperty(value = "创建部门名称",name = "xtCjbmmc") + private String xtCjbmmc; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新IP",name = "xtZhgxip") + private String xtZhgxip; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新时间",name = "xtZhgxsj") + private Timestamp xtZhgxsj; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新人ID",name = "xtZhgxrid") + private String xtZhgxrid; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新人名称",name = "xtZhgxr") + private String xtZhgxr; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新部门代码",name = "xtZhgxbmdm") + private String xtZhgxbmdm; + + @TableField(fill = FieldFill.UPDATE) + @ApiModelProperty(value = "最后更新部门名称",name = "xtZhgxbm") + private String xtZhgxbm; + + @ApiModelProperty(value = "备注",name = "bz") + private String bz; +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/Ybmj.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/Ybmj.java new file mode 100644 index 0000000..b006af6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/Ybmj.java @@ -0,0 +1,51 @@ +package com.mosty.common.core.business.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户信息表 + * + * @TableName sys_user + */ +@Data +@TableName(value = "mosty_base.ybmj") +public class Ybmj implements Serializable { + + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "用户ID") + private String id; + + @TableField(value = "xm") + @ApiModelProperty(value = "姓名") + private String xm; + + @TableField(value = "jh") + @ApiModelProperty(value = "警号") + private String jh; + + @TableField(value = "dh") + @ApiModelProperty(value = "电话") + private String dh; + + @TableField(value = "ssbmdm") + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + @TableField(value = "ssbm") + @ApiModelProperty(value = "所属部门") + private String ssbm; + + @TableField(value = "sfzh") + @ApiModelProperty(value = "身份证") + private String sfzh; + + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/LoginLogPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/LoginLogPage.java new file mode 100644 index 0000000..89769a9 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/LoginLogPage.java @@ -0,0 +1,20 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class LoginLogPage extends Page { + + @ApiModelProperty(value = "登录账号") + private String userName; + + @ApiModelProperty(value = "登录状态") + private Integer status; +} + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.java new file mode 100644 index 0000000..bf280bd --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.java @@ -0,0 +1,34 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="SysAppHomeconfig对象", description="app首页表") +public class SysAppHomeconfigPage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页ID") + private Long id; + + @ApiModelProperty(value = "首页名称,如:领导端") + private String homename; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.java new file mode 100644 index 0000000..e370d82 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.java @@ -0,0 +1,37 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页配置-板块内容表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="app首页配置-板块内容", description="app首页配置-板块内容") +public class SysAppHomeconfigPlateListPage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "板块ID") + private Long plateId; + + @ApiModelProperty(value = "内容名称") + private String nrmc; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.java new file mode 100644 index 0000000..b9cf64e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.java @@ -0,0 +1,42 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_app_homeconfig_plate") +@ApiModel(value="SysAppHomeconfigPlate对象", description="app首页-板块表") +public class SysAppHomeconfigPlatePage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页ID") + private Long homeid; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.java new file mode 100644 index 0000000..00d0cae --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.java @@ -0,0 +1,30 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="SysAppHomeconfigQuery对象", description="app首页表") +public class SysAppHomeconfigQuery { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页ID") + private Long id; + + @ApiModelProperty(value = "首页名称,如:领导端") + private String homename; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.java new file mode 100644 index 0000000..dffbd1b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="SysUserAppHomeconfig对象", description="用户app首页配置表") +public class SysUserAppHomeconfigPage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页id") + private Long homeid; + + @ApiModelProperty(value = "首页名称") + private String homename; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户身份证号") + private String userSfzh; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.java new file mode 100644 index 0000000..4c5396a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * app首页配置-板块内容表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="app首页配置-板块内容", description="app首页配置-板块内容") +public class SysUserAppHomeconfigPlateListPage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "配置id") + private Long pzId; + + @ApiModelProperty(value = "配置板块ID") + private Long pzPlateId; + + @ApiModelProperty(value = "内容ID") + private Long plateListId; + + @ApiModelProperty(value = "内容名称") + private String nrmc; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.java new file mode 100644 index 0000000..29930f5 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.java @@ -0,0 +1,39 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * app首页-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="SysAppHomeconfigPlate对象", description="app首页-板块表") +public class SysUserAppHomeconfigPlatePage extends Page { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "配置id") + private Long pzId; + + @ApiModelProperty(value = "板块id") + private Long plateId; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.java new file mode 100644 index 0000000..f39e140 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.business.entity.request; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="SysUserAppHomeconfig对象", description="用户app首页配置表") +public class SysUserAppHomeconfigQuery { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页id") + private Long homeid; + + @ApiModelProperty(value = "首页名称") + private String homename; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户身份证号") + private String userSfzh; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.java new file mode 100644 index 0000000..b5cb20f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.java @@ -0,0 +1,20 @@ +package com.mosty.common.core.business.entity.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liyan + */ +@Data +public class SysUserEditPasswordRequest { + + @ApiModelProperty(value = "用户ID") + private Long id; + + @ApiModelProperty(value = "旧密码") + private String oldPassword; + + @ApiModelProperty(value = "新密码") + private String password; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddDeptVO.java new file mode 100644 index 0000000..7c23be0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddDeptVO.java @@ -0,0 +1,81 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +@Accessors(chain = true) +public class AddDeptVO { + + @ApiModelProperty("部门id") + private Long id; + + @ApiModelProperty("部门代码") + @NotBlank(message = "部门代码不能为空!") + private String orgCode; + + @ApiModelProperty("部门名称") + @NotBlank(message = "部门名称不能为空!") + private String orgName; + + @ApiModelProperty("部门类型") + @NotNull(message = "部门类型不能为空!") + private String orgType; + + @ApiModelProperty("部门等级") + @NotNull(message = "部门等级不能为空!") + private String orgLevel; + + @ApiModelProperty("部门业务类型") + @NotNull(message = "部门业务类型不能为空!") + private String orgBizType; + + @ApiModelProperty("部门顺序号") + private String orgNo; + + @ApiModelProperty("上级部门主键") + private Long parentId; + + @ApiModelProperty("部门名称拼音首字母") + private String bmpyszm; + + @ApiModelProperty("部门简称") + private String orgJc; + + @ApiModelProperty("部门全称") + @NotBlank(message = "部门全称不能为空!") + private String orgQc; + + @ApiModelProperty("部门地址") + @NotBlank(message = "部门地址不能为空!") + private String address; + + @ApiModelProperty("部门电话") + @NotBlank(message = "部门电话不能为空!") + private String linkTel; + + @ApiModelProperty("部门联系人") + private String linkMan; + + @ApiModelProperty("部门联系人电话") + private String linkManTel; + + @ApiModelProperty("部门主页") + private String webUrl; + + @ApiModelProperty("部门邮箱") + private String email; + + @ApiModelProperty("部门所属行政区划") + private String xzqh; + + @ApiModelProperty("备注") + private String bz; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.java new file mode 100644 index 0000000..ab62ac8 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class AddRoleDataPartitionVO extends Page { + + /** + * 角色id + */ + @ApiModelProperty("角色id") + private Long id; + /** + * 数据权限等级 + */ + @ApiModelProperty("数据权限等级") + private String dataPermissionLevel; + + + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.java new file mode 100644 index 0000000..974d9c1 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.java @@ -0,0 +1,37 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class AddRoleDeptVO { + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空") + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 角色ids + */ + @NotEmpty(message = "角色集合不能为空") + @ApiModelProperty("角色ids") + private List roleIds; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.java new file mode 100644 index 0000000..54f8fe0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.java @@ -0,0 +1,29 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class AddRoleMenuVO { + + @ApiModelProperty("角色id") + @NotNull(message = "角色id不能为空") + private Long roleId; + + @ApiModelProperty("菜单ids, 菜单可以为空表示解绑,才能删除角色") + private List menuIds; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleVO.java new file mode 100644 index 0000000..6a86727 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddRoleVO.java @@ -0,0 +1,60 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 新增角色对象 + * @author kevin + * @date 2022/2/18 10:40 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class AddRoleVO { + + + /** + * 角色名称 + */ + @NotEmpty(message = "角色名称不能为空") + @ApiModelProperty("角色名称") + private String roleName; + + /** + * 角色编码 + */ + @NotEmpty(message = "角色编码不能为空") + @ApiModelProperty("角色编码") + private String roleCode; + + /** + * 角色描述 + */ + @ApiModelProperty("角色描述") + private String roleDesc; + + /** + * 排序号 + */ + @NotNull(message = "排序号不能为空") + @ApiModelProperty("排序号") + private Integer orderNo; + + /** + * 备注 + */ + @ApiModelProperty("备注") + private String bz; + + /** + * 数据权限等级 + */ + @ApiModelProperty("数据权限等级") + private String dataPermissionLevel; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysMenuVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysMenuVO.java new file mode 100644 index 0000000..d628887 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysMenuVO.java @@ -0,0 +1,55 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 添加系统菜单 + * @author kevin + * @date 2022/2/22 12:51 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class AddSysMenuVO { + + @ApiModelProperty(value = "父菜单id") + private Long parentId; + + @NotEmpty(message = "菜单名称不能为空") + @ApiModelProperty(value = "菜单名称") + private String menuName; + + @NotEmpty(message = "菜单编码不能为空") + @ApiModelProperty(value = "菜单编码") + private String menuCode; + + @ApiModelProperty(value = "菜单地址") + private String menuUrl; + + /** + * 菜单类型 + * @see com.mosty.common.base.constant.enums.MenuTypeEnum + */ + @NotNull(message = "菜单类型不能为空") + @ApiModelProperty(value = "菜单类型:1、菜单组 2、菜单 3、页面 4、资源") + private Integer menuType; + + @NotNull(message = "排序号不能为空") + @ApiModelProperty(value = "排序号") + private Integer orderNo; + + @ApiModelProperty(value = "是否展示:1、展示 2、不展示") + private Integer showMode; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "按钮标识") + private String buttonResource; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysUserVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysUserVO.java new file mode 100644 index 0000000..c194090 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddSysUserVO.java @@ -0,0 +1,278 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 添加用户信息请求对象 + * @author kevin + * @date 2022/2/16 10:11 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class AddSysUserVO implements Serializable { + + /** + * 序列化标识 + */ + private static final long serialVersionUID = 5407773316739763410L; + + /** + * 部门ids + */ +// @NotEmpty(message = "部门ids不能为空!") +// @ApiModelProperty(value = "部门ids") +// private List deptIds; + + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + /** + * 管理部门ID + */ + @ApiModelProperty(value = "管理部门ID") + private Long managerOrgId; + + /** + * 管理部门名称 + */ + @ApiModelProperty(value = "管理部门名称") + private String managerOrgName; + + /** + * 岗位ID + */ +// @NotNull(message = "岗位id不能为空!") + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + /** + * 岗位名称 + */ + @ApiModelProperty(value = "岗位名称") + private String positionName; + + /** + * 登录账号 + */ + @ApiModelProperty(value = "登录账号") +// @NotEmpty(message ="登录账号不能为空") + private String loginName; + + /** + * 密码 + */ + @ApiModelProperty(value = "密码") +// @NotEmpty(message = "密码不能为空") + private String password; + + /** + * 用户昵称 + */ + @ApiModelProperty(value = "用户昵称") + private String userName; + + /** + * 用户类型(00系统用户 01注册用户) + */ + @ApiModelProperty(value = "用户类型(00系统用户默认 01注册用户)") + private String userType; + + /** + * 用户邮箱 + */ + @ApiModelProperty(value = "用户邮箱") + private String email; + + /** + * 移动电话 + */ + @ApiModelProperty(value = "移动电话") + private String mobile; + + /** + * 电话号码 + */ + @ApiModelProperty(value = "电话号码") + private String telePhone; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "id_entity_card") + private String idEntityCard; + + /** + * 行业号码(如:警号) + */ + @ApiModelProperty(value = "行业号码(如:警号)") + private String inDustRialId; + + /** + * 用户性别(0男 1女 2未知) + */ + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + /** + * 民族 + */ + @ApiModelProperty(value = "民族") + private String nation; + + /** + * 政治面貌 + */ + @ApiModelProperty(value = "政治面貌") + private String politic; + + /** + * 婚姻状态 + */ + @ApiModelProperty(value = "婚姻状态") + private String marital; + + /** + * 人员类别 + */ + @ApiModelProperty(value = "人员类别") + private String type; + + /** + * 文化程度 + */ + @ApiModelProperty(value = "文化程度") + private String whcd; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String bz; + + /** + * 出生日期 + */ + @ApiModelProperty(value = "出生日期") + private String birthday; + + /** + * 用户有效开始时间,默认为当前日期(用户可改) + */ + @ApiModelProperty(value = " 用户有效开始时间,默认为当前日期(用户可改)") + private Date beginTime; + + /** + * 用户有效结束时间,默认空 + */ + @ApiModelProperty(value = " 用户有效结束时间,默认空") + private Date endTime; + + /** + * 是否虚拟用户:1、是 2、不是 + */ + @ApiModelProperty(value = "是否虚拟用户:1、是 2、不是") + private String isVirtualUser; + + + /** + * 采集时间 + */ + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + /** + * 录入时间 + */ + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + /** + * 录入人姓名 + */ + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + /** + * 录入人id + */ + @ApiModelProperty(value = "录入人id") + private Long xtLrrid; + + /** + * 录入人部门 + */ + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + /** + * 录入人部门id + */ + @ApiModelProperty(value = "录入人部门id") + private String xtLrrbmid; + + /** + * 录入人部门id + */ + @ApiModelProperty(value = "录入人部门id") + private String xtLrip; + + /** + * 最后修改时间 + */ + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + /** + * 最后修改人姓名 + */ + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + /** + * 最后修改人id + */ + @ApiModelProperty(value = "最后修改人id") + private Long xtZhxgid; + + /** + * 最后修改人部门 + */ + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + /** + * 最后修改人部门id + */ + @ApiModelProperty(value = "最后修改人部门id") + private Long xtZhxgrbmid; + + /** + * 最后修改人ip + */ + @ApiModelProperty(value = "最后修改人ip") + private String xtZhxgrip; + + /** + * token登陆 + */ + @ApiModelProperty(value = "token登陆") + private String token; + + + @ApiModelProperty(value = "是否融合 0否 1是") + private String sfrh; + + @ApiModelProperty(value = "模块") + private String mk; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddUserDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddUserDeptVO.java new file mode 100644 index 0000000..8732262 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/AddUserDeptVO.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class AddUserDeptVO extends Page { + + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 用户id + */ + @ApiModelProperty("用户id") + private Long userId; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/Base64Str.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/Base64Str.java new file mode 100644 index 0000000..ccfc100 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/Base64Str.java @@ -0,0 +1,18 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +@Data +@Accessors(chain = true) +public class Base64Str { + + @ApiModelProperty(value = "base64字符串") + private String base64; + + @ApiModelProperty(value = "文件后缀 png mp4") + private String suffix; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DataPermissionVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DataPermissionVO.java new file mode 100644 index 0000000..b8d14db --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DataPermissionVO.java @@ -0,0 +1,18 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@Accessors(chain = true) +public class DataPermissionVO { + @ApiModelProperty(value = "数据权限等级") + private String permissionLevel; + + @ApiModelProperty(value = "数据权限对应得部门ids") + private List deptIds; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteDeptVO.java new file mode 100644 index 0000000..67406e8 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteDeptVO.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +@Accessors(chain = true) +public class DeleteDeptVO { + /** + * 部门id + */ + @ApiModelProperty("部门id") + @NotNull(message = "部门id不能为空") + private Long id; + + @ApiModelProperty("注销原因") + @NotBlank(message = "注销原因不能为空") + private String xtZxyy; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteListVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteListVO.java new file mode 100644 index 0000000..bf18915 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteListVO.java @@ -0,0 +1,19 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="DeleteListVO", description="DeleteList批量") +public class DeleteListVO { + /** + * ID集合 + */ + private List ids; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.java new file mode 100644 index 0000000..31c31ba --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class DeleteRoleDeptVO extends Page { + + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 角色ids + */ + @ApiModelProperty("角色ids") + private String roleIds; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.java new file mode 100644 index 0000000..52ba553 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class DeleteUserDeptVO extends Page { + + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 用户id + */ + @ApiModelProperty("用户id") + private String userIds; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptPage.java new file mode 100644 index 0000000..2aae970 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptPage.java @@ -0,0 +1,32 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mosty.common.core.business.entity.SysDept; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询部门信息 + * + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class DeptPage extends Page { + + // 部门名称 + private String deptName; + + // 部门编码 + private String orgCode; + + // 部门编码ids + private String ids; + + // 是否需要权限 1.不需要权限 + private String isAll; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptQuery.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptQuery.java new file mode 100644 index 0000000..2b632e3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptQuery.java @@ -0,0 +1,25 @@ +package com.mosty.common.core.business.entity.vo; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 分页查询部门信息 + * + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class DeptQuery { + + // 部门名称 + private String deptname; + + // 部门编码 + private String deptcode; + + // 部门父级编码 + private Integer parentid; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptTreeVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptTreeVO.java new file mode 100644 index 0000000..112bdf4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptTreeVO.java @@ -0,0 +1,20 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 组织结构树搜索请求 + * @author kevin + * @date 2022/3/27 11:44 AM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class DeptTreeVO { + + @ApiModelProperty("搜索关键词") + private String keyword; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptVo.java new file mode 100644 index 0000000..a027702 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/DeptVo.java @@ -0,0 +1,56 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @author dw + * @since 2022/8/1 + * 返回的组织机构对象,包含所属部门 所属分县局 所属地市州 + **/ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "DeptVo 对象", description = "返回的组织机构对象,包含所属部门 所属分县局 所属地市州") +public class DeptVo implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("所属部门ID") + private String deptid; + + @ApiModelProperty("所属部门代码") + private String deptcode; + + @ApiModelProperty("所属部门名称") + private String deptname; + + @ApiModelProperty("部门类型") + private String orgType; + + @ApiModelProperty("部门等级") + private String orgLevel; + + @ApiModelProperty("所属分县局id") + private String fxjid; + + @ApiModelProperty("所属分县局代码") + private String fxjcode; + + @ApiModelProperty("所属分现局名称") + private String fxjname; + + @ApiModelProperty("所属地市州id") + private String dszid; + + @ApiModelProperty("所属地市州代码") + private String dszcode; + + @ApiModelProperty("所属地市州名称") + private String dszname; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/EditSysMenuVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/EditSysMenuVO.java new file mode 100644 index 0000000..a09f9b7 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/EditSysMenuVO.java @@ -0,0 +1,48 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 修改系统菜单 + * @author kevin + * @date 2022/2/22 12:51 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class EditSysMenuVO { + + @NotNull(message = "菜单id不能为空") + @ApiModelProperty(value = "菜单id") + private Long id; + + @NotEmpty(message = "菜单名称不能为空") + @ApiModelProperty(value = "菜单名称") + private String menuName; + + @NotEmpty(message = "菜单编码不能为空") + @ApiModelProperty(value = "菜单编码") + private String menuCode; + + @ApiModelProperty(value = "菜单地址") + private String menuUrl; + + @NotNull(message = "排序号不能为空") + @ApiModelProperty(value = "排序号") + private Integer orderNo; + + @ApiModelProperty(value = "是否展示:1、展示 2、不展示") + private Integer showMode; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "按钮标识") + private String buttonResource; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserPage.java new file mode 100644 index 0000000..84a5984 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserPage.java @@ -0,0 +1,24 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 用户分页展示 + * @author dw + * @date 2022/2/17 10:04 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class GetUserPage { + + @ApiModelProperty("查询方式 1.本部门 2.所有部门") + private String type; + + @ApiModelProperty("搜索关键字") + private String keyword; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.java new file mode 100644 index 0000000..4028ec2 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.java @@ -0,0 +1,24 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +@Accessors(chain = true) +public class GetUserRoleListVo implements Serializable { + + @ApiModelProperty("角色id") + @NotNull(message = "角色id不能为空") + private Long roleId; + + @ApiModelProperty("菜单ids") + private String userName; + + @ApiModelProperty("手机号") + private String phone; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/LoginResponseVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/LoginResponseVO.java new file mode 100644 index 0000000..5c76d7d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/LoginResponseVO.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 登陆返回信息 + * @author kevin + * @date 2022/5/25 4:19 下午 + * @since 1.0.0 + */ +@Data +@Api(tags = "登陆返回body和cookie") +public class LoginResponseVO { + + @ApiModelProperty("登陆返回的body") + private String loginResponseBody; + + @ApiModelProperty("登陆返回的Set-Cookie键值对") + private String loginResponseCookie; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuPage.java new file mode 100644 index 0000000..d5d1fce --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuPage.java @@ -0,0 +1,29 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询菜单信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class MenuPage extends Page { + + /** + * 菜单名称 + */ + private String menuName; + +// /** +// * 岗位状态 :-1:全部、0:正常 2、删除(弃用) +// */ +// private Integer positionStatus; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuQuery.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuQuery.java new file mode 100644 index 0000000..6bfd8f8 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/MenuQuery.java @@ -0,0 +1,28 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询菜单信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class MenuQuery { + + /** + * 菜单名称 + */ + private String menuName; + +// /** +// * 岗位状态 :-1:全部、0:正常 2、删除(弃用) +// */ +// private Integer positionStatus; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/PositionPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/PositionPage.java new file mode 100644 index 0000000..4d8128e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/PositionPage.java @@ -0,0 +1,34 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询岗位信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class PositionPage extends Page { + + /** + * 岗位编码 + */ + private String positionCode; + + /** + * 岗位名称 + */ + private String positionName; + +// /** +// * 岗位状态 :-1:全部、0:正常 2、删除(弃用) +// */ +// private Integer positionStatus; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleByDeptPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleByDeptPage.java new file mode 100644 index 0000000..0fc8707 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleByDeptPage.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询部门信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class RoleByDeptPage extends Page { + + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门id") + private Long deptId; + + + /** + * 角色id + */ + @ApiModelProperty(value = "角色id") + private Long roleId; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleDeptVO.java new file mode 100644 index 0000000..aa79d0a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleDeptVO.java @@ -0,0 +1,64 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class RoleDeptVO implements Serializable { + + + /** + * 部门id + */ + @ApiModelProperty("关联关系id") + private Long id; + + + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 用户id + */ + @ApiModelProperty("角色id") + private Long roleId; + + /** + * 角色名称 + */ + @ApiModelProperty("角色名称") + private String roleName; + + /** + * 角色描述 + */ + @ApiModelProperty("角色描述") + private String roleDesc; + + @ApiModelProperty("注销标志") + private Integer xtZxbz; + + /** + * 录入时间 + */ + @ApiModelProperty("录入时间") + private Date xtLrsj; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RolePage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RolePage.java new file mode 100644 index 0000000..27c94a4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RolePage.java @@ -0,0 +1,29 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询角色信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class RolePage extends Page { + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + private String userId; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserPage.java new file mode 100644 index 0000000..ef27296 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserPage.java @@ -0,0 +1,38 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 角色关联的用户信息分页查询请求 + * @author kevin + * @date 2022/2/20 11:24 AM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class RoleUserPage extends Page { + + /** + * 登陆名称 + */ + @ApiModelProperty("登陆名称") + private String loginName; + + /** + * 手机号码 + */ + @ApiModelProperty("手机号码") + private String phone; + + /** + * 角色id + */ + @ApiModelProperty("角色id") + private Long roleId; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserVO.java new file mode 100644 index 0000000..6f7be59 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/RoleUserVO.java @@ -0,0 +1,31 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 用户和角色关联关系 + */ +@Data +@Accessors(chain = true) +public class RoleUserVO implements Serializable { + + + private static final long serialVersionUID = 3289683012945300862L; + + @NotEmpty(message = "角色id不能为空") + @NotNull(message = "用户id不能为空") + @ApiModelProperty(value = "用户ID") + private List userIds; + + @NotEmpty(message = "角色id不能为空") + @ApiModelProperty(value = "用户IDS") + private Long roleId; + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.java new file mode 100644 index 0000000..a219dcb --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.java @@ -0,0 +1,108 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.models.auth.In; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * app首页-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_app_homeconfig_plate") +@ApiModel(value="SysAppHomeconfigPlate对象", description="app首页-板块表") +public class SysAppHomeconfigPlateVo implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页ID") + private Long homeid; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + + @ApiModelProperty(value = "板块样式") + private String dyys; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "板块顺序") + private Integer bksx; + + @ApiModelProperty(value = "跳转地址") + private String tzdz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + @ApiModelProperty(value = "板块内容集合") + List plateList; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.java new file mode 100644 index 0000000..6c04e72 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.java @@ -0,0 +1,92 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_app_homeconfig") +@ApiModel(value="SysAppHomeconfig对象", description="app首页表") +public class SysAppHomeconfigRsVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页名称,如:领导端") + private String homename; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + @ApiModelProperty(value = "板块集合") + List plateList; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.java new file mode 100644 index 0000000..cb90f1b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.java @@ -0,0 +1,88 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * app首页表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_app_homeconfig") +@ApiModel(value="SysAppHomeconfig对象", description="app首页表") +public class SysAppHomeconfigVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页名称,如:领导端") + private String homename; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysDeptVO.java new file mode 100644 index 0000000..917434e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysDeptVO.java @@ -0,0 +1,176 @@ +package com.mosty.common.core.business.entity.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Objects; + +/** + * 部门信息 + * @author kevin + * @date 2022/2/17 8:48 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class SysDeptVO { + + /** + * 子部门集合 + */ + @ApiModelProperty(value = "子部门集合") + private List childDeptList; + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long id; + + /** + * 部门代码 + */ + @ApiModelProperty("部门代码") + @NotBlank(message = "部门代码不能为空!") + private String orgCode; + + /** + * 部门名称 + */ + @ApiModelProperty("部门名称") + @NotBlank(message = "部门名称不能为空!") + private String orgName; + + + /** + * 部门类型 + */ + @ApiModelProperty("部门类型") + @NotNull(message = "部门类型不能为空!") + private String orgType; + + /** + * 部门等级 + */ + @ApiModelProperty("部门等级") + @NotNull(message = "部门等级不能为空!") + private String orgLevel; + + /** + * 部门业务类型 + */ + @ApiModelProperty("部门业务类型") + @NotNull(message = "部门业务类型不能为空!") + private String orgBizType; + + /** + * 部门顺序号 + */ + @ApiModelProperty("部门顺序号") + @NotNull(message = "部门顺序号不能为空!") + private String orgNo; + + /** + * 上级部门主键 + */ + @ApiModelProperty("上级部门主键") +// @NotNull(message = "上级部门主键不能为空!") + private Long parentId; + + /** + * 部门名称拼音首字母 + */ + @ApiModelProperty("部门名称拼音首字母") + private String bmpyszm; + + /** + * 部门简称 + */ + @ApiModelProperty("部门简称") + @NotBlank(message = "部门简称不能为空!") + private String orgJc; + + /** + * 部门全称 + */ + @ApiModelProperty("部门全称") + @NotBlank(message = "部门全称不能为空!") + private String orgQc; + + /** + * 部门地址 + */ + @ApiModelProperty("部门地址") + @NotBlank(message = "部门地址不能为空!") + private String address; + + /** + * 部门电话 + */ + @ApiModelProperty("部门电话") + @NotBlank(message = "部门电话不能为空!") + private String linkTel; + + /** + * 部门联系人 + */ + @ApiModelProperty("部门联系人") + @NotBlank(message = "部门联系人不能为空!") + private String linkMan; + + /** + * 部门联系人电话 + */ + @ApiModelProperty("部门联系人电话") + @NotBlank(message = "部门联系人电话不能为空!") + private String linkManTel; + + /** + * 部门主页 + */ + @ApiModelProperty("部门主页") + private String webUrl; + + /** + * 部门邮箱 + */ + @ApiModelProperty("部门邮箱") + private String email; + + /** + * 部门所属行政区划 + */ + @ApiModelProperty("部门所属行政区划") + @NotBlank(message = "部门所属行政区划电话不能为空!") + private String xzqh; + + + /** + * 备注 + */ + @ApiModelProperty("备注") + private String bz; + + /** + * 根目录地址 + */ + @JsonInclude + private String rootPath; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SysDeptVO sysDeptVO = (SysDeptVO) o; + return Objects.equals(childDeptList, sysDeptVO.childDeptList) && Objects.equals(id, sysDeptVO.id) && Objects.equals(orgCode, sysDeptVO.orgCode) && Objects.equals(orgName, sysDeptVO.orgName) && Objects.equals(orgLevel, sysDeptVO.orgLevel) && Objects.equals(parentId, sysDeptVO.parentId) && Objects.equals(bmpyszm, sysDeptVO.bmpyszm) && Objects.equals(rootPath, sysDeptVO.rootPath); + } + + @Override + public int hashCode() { + return Objects.hash(childDeptList, id, orgCode, orgName, orgLevel, parentId, bmpyszm, rootPath); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysRoleVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysRoleVO.java new file mode 100644 index 0000000..b44b16a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysRoleVO.java @@ -0,0 +1,62 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; + +/** + * 角色列表 + * @author kevin + * @date 2022/2/18 9:41 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class SysRoleVO implements Serializable { + /** + * 主键id + */ + @ApiModelProperty("角色id") + private Long id; + + /** + * 角色名称 + */ + @ApiModelProperty("角色名称") + private String roleName; + + /** + * 角色编码 + */ + @NotEmpty(message = "角色编码不能为空") + @ApiModelProperty("角色编码") + private String roleCode; + + /** + * 角色描述 + */ + @ApiModelProperty("角色描述") + private String roleDesc; + + /** + * 排序号 + */ + @ApiModelProperty("排序号") + private Integer orderNo; + + /** + * 备注 + */ + @ApiModelProperty("备注") + private String bz; + + /** + * 数据权限等级 + */ + @ApiModelProperty("数据权限等级") + private String dataPermissionLevel; + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.java new file mode 100644 index 0000000..12c504e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.java @@ -0,0 +1,107 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlateList; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * 用户app首页配置-板块表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_app_homeconfig_plate") +@ApiModel(value="SysUserAppHomeconfigPlate对象", description="用户app首页配置-板块表") +public class SysUserAppHomeconfigPlateVo implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "配置id") + private Long pzId; + + @ApiModelProperty(value = "板块id") + private Long plateId; + + @ApiModelProperty(value = "板块类型(00-置顶按钮,01-五情板块,02-工作任务板块,03-概况板块,04-风险板块)") + private String bklx; + + @ApiModelProperty(value = "板块名称") + private String bkmc; + + @ApiModelProperty(value = "板块内容数") + private Integer bknrs; + + @ApiModelProperty(value = "板块顺序") + private Integer bksx; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + @ApiModelProperty(value = "用户板块内容集合") + List plateList; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.java new file mode 100644 index 0000000..5d64054 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.java @@ -0,0 +1,112 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * 用户app首页配置表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_app_homeconfig") +@ApiModel(value="SysUserAppHomeconfig对象", description="用户app首页配置表") +public class SysUserAppHomeconfigVo implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "首页id") + private Long homeid; + + @ApiModelProperty(value = "首页名称") + private String homename; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户身份证号") + private String userSfzh; + + @ApiModelProperty(value = "用户姓名") + private String userXm; + + @ApiModelProperty(value = "配置时间") + private Date pzsj; + + @ApiModelProperty(value = "配置板块数") + private Integer pzbks; + + @ApiModelProperty(value = "色调01-蓝色,02-白色") + private String sd; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人ID") + private String xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门ID") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入IP") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人ID") + private String xtZhxgrid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门ID") + private String xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改IP") + private String xtZhxgip; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyy; + + @ApiModelProperty(value = "用户板块集合") + List plates; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserDeptVO.java new file mode 100644 index 0000000..cfb7e91 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserDeptVO.java @@ -0,0 +1,90 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 用户信息视图 + * + * @author kevin + * @date 2022/2/17 10:08 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class SysUserDeptVO { + + @ApiModelProperty(value = "用户ID") + private Long id; + + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + @ApiModelProperty(value = "岗位名称") + private String positionName; + + @ApiModelProperty(value = "登录账号") + private String loginName; + + @ApiModelProperty(value = "用户昵称") + private String userName; + + @ApiModelProperty(value = "移动电话") + private String mobile; + + @ApiModelProperty(value = "电话号码") + private String telePhone; + + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + @ApiModelProperty(value = "民族") + private String nation; + + @ApiModelProperty(value = "政治面貌") + private String politic; + + @ApiModelProperty(value = "婚姻状态") + private String marital; + + @ApiModelProperty(value = "人员类别") + private String type; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "部门id") + private Long deptId; + + @ApiModelProperty(value = "部门名称") + private String deptName; + + @ApiModelProperty(value = "证件号码") + private String idEntityCard; + + @ApiModelProperty(value = "文化程度") + private String whcd; + + @ApiModelProperty(value = "文化程度") + private String hylb; + + @ApiModelProperty(value = "行业号") + private String inDustRialId; + + @ApiModelProperty(value = "是否虚拟用户") + private String isVirtualUser; + + @ApiModelProperty(value = "是否在线 SYS_SF 0.否 1.是") + private boolean sfzx; + + @ApiModelProperty(value = "是否融合") + private String sfrh; + + @ApiModelProperty(value = "是否融合") + private String mk; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserEditVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserEditVO.java new file mode 100644 index 0000000..7c42565 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserEditVO.java @@ -0,0 +1,97 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +@Data +@Accessors(chain = true) +public class SysUserEditVO { + + @NotEmpty(message = "用户绑定的部门不能为空") + @ApiModelProperty(value = "用户绑定的部门id集合") + private List deptIds; + + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + @NotNull(message = "用户id不能为空") + @ApiModelProperty(value = "用户ID") + private Long id; + +// @NotNull(message = "岗位id不能为空") + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + @ApiModelProperty(value = "登录账号") + private String loginName; + + @ApiModelProperty(value = "岗位名称") + private String positionName; + + @ApiModelProperty(value = "用户昵称") + private String userName; + + @ApiModelProperty(value = "用户邮箱") + private String email; + + @ApiModelProperty(value = "移动电话") + private String mobile; + + @ApiModelProperty(value = "行业号码(如:警号)") + private String inDustRialId; + + @ApiModelProperty(value = "用户类型(00系统用户 01注册用户)") + private String userType; + + @ApiModelProperty(value = "电话号码") + private String telePhone; + + @ApiModelProperty(value = "是否虚拟用户:1、是 2、不是") + private String isVirtualUser; + + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + @ApiModelProperty(value = "民族") + private String nation; + + @ApiModelProperty(value = "政治面貌") + private String politic; + + @ApiModelProperty(value = "婚姻状态") + private String marital; + + @ApiModelProperty(value = "人员类别") + private String type; + + @ApiModelProperty(value = "文化程度") + private String whcd; + + @ApiModelProperty(value = "身份证号") + private String idEntityCard; + + @ApiModelProperty(value = "出生日期") + private String birthday; + + @ApiModelProperty(value = "用户有效开始时间,默认为当前日期(用户可改)") + private Date beginTime; + + @ApiModelProperty(value = "用户有效结束时间,默认空") + private Date endTime; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "是否融合 0否 1是") + private String sfrh; + + @ApiModelProperty(value = "模块") + private String mk; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.java new file mode 100644 index 0000000..46ca383 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.java @@ -0,0 +1,50 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 用户app首页配置表 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_app_homeconfig") +@ApiModel(value="SysUserAppHomeconfig对象", description="用户app首页配置表") +public class SysUserHomeconfigVo implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "首页id") + private Long homeid; + + @ApiModelProperty(value = "首页名称") + private String homename; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户身份证号") + private String userSfzh; + + @ApiModelProperty(value = "用户姓名") + private String userXm; + + @ApiModelProperty(value = "色调01-蓝色,02-白色") + private String sd; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserInfoVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserInfoVO.java new file mode 100644 index 0000000..15c12d9 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserInfoVO.java @@ -0,0 +1,158 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.mosty.common.base.autoconfig.Desensitization; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +/** + * 用户信息视图 + * @author kevin + * @date 2022/2/17 10:08 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class SysUserInfoVO { + + @ApiModelProperty(value = "用户ID") + private Long id; + + @ApiModelProperty(value = "部门Ids") + private List deptIds; + + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + @ApiModelProperty(value = "所属部门") + private String ssbm; + + @ApiModelProperty(value = "管理部门ID") + private Long managerOrgId; + + @ApiModelProperty(value = "管理部门名称") + private String managerOrgName; + + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + @ApiModelProperty(value = "岗位名称") + private String positionName; + + @ApiModelProperty(value = "是否虚拟用户:1、是 2、不是") + private String isVirtualUser; + + @ApiModelProperty(value = "登录账号") + private String loginName; + + @ApiModelProperty(value = "用户昵称") + private String userName; + + @ApiModelProperty(value = "用户类型(00系统用户 01注册用户)") + private String userType; + + @ApiModelProperty(value = "用户邮箱") + private String email; + + @ApiModelProperty(value = "移动电话") + private String mobile; + + @ApiModelProperty(value = "电话号码") + private String telePhone; + + @ApiModelProperty(value = "身份证号") + private String idEntityCard; + + @ApiModelProperty(value = "行业号码(如:警号)") + private String inDustRialId; + + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + @ApiModelProperty(value = "民族") + private String nation; + + @ApiModelProperty(value = "政治面貌") + private String politic; + + @ApiModelProperty(value = "婚姻状态") + private String marital; + + @ApiModelProperty(value = "人员类别") + private String type; + + @ApiModelProperty(value = "文化程度") + private String whcd; + + @ApiModelProperty(value = "备注") + private String bz; + + @ApiModelProperty(value = "出生日期") + private String birthday; + + @ApiModelProperty(value = "用户有效开始时间,默认为当前日期(用户可改)") + private Date beginTime; + + @ApiModelProperty(value = "用户有效结束时间,默认空") + private Date endTime; + + @ApiModelProperty(value = "注销标志0正常 1.注销") + private Integer xtZxbz; + + @ApiModelProperty(value = "注销原因") + private String xtZxyz; + + @ApiModelProperty(value = "采集时间") + private Date xtCjsj; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "录入人姓名") + private String xtLrrxm; + + @ApiModelProperty(value = "录入人id") + private Long xtLrrid; + + @ApiModelProperty(value = "录入人部门") + private String xtLrrbm; + + @ApiModelProperty(value = "录入人部门id") + private String xtLrrbmid; + + @ApiModelProperty(value = "录入人部门id") + private String xtLrip; + + @ApiModelProperty(value = "最后修改时间") + private Date xtZhxgsj; + + @ApiModelProperty(value = "最后修改人姓名") + private String xtZhxgrxm; + + @ApiModelProperty(value = "最后修改人id") + private Long xtZhxgid; + + @ApiModelProperty(value = "最后修改人部门") + private String xtZhxgrbm; + + @ApiModelProperty(value = "最后修改人部门id") + private Long xtZhxgrbmid; + + @ApiModelProperty(value = "最后修改人ip") + private String xtZhxgrip; + + @ApiModelProperty(value = "是否融合") + private String sfrh; + + @ApiModelProperty(value = "模块") + private String mk; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserVO.java new file mode 100644 index 0000000..608a30a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/SysUserVO.java @@ -0,0 +1,74 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.mosty.common.base.autoconfig.Desensitization; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 用户信息视图 + * @author kevin + * @date 2022/2/17 10:08 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class SysUserVO { + + + @ApiModelProperty(value = "用户ID") + private Long id; + + @ApiModelProperty(value = "岗位ID") + private Long positionId; + + @ApiModelProperty(value = "岗位名称") + private String positionName; + + @ApiModelProperty(value = "登录账号") + private String loginName; + + @ApiModelProperty(value = "用户昵称") + private String userName; + + @ApiModelProperty(value = "移动电话") + private String mobile; + + @ApiModelProperty(value = "电话号码") + private String telePhone; + + @ApiModelProperty(value = "用户性别(0男 1女 2未知)") + private String sex; + + @ApiModelProperty(value = "录入时间") + private Date xtLrsj; + + @ApiModelProperty(value = "行业类别") + private String inDustRialId; + + @ApiModelProperty(value = "身份证号") + private String idEntityCard; + + @ApiModelProperty(value = "部门id") + private Long deptId; + + @ApiModelProperty(value = "部门编码") + private String deptCode; + + @ApiModelProperty(value = "部门名称") + private String deptName; + + @ApiModelProperty(value = "部门简称称") + private String deptJc; + + @ApiModelProperty(value = "是否融合") + private String sfrh; + + @ApiModelProperty(value = "是否融合") + private String mk; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.java new file mode 100644 index 0000000..882b994 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.java @@ -0,0 +1,26 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 用户和角色关联关系 + */ +@Data +@Accessors(chain = true) +public class UnboundUserRoleVO implements Serializable { + + private static final long serialVersionUID = 3289683012945300862L; + + @NotEmpty(message = "关联关系ids") + @ApiModelProperty(value = "关联关系ids") + private List ids; + + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserByDeptPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserByDeptPage.java new file mode 100644 index 0000000..28ac756 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserByDeptPage.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 分页查询部门信息 + * @author kevin + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class UserByDeptPage extends Page { + + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门id") + private Long deptId; + + + /** + * 用户id + */ + @ApiModelProperty(value = "用户id") + private Long userId; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptPage.java new file mode 100644 index 0000000..bc48d4e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptPage.java @@ -0,0 +1,43 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 用户部门分页展示 + * @author kevin + * @date 2022/6/5 2:36 下午 + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class UserDeptPage extends Page { + + @ApiModelProperty("登陆名称") + private String loginName; + + @ApiModelProperty("电话号码") + private String phone; + + @ApiModelProperty("部门名称") + private String deptName; + + @ApiModelProperty("部门Id") + private String deptId; + + @ApiModelProperty("orgcode") + private String orgcode; + + @ApiModelProperty("ssbmdm") + private String ssbmdm; + + @ApiModelProperty("部门id集合") + private List deptList; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptVO.java new file mode 100644 index 0000000..33e6d66 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserDeptVO.java @@ -0,0 +1,61 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 添加 部门 用户关联关系 + * @author liyan + * @date 2022/2/9 8:53 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class UserDeptVO implements Serializable { + + + /** + * 部门id + */ + @ApiModelProperty("关联关系id") + private Long id; + + + /** + * 部门id + */ + @ApiModelProperty("部门id") + private Long deptId; + + /** + * 用户id + */ + @ApiModelProperty("用户id") + private Long userId; + + /** + * 用户昵称 + */ + @ApiModelProperty("用户昵称") + private String userName; + + /** + * 登录账号 + */ + @ApiModelProperty("登录账号") + private String loginName; + + @ApiModelProperty("注销标志") + private Integer xtZxbz; + + /** + * 录入时间 + */ + @ApiModelProperty("录入时间") + private Date xtLrsj; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserPage.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserPage.java new file mode 100644 index 0000000..b86ab4e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserPage.java @@ -0,0 +1,44 @@ +package com.mosty.common.core.business.entity.vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mosty.common.core.business.entity.SysUser; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 用户分页展示 + * @author kevin + * @date 2022/2/17 10:04 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class UserPage extends Page { + + @ApiModelProperty("部门id:左边组织机构树选中的部门id") + private String deptId; + + @ApiModelProperty("登陆名称") + private String loginName; + + @ApiModelProperty("电话号码") + private String phone; + + @ApiModelProperty("角色id") + private Long roleId; + + @ApiModelProperty("orgcode") + private String orgcode; + + @ApiModelProperty("是否包含下级") + private String isChild; + + @ApiModelProperty("身份证") + private String idEntityCard; + + @ApiModelProperty("行业号码(如:警号)") + private String inDustRialId; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserRoleVO.java b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserRoleVO.java new file mode 100644 index 0000000..d8958a0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/entity/vo/UserRoleVO.java @@ -0,0 +1,31 @@ +package com.mosty.common.core.business.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 用户和角色关联关系 + */ +@Data +@Accessors(chain = true) +public class UserRoleVO implements Serializable { + + + private static final long serialVersionUID = 3289683012945300862L; + + + @NotNull(message = "用户id不能为空") + @ApiModelProperty(value = "用户ID") + private Long userId; + + @NotEmpty(message = "角色id不能为空") + @ApiModelProperty(value = "用户IDS") + private List roleIds; + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.java new file mode 100644 index 0000000..a483609 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.java @@ -0,0 +1,19 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysAppHomeconfig; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * app首页表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigMapper extends BaseMapper { + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.java new file mode 100644 index 0000000..37b996a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * app首页配置-板块内容表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigPlateListMapper extends BaseMapper { + + /** + * 根据首页ID删除 + * @param plateId + */ + void deleteByPlateId(@Param("plateId") Long plateId); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.java new file mode 100644 index 0000000..125a3f6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * app首页-板块表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigPlateMapper extends BaseMapper { + + /** + * 根据首页ID删除 + * @param homeid + */ + void deleteByHomeid(@Param("homeid") Long homeid); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysDeptMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysDeptMapper.java new file mode 100644 index 0000000..aa32201 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysDeptMapper.java @@ -0,0 +1,47 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysDept; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysRole; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.RoleByDeptPage; +import com.mosty.common.core.business.entity.vo.RoleDeptVO; +import com.mosty.common.core.business.entity.vo.UserByDeptPage; +import com.mosty.common.core.business.entity.vo.UserDeptVO; +import com.mosty.common.core.login.dto.DeptDTO; +import io.swagger.annotations.ApiOperation; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_dept(部门表)】的数据库操作Mapper +* @createDate 2022-02-12 16:52:58 +* @Entity generator.domain.SysDept +*/ +public interface SysDeptMapper extends BaseMapper { + + @ApiOperation("查询用户关联的部门id集合") + List selectUserDeptList(@Param("userId") Long userId); + + @ApiOperation("分页查询部门下用户信息") + IPage selectUserPageByDept(@Param("param") UserByDeptPage userByDeptPage); + + @ApiOperation("分页查询部门下角色信息") + IPage selectRolePageByDept(@Param("param") RoleByDeptPage roleByDeptPage); + + @ApiOperation("查询用户的所属部门") + SysDept getDeptByUserId(Long id); + + @ApiOperation("查询下级部门") + List getDeptListByParentId(@Param("parentid") Integer parentid, @Param("deptname") String deptname); + + @ApiOperation("查询下级部门") + List getDeptListByOrgcode(@Param("deptCode") String deptCode, @Param("deptname") String deptname); +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysLogininforMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..ad1953b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysLogininforMapper.java @@ -0,0 +1,26 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysLogininfor; + +/** +* @author li +* @description 针对表【sys_logininfor(系统访问记录)】的数据库操作Mapper +* @createDate 2022-03-20 15:01:16 +*/ +public interface SysLogininforMapper extends BaseMapper { + /** + * 删除日志 + * @param toStrArray + */ + void deleteOperLogByIds(String[] toStrArray); + + /** + * 清空日志 + */ + void cleanOperLog(); +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysMenuMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysMenuMapper.java new file mode 100644 index 0000000..94673b6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysMenuMapper.java @@ -0,0 +1,16 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysMenu; + +/** + *

+ * 菜单表 Mapper 接口 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +public interface SysMenuMapper extends BaseMapper { + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysOssMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysOssMapper.java new file mode 100644 index 0000000..6daed58 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysOssMapper.java @@ -0,0 +1,16 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysOss; + +/** + *

+ * OSS云存储表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-31 + */ +public interface SysOssMapper extends BaseMapper { + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysPositionMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysPositionMapper.java new file mode 100644 index 0000000..c348474 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysPositionMapper.java @@ -0,0 +1,16 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysPosition; + +/** + *

+ * 岗位表 Mapper 接口 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +public interface SysPositionMapper extends BaseMapper { + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleDeptMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleDeptMapper.java new file mode 100644 index 0000000..8f3e7a6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleDeptMapper.java @@ -0,0 +1,18 @@ +package com.mosty.common.core.business.mapper; + +import com.mosty.common.core.business.entity.SysRoleDept; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author li +* @description 针对表【sys_role_dept(角色和部门关联表)】的数据库操作Mapper +* @createDate 2022-02-12 16:53:15 +* @Entity generator.domain.SysRoleDept +*/ +public interface SysRoleDeptMapper extends BaseMapper { + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMapper.java new file mode 100644 index 0000000..434033d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMapper.java @@ -0,0 +1,18 @@ +package com.mosty.common.core.business.mapper; + +import com.mosty.common.core.business.entity.SysRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author li +* @description 针对表【sys_role(角色表)】的数据库操作Mapper +* @createDate 2022-02-12 16:53:11 +* @Entity generator.domain.SysRole +*/ +public interface SysRoleMapper extends BaseMapper { + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMenuMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMenuMapper.java new file mode 100644 index 0000000..0929216 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysRoleMenuMapper.java @@ -0,0 +1,18 @@ +package com.mosty.common.core.business.mapper; + +import com.mosty.common.core.business.entity.SysRoleMenu; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author li +* @description 针对表【sys_role_menu(角色和菜单关联表)】的数据库操作Mapper +* @createDate 2022-02-12 16:53:18 +* @Entity generator.domain.SysRoleMenu +*/ +public interface SysRoleMenuMapper extends BaseMapper { + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.java new file mode 100644 index 0000000..859f777 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysUserAppHomeconfig; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 用户app首页配置表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigMapper extends BaseMapper { + + /** + * 根据身份证号删除 + * @param sfzh + */ + void deleteBySfzh(@Param("sfzh") String sfzh); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.java new file mode 100644 index 0000000..ce0d377 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlateList; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 用户app首页配置-板块内容表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigPlateListMapper extends BaseMapper { + + /** + * 根据配置ID删除 + * @param pzId + */ + void deleteByPzId(@Param("pzId") Long pzId, @Param("pzPlateId") Long pzPlateId); + + /** + * 根据配置ID删除 + * @param pzId + */ + void delByPzId(@Param("pzId") Long pzId); + + /** + * 修改配置内容 + * @param pzId + */ + void updateById(@Param("pzId") Long pzId, @Param("pzPlateId") Long pzPlateId, @Param("plateListId") Long plateListId, @Param( + "zxbz") Integer zxbz); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.java new file mode 100644 index 0000000..729f63b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.java @@ -0,0 +1,30 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlate; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 用户app首页配置-板块表 Mapper 接口 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigPlateMapper extends BaseMapper { + + /** + * 根据首页ID删除 + * @param pzId + */ + void deleteByPzid(@Param("pzId") Long pzId); + + /** + * 根据首页ID删除 + * @param id + */ + void updateById(@Param("id") Long id, @Param("zxbz") Integer zxbz); + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserDeptMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserDeptMapper.java new file mode 100644 index 0000000..9334b78 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserDeptMapper.java @@ -0,0 +1,19 @@ +package com.mosty.common.core.business.mapper; + +import com.mosty.common.core.business.entity.SysUserDept; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.swagger.annotations.ApiOperation; + +/** +* @author li +* @description 针对表【sys_user_dept(用户和部门关联表)】的数据库操作Mapper +* @createDate 2022-02-12 16:53:21 +* @Entity generator.domain.SysUserDept +*/ +public interface SysUserDeptMapper extends BaseMapper { + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserMapper.java new file mode 100644 index 0000000..4f72c7b --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserMapper.java @@ -0,0 +1,46 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.SysUserDeptVO; +import com.mosty.common.core.business.entity.vo.SysUserVO; +import com.mosty.common.core.business.entity.vo.UserDeptPage; +import com.mosty.common.core.business.entity.vo.UserPage; +import io.swagger.annotations.ApiOperation; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户服务dao层 + * @author kevin + * @date 2022/2/12 10:10 PM + * @since 1.0.0 + */ +public interface SysUserMapper extends BaseMapper { + + @ApiOperation("分页查询用户信息") + List selectByPage(@Param("userPage") UserPage userPage); + + @ApiOperation("查询用户部门分页") + IPage selectUserDeptPage(@Param("userDeptPage") UserDeptPage userDeptPage); + + @ApiOperation("获取部门下的所有的人员数据(包含子部门)") + List getUserListByDeptId(@Param("deptIds") List deptIds, + @Param("keyword") String keyword); + + @ApiOperation("获取部门下的所有人员") + List getUserListByDeptIdOne(Long id); + + @ApiOperation("查询用户数量") + int selectByCount(@Param("userPage") UserPage userPage); + + + @ApiOperation("删除用户信息") + void delById(Long id); +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserRoleMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserRoleMapper.java new file mode 100644 index 0000000..ce61b75 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/SysUserRoleMapper.java @@ -0,0 +1,38 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysUserRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.vo.GetUserRoleListVo; +import com.mosty.common.core.business.entity.vo.RoleUserPage; +import com.mosty.common.core.business.entity.vo.SysUserVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_user_role(用户和角色关联表)】的数据库操作Mapper +* @createDate 2022-02-12 16:53:24 +* @Entity generator.domain.SysUserRole +*/ +public interface SysUserRoleMapper extends BaseMapper { + + /** + * 查询用户可以查看的,当前角色绑定的用户列表 + * @param rootPath 当前用户的组织机构前缀 + * @param roleUserPage 查询请求 + * @return 绑定的用户信息 + */ + List roleUserList(@Param("rootPath") String rootPath, @Param("roleUserPage") RoleUserPage roleUserPage); + + /** + * 分页查询角色下用户 + * @return + */ + List getRoleUserList(GetUserRoleListVo vo); +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/YbmjMapper.java b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/YbmjMapper.java new file mode 100644 index 0000000..9dcbf99 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/mapper/YbmjMapper.java @@ -0,0 +1,13 @@ +package com.mosty.common.core.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.core.business.entity.Ybmj; + + +public interface YbmjMapper extends BaseMapper { + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/LoginService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/LoginService.java new file mode 100644 index 0000000..4f3a6ca --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/LoginService.java @@ -0,0 +1,15 @@ +package com.mosty.common.core.business.service; + +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.login.LoginResponseVO; +import com.mosty.common.core.login.dto.DeptDTO; +import io.swagger.annotations.ApiOperation; + +import java.util.List; + +public interface LoginService { + + @ApiOperation("获取用户菜单信息") + List getMenus(DeptDTO currentLoginDept, SysUser sysUser, LoginResponseVO loginResponseVO); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.java new file mode 100644 index 0000000..6f5a3a5 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.java @@ -0,0 +1,60 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlateListPage; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * app首页配置-板块内容表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigPlateListService extends IService { + + /** + * 新增板块内容 + * @param plate + */ + Long saveInfo(SysAppHomeconfigPlateList plate, String ipAddress); + + /** + * 新增板块内容 + * @param plates + */ + boolean saveInfoBatch(List plates, String ipAddress); + + /** + * 修改首板块内容 + * @param plate + * @param ipAddress + */ + void updateInfo(SysAppHomeconfigPlateList plate, String ipAddress); + + /** + * 修改板块内容 + * @param plates + * @param ipAddress + */ + void updateInfoBatch(List plates, String ipAddress); + + /** + * 删除板块内容 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询应用 + * @param cofigPage + * @return + */ + IPage selectByPage(SysAppHomeconfigPlateListPage cofigPage); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.java new file mode 100644 index 0000000..553e0c0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.java @@ -0,0 +1,60 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlatePage; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * app首页-板块表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigPlateService extends IService { + + /** + * 新增板块 + * @param plate + */ + Long saveInfo(SysAppHomeconfigPlate plate, String ipAddress); + + /** + * 新增板块 + * @param plates + */ + boolean saveInfoBatch(List plates, String ipAddress); + + /** + * 修改板块 + * @param plate + * @param ipAddress + */ + void updateInfo(SysAppHomeconfigPlate plate, String ipAddress); + + /** + * 修改板块 + * @param plates + * @param ipAddress + */ + void updateInfoBatch(List plates, String ipAddress); + + /** + * 删除板块 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询板块 + * @param platePage + * @return + */ + IPage selectByPage(SysAppHomeconfigPlatePage platePage); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigService.java new file mode 100644 index 0000000..23499f2 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysAppHomeconfigService.java @@ -0,0 +1,56 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysAppHomeconfig; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * app首页表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysAppHomeconfigService extends IService { + + /** + * 新增首页应用 + * @param configVO + */ + Long saveInfo(SysAppHomeconfigVO configVO, String ipAddress); + + /** + * 修改首页应用 + * @param configVO + * @param ipAddress + */ + void updateInfo(SysAppHomeconfigVO configVO, String ipAddress); + + /** + * 删除首页应用 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询应用 + * @param cofigPage + * @return + */ + IPage selectByPage(SysAppHomeconfigPage cofigPage); + + /** + * 根据首页id查询模块及内容数据 + * @param configQuery + * @return + */ + SysAppHomeconfigRsVO queryConfig(SysAppHomeconfigQuery configQuery); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysDeptService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysDeptService.java new file mode 100644 index 0000000..9a43416 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysDeptService.java @@ -0,0 +1,84 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysDept; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysRole; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.login.dto.DeptAllVo; +import com.mosty.common.core.login.dto.DeptDTO; +import com.mosty.common.token.UserInfo; +import io.swagger.annotations.ApiOperation; + +import java.util.List; + +/** + * @author li + * @description 针对表【sys_dept(部门表)】的数据库操作Service + * @createDate 2022-02-12 16:52:58 + */ +public interface SysDeptService extends IService { + + // 分页查询部门信息 + IPage selectByPage(DeptPage deptPage); + + + // 分页查询下级部门信息 + List selectDept(DeptQuery dto); + + + // 查询用户关联的部门 + List selectUserDeptList(Long id); + + // 查询子部门集合 + List getChildDeptList(Long deptId); + + // 查询该部门下的所有部门结合 + SysDeptVO getAllChildDeptList(SysDept sysDept, DeptTreeVO deptTreeVO); + + // 新增部门 + Long saveInfo(AddDeptVO addDeptVO, String ipAddress); + + // 修改部门 + void updateInfo(SysDeptVO sysDept, String ipAddress); + + // 删除部门 + void delete(DeleteDeptVO deleteDeptV, String ipAddress, UserInfo userInfo); + + // 根据部门查询部门下用户 + IPage selectUserPageByDept(UserByDeptPage userByDeptPage); + + // 根据部门查询部门下角色 + IPage selectRolePageByDept(RoleByDeptPage roleByDeptPage); + + // 保存部门角色关联关系 + void saveRoleDeptInfo(AddRoleDeptVO roleDeptVO); + + // 添加用户部门关联关系 + void saveUserDeptInfo(AddUserDeptVO addUserDeptVO); + + // 删除用户部门关联关系 + void deleteUserDeptInfo(DeleteUserDeptVO deleteUserDeptVO); + + // 根据部门id 获取部门及以下部门id + List getAllChildDeptIds(Long deptId); + + // 根据组织机构编码查询部门信息 + SysDept getDeptByOrgCode(String orgCode); + + // 部门数据同步 + Boolean deptSys(); + + //根据部门编码分页查询当前及下级部门信息--第三方接口 + IPage getDeptList(DeptPage deptPage); + + // 查询部门下的所有子部门信息 + List getChildDept(String deptid); + + // 查询部门下的所有子部门信息 + List getChildDeptByOrgCode(String orgcode); + + // 查询所属部门、地市州、分县局 + DeptAllVo getOrgByDeptId(String deptId); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysLogininforService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysLogininforService.java new file mode 100644 index 0000000..ab362a6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysLogininforService.java @@ -0,0 +1,31 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysLogininfor; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.request.LoginLogPage; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @author li + * @description 针对表【sys_logininfor(系统访问记录)】的数据库操作Service + * @createDate 2022-03-20 15:01:16 + */ +public interface SysLogininforService extends IService { + + // 记录登录日志 + void recordLogininfor(SysUser user, String loginFail, String message, + HttpServletRequest httpServletRequest, String type); + + // 删除 + void deleteOperLogByIds(List ids); + + // 清空 + void cleanOperLog(); + + // 分页查询 + IPage selectByPage(LoginLogPage loginLogPage); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysMenuService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysMenuService.java new file mode 100644 index 0000000..4badc61 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysMenuService.java @@ -0,0 +1,40 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.base.constant.enums.MenuTypeEnum; +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.business.entity.vo.AddSysMenuVO; +import com.mosty.common.core.business.entity.vo.MenuPage; +import com.mosty.common.core.business.entity.vo.MenuQuery; +import com.mosty.common.core.login.LoginResponseVO; +import io.swagger.annotations.ApiOperation; + +import java.util.List; +import java.util.Set; + +/** + *

+ * 菜单表 服务类 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +public interface SysMenuService extends IService { + + @ApiOperation("分页查询菜单信息") + IPage selectByPage(MenuPage menuPage); + + @ApiOperation("添加菜单信息") + void addSysMenuInfo(AddSysMenuVO addSysMenuVo, SysMenu parentMenu); + + @ApiOperation("登录返回权限") + List listByType(Set menuIds, MenuTypeEnum menuGroup, LoginResponseVO loginResponseVO); + + @ApiOperation("根据菜单id查询子集") + SysMenu getMenuChild(Long menuId); + + @ApiOperation("查询树形结构") + List selectList(MenuQuery menuQuery); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysOssService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysOssService.java new file mode 100644 index 0000000..3df068d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysOssService.java @@ -0,0 +1,23 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysOss; +import com.mosty.common.core.business.entity.vo.AddRoleMenuVO; + +/** + *

+ * OSS云存储表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-31 + */ +public interface SysOssService extends IService { + + /** + * 添加存储 + * @param sysOss + */ + void saveSysOss(SysOss sysOss); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysPositionService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysPositionService.java new file mode 100644 index 0000000..c77ee45 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysPositionService.java @@ -0,0 +1,32 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.config.entity.vo.EditPositionVO; +import com.mosty.common.core.business.entity.SysPosition; +import com.mosty.common.core.business.entity.vo.PositionPage; + +/** + *

+ * 岗位表 服务类 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +public interface SysPositionService extends IService { + + /** + * 分页查询岗位信息 + * @param positionPage 分页请求 + * @return 岗位分页 + */ + IPage selectByPage(PositionPage positionPage); + + /** + * 修改岗位信息 + * @param oldSysPosition 原岗位信息 + * @param editPositionVO 修改岗位信息请求 + */ + void updateSysPost(SysPosition oldSysPosition, EditPositionVO editPositionVO); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleDeptService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleDeptService.java new file mode 100644 index 0000000..1c82737 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleDeptService.java @@ -0,0 +1,28 @@ +package com.mosty.common.core.business.service; + +import com.mosty.common.core.business.entity.SysRoleDept; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_role_dept(角色和部门关联表)】的数据库操作Service +* @createDate 2022-02-12 16:53:15 +*/ +public interface SysRoleDeptService extends IService { + /** + * 部门id + * @param deptId + * @return + */ + List listByDeptId(Long deptId); + + /** + * + * @param deptId + * @param roleId + * @return + */ + SysRoleDept getByDeptIdAndRoleId(Long deptId, Long roleId); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleMenuService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleMenuService.java new file mode 100644 index 0000000..3913198 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleMenuService.java @@ -0,0 +1,28 @@ +package com.mosty.common.core.business.service; + +import com.mosty.common.core.business.entity.SysRoleMenu; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Set; + +/** +* @author li +* @description 针对表【sys_role_menu(角色和菜单关联表)】的数据库操作Service +* @createDate 2022-02-12 16:53:18 +*/ +public interface SysRoleMenuService extends IService { + /** + * 根据角色ids查询菜单 + * @param rolesSet + * @return + */ + List listByRoleIds(Set rolesSet); + + /** + * g根据菜单id查询角色 + * @param id + * @return + */ + Set listByMenuId(Long id); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleService.java new file mode 100644 index 0000000..1b2abb3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysRoleService.java @@ -0,0 +1,49 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysRole; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.token.DeptInfo; +import io.swagger.annotations.ApiOperation; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_role(角色表)】的数据库操作Service +* @createDate 2022-02-12 16:53:11 +*/ +public interface SysRoleService extends IService { + + @ApiOperation("查询角色分页信息") + IPage selectByPage(RolePage rolePage); + + @ApiOperation("查询用户角色列表") + List getUserRoleList(Long userId); + + @ApiOperation("添加角色信息") + void insertRole(AddRoleVO addRoleVo, String ipAddress); + + @ApiOperation("添加角色和菜单关联关系") + void saveRoleMenuInfo(AddRoleMenuVO roleMenuVO); + + @ApiOperation("分配数据权限") + void saveDataPermission(AddRoleDataPartitionVO addRoleDataPartitionVO,String ipAddress); + + @ApiOperation("根据菜单标识获取数据权限") + DataPermissionVO getDataPermission(String menuUrl); + + @ApiOperation("分页查询未绑定当前用户的角色") + IPage selectUnAccreditPage(RolePage rolePage); + + @ApiOperation("分页查询当前角色下用户") + IPage getRoleUserList(GetUserRoleListVo vo); + + @ApiOperation("查询用户绑定的菜单ids") + List getRoleMenuIds(Long roleId); + + @ApiOperation("获取部门最高角色等级权限") + DeptInfo getSysDeptLevel(String orgCode); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.java new file mode 100644 index 0000000..fa7690a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.java @@ -0,0 +1,63 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlateListPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlateListPage; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * 用户app首页配置-板块内容表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigPlateListService extends IService { + + /** + * 新增板块内容 + * @param plate + */ + Long saveInfo(SysUserAppHomeconfigPlateList plate, String ipAddress); + + /** + * 新增板块内容 + * @param plates + */ + boolean saveInfoBatch(List plates, String ipAddress); + + /** + * 修改首板块内容 + * @param plate + * @param ipAddress + */ + void updateInfo(SysUserAppHomeconfigPlateList plate, String ipAddress); + + /** + * 修改板块内容 + * @param plates + * @param ipAddress + */ + void updateInfoBatch(List plates, String ipAddress); + + /** + * 删除板块内容 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询应用 + * @param cofigPage + * @return + */ + IPage selectByPage(SysUserAppHomeconfigPlateListPage cofigPage); + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.java new file mode 100644 index 0000000..72d18b0 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.java @@ -0,0 +1,62 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlate; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlatePage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlatePage; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * 用户app首页配置-板块表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigPlateService extends IService { + + /** + * 新增板块 + * @param plate + */ + Long saveInfo(SysUserAppHomeconfigPlate plate, String ipAddress); + + /** + * 新增板块 + * @param plates + */ + boolean saveInfoBatch(List plates, String ipAddress); + + /** + * 修改板块 + * @param plate + * @param ipAddress + */ + void updateInfo(SysUserAppHomeconfigPlate plate, String ipAddress); + + /** + * 修改板块 + * @param plates + * @param ipAddress + */ + void updateInfoBatch(List plates, String ipAddress); + + /** + * 删除板块 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询板块 + * @param platePage + * @return + */ + IPage selectByPage(SysUserAppHomeconfigPlatePage platePage); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigService.java new file mode 100644 index 0000000..052d9f4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserAppHomeconfigService.java @@ -0,0 +1,77 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysUserAppHomeconfig; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.SysUserAppHomeconfigVo; +import com.mosty.common.core.business.entity.vo.SysUserHomeconfigVo; +import com.mosty.common.token.UserInfo; + +import java.util.List; + +/** + *

+ * 用户app首页配置表 服务类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +public interface SysUserAppHomeconfigService extends IService { + + /** + * 新增用户首页应用 + * @param config + */ + Long saveInfo(SysUserAppHomeconfig config, String ipAddress); + + /** + * 新增用户首页应用 + * @param config + */ + void saveInfoBatch(List config, String ipAddress); + + /** + * 修改首页应用 + * @param config + * @param ipAddress + */ + void updateInfo(SysUserAppHomeconfig config, String ipAddress); + + + /** + * 修改首页应用 + * @param config + * @param ipAddress + */ + void updateInfoBatch(List config, String ipAddress); + + /** + * 删除首页应用 + * @param list + */ + void delete(List list, String ipAddress, UserInfo userInfo); + + /** + * 查询用户应用 + * @param cofigPage + * @return + */ + IPage selectByPage(SysUserAppHomeconfigPage cofigPage); + + /** + * 查询用户配置 + * @param cofigQuery + * @return + */ + List queryUserConfig(SysUserAppHomeconfigQuery cofigQuery); + + /** + * 新增用户首页应用 + * @param config + */ + Long saveDefaultConfig(SysUserHomeconfigVo config, String ipAddress); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserDeptService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserDeptService.java new file mode 100644 index 0000000..ea0669c --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserDeptService.java @@ -0,0 +1,42 @@ +package com.mosty.common.core.business.service; + +import com.mosty.common.core.business.entity.SysUserDept; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_user_dept(用户和部门关联表)】的数据库操作Service +* @createDate 2022-02-12 16:53:21 +*/ +public interface SysUserDeptService extends IService { + /** + * + * @param id + * @return + */ + List listByDeptId(Long id); + + /** + * 根据部门id,用户id查询关联关系 + * @param deptId + * @param userId + * @return + */ + SysUserDept getByDeptIdAndUserId(Long deptId, Long userId); + + /** + * 根据userId获取相关部门 + * @param id + * @return + */ + List listByUserId(Long id); + + /** + * 根据部门ID集合查询用户 + * @param ids + * @return + */ + List listByDeptIds(List ids); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserRoleService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserRoleService.java new file mode 100644 index 0000000..5e0cb31 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserRoleService.java @@ -0,0 +1,34 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.core.business.entity.SysUserRole; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.vo.RoleUserPage; +import com.mosty.common.core.business.entity.vo.RoleUserVO; +import com.mosty.common.core.business.entity.vo.SysUserVO; +import com.mosty.common.core.business.entity.vo.UserRoleVO; +import io.swagger.annotations.ApiOperation; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_user_role(用户和角色关联表)】的数据库操作Service +* @createDate 2022-02-12 16:53:24 +*/ +public interface SysUserRoleService extends IService { + + @ApiOperation("查询角色关联的用户信息") + IPage roleUserList(String rootPath, RoleUserPage roleUserPage); + + @ApiOperation("跟根据用户id查询角色列表") + List listByUserId(Long id); + + @ApiOperation("为用户授权角色") + boolean grantRoleToUser(UserRoleVO userRoleVo); + + @ApiOperation("为角色授予用户") + boolean grantUserToRole(RoleUserVO roleUserVO); + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserService.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserService.java new file mode 100644 index 0000000..74ee957 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/SysUserService.java @@ -0,0 +1,49 @@ +package com.mosty.common.core.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.request.SysUserEditPasswordRequest; +import com.mosty.common.core.business.entity.vo.*; +import io.swagger.annotations.ApiOperation; + +import java.util.List; + +public interface SysUserService extends IService { + + @ApiOperation("添加用户信息") + void saveInfo(AddSysUserVO sysUser); + + @ApiOperation("编辑用户信息") + void editInfo(SysUserEditVO sysUserEditVo, SysUser sysUser); + + @ApiOperation("编辑密码") + void editPassword(SysUserEditPasswordRequest sysUserEditPasswordRequest); + + @ApiOperation("查询用户信息") + SysUser getUserInfo(Long id); + + @ApiOperation("查询用户信息") + SysUser checkUserInfo(SysUser user); + + @ApiOperation("分页查询用户信息") + IPage selectByPage(UserPage userPage); + + @ApiOperation("重置密码") + void resetPassword(SysUser user); + + @ApiOperation("查询未绑定当前角色的用户") + IPage selectUnAccreditPage(UserPage userPage); + + @ApiOperation("查询用户部门信息") + IPage selectUserDeptPage(UserDeptPage userDeptPage); + + @ApiOperation("用户数据同步") + Boolean userSys(); + + @ApiOperation("根据条件查询用户信息") + List getUserList(GetUserPage dto); + + @ApiOperation("删除用户信息") + void delById(Long id); +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/LoginServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000..f794c5a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/LoginServiceImpl.java @@ -0,0 +1,67 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.mosty.common.base.constant.enums.MenuTypeEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.service.*; +import com.mosty.common.core.login.LoginResponseVO; +import com.mosty.common.core.login.UserPermissionsInfo; +import com.mosty.common.core.login.dto.DeptDTO; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + + +@Service +@AllArgsConstructor +public class LoginServiceImpl implements LoginService { + + + private final SysRoleDeptService sysRoleDeptService; + private final SysUserRoleService sysUserRoleService; + private final SysRoleMenuService sysRoleMenuService; + private final SysMenuService sysMenuService; + + @Override + public List getMenus(DeptDTO currentLoginDept, SysUser sysUser, LoginResponseVO loginResponseVO) { + if (!sysUser.getLoginName().contains("admin")) { + List roleDepts = sysRoleDeptService.listByDeptId(currentLoginDept.getDeptId()); + List userRoles = sysUserRoleService.listByUserId(sysUser.getId()); + List roleIds = new ArrayList<>(); + if (!roleDepts.isEmpty()) { + List deptRoleIds = roleDepts.stream().map(SysRoleDept::getRoleId).collect(Collectors.toList()); + roleIds.addAll(deptRoleIds); + } + if (!userRoles.isEmpty()) { + List userRoleIds = userRoles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()); + roleIds.addAll(userRoleIds); + } + // 如果没有权限 ,添加默认权限 + if (CollectionUtils.isEmpty(roleIds)) { + SysUserRole role = new SysUserRole(); + role.setUserId(sysUser.getId()); + role.setRoleId(136L); + this.sysUserRoleService.save(role); + roleIds.add(136L); + } + Set rolesSet = new HashSet<>(roleIds); + List roleMenus = sysRoleMenuService.listByRoleIds(rolesSet); + if (roleMenus.isEmpty()) { + return new ArrayList<>(); + } + Set menuIds = roleMenus.stream().map(SysRoleMenu::getMenuId).collect(Collectors.toSet()); + //查询一级菜单组 递归 + return sysMenuService.listByType(menuIds, MenuTypeEnum.MENU_GROUP, loginResponseVO); + } else { + return sysMenuService.listByType(null, MenuTypeEnum.MENU_GROUP, loginResponseVO); + } + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.java new file mode 100644 index 0000000..4c1b7ed --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.java @@ -0,0 +1,127 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlateListPage; +import com.mosty.common.core.business.mapper.SysAppHomeconfigPlateListMapper; +import com.mosty.common.core.business.service.SysAppHomeconfigPlateListService; +import com.mosty.common.token.UserInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + *

+ * app首页配置-板块内容表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service +public class SysAppHomeconfigPlateListServiceImpl extends ServiceImpl implements SysAppHomeconfigPlateListService { + + @Resource + private SysAppHomeconfigPlateListMapper sysAppHomeconfigPlateListMapper; + + @Override + public Long saveInfo(SysAppHomeconfigPlateList plate, String ipAddress) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateListMapper.insert(plate); + return plate.getId(); + } + + @Override + public boolean saveInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + for(SysAppHomeconfigPlateList plate : plates) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateListMapper.insert(plate); + } + } + return true; + } + + @Override + public void updateInfo(SysAppHomeconfigPlateList plate, String ipAddress) { + SysAppHomeconfigPlateList oldConfig = sysAppHomeconfigPlateListMapper.selectById(plate.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的信息不存在", plate.getId()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + plate.setXtZhxgsj(new Date()); + plate.setXtLrip(ipAddress); + sysAppHomeconfigPlateListMapper.updateById(plate); + } + + @Override + public void updateInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + Long plateId = plates.get(0).getPlateId(); + sysAppHomeconfigPlateListMapper.deleteByPlateId(plateId); + for(SysAppHomeconfigPlateList plate : plates) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateListMapper.insert(plate); + } + } + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if(!CollectionUtils.isEmpty(list)) { + for(Long id : list) { + SysAppHomeconfigPlateList plate = sysAppHomeconfigPlateListMapper.selectById(id); + if(plate != null) { + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.DELETED.code); + plate.setXtZhxgsj(new Date()); + plate.setXtZhxgip(ipAddress); + if(userInfo != null) { + plate.setXtZhxgrxm(userInfo.getUserName()); + plate.setXtZhxgrbmid(userInfo.getDeptId() + ""); + plate.setXtZhxgrbm(userInfo.getDeptName()); + } + sysAppHomeconfigPlateListMapper.updateById(plate); + } + } + } + } + + @Override + public IPage selectByPage(SysAppHomeconfigPlateListPage platePage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(platePage.getNrmc())) { + queryWrapper.and(wrapper -> wrapper.like("nrmc", platePage.getNrmc())); + } + if(platePage.getPlateId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("pz_id", platePage.getPlateId())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + platePage.setOrders(orderBy); + return sysAppHomeconfigPlateListMapper.selectPage(platePage, queryWrapper); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.java new file mode 100644 index 0000000..5177975 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.java @@ -0,0 +1,135 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysAppHomeconfig; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlatePage; +import com.mosty.common.core.business.mapper.SysAppHomeconfigPlateMapper; +import com.mosty.common.core.business.service.SysAppHomeconfigPlateService; +import com.mosty.common.token.UserInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + *

+ * app首页-板块表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service + + +public class SysAppHomeconfigPlateServiceImpl extends ServiceImpl implements SysAppHomeconfigPlateService { + + @Resource + private SysAppHomeconfigPlateMapper sysAppHomeconfigPlateMapper; + + @Override + public Long saveInfo(SysAppHomeconfigPlate plate, String ipAddress) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateMapper.insert(plate); + return plate.getId(); + } + + @Override + public boolean saveInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + for(SysAppHomeconfigPlate plate : plates) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateMapper.insert(plate); + } + } + return true; + } + + @Override + public void updateInfo(SysAppHomeconfigPlate plate, String ipAddress) { + SysAppHomeconfigPlate oldConfig = sysAppHomeconfigPlateMapper.selectById(plate.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的信息不存在", plate.getId()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + plate.setXtZhxgsj(new Date()); + plate.setXtLrip(ipAddress); + sysAppHomeconfigPlateMapper.updateById(plate); + } + + @Override + public void updateInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + Long homeId = plates.get(0).getHomeid(); + sysAppHomeconfigPlateMapper.deleteByHomeid(homeId); + for(SysAppHomeconfigPlate plate : plates) { + plate.setXtZhxgsj(new Date()); + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigPlateMapper.insert(plate); + } + } + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if(!CollectionUtils.isEmpty(list)) { + for(Long id : list) { + SysAppHomeconfigPlate plate = sysAppHomeconfigPlateMapper.selectById(id); + if(plate != null) { + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.DELETED.code); + plate.setXtZhxgsj(new Date()); + plate.setXtZhxgip(ipAddress); + if(userInfo != null) { + plate.setXtZhxgrxm(userInfo.getUserName()); + plate.setXtZhxgrbmid(userInfo.getDeptId() + ""); + plate.setXtZhxgrbm(userInfo.getDeptName()); + } + sysAppHomeconfigPlateMapper.updateById(plate); + } + } + } + } + + @Override + public IPage selectByPage(SysAppHomeconfigPlatePage platePage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(platePage.getBkmc())) { + queryWrapper.and(wrapper -> wrapper.like("bkmc", platePage.getBkmc())); + } + if(StringUtils.isNotBlank(platePage.getBklx())) { + queryWrapper.and(wrapper -> wrapper.eq("bklx", platePage.getBklx())); + } + if(platePage.getHomeid() != null) { + queryWrapper.and(wrapper -> wrapper.eq("homeid", platePage.getHomeid())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + platePage.setOrders(orderBy); + return sysAppHomeconfigPlateMapper.selectPage(platePage, queryWrapper); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.java new file mode 100644 index 0000000..c1a955e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.java @@ -0,0 +1,152 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysAppHomeconfig; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlate; +import com.mosty.common.core.business.entity.SysAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.SysAppHomeconfigPlateVo; +import com.mosty.common.core.business.entity.vo.SysAppHomeconfigRsVO; +import com.mosty.common.core.business.entity.vo.SysAppHomeconfigVO; +import com.mosty.common.core.business.mapper.SysAppHomeconfigMapper; +import com.mosty.common.core.business.mapper.SysAppHomeconfigPlateListMapper; +import com.mosty.common.core.business.mapper.SysAppHomeconfigPlateMapper; +import com.mosty.common.core.business.service.SysAppHomeconfigService; +import com.mosty.common.token.UserInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * app首页表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service +public class SysAppHomeconfigServiceImpl extends ServiceImpl implements SysAppHomeconfigService { + + @Resource + private SysAppHomeconfigMapper sysAppHomeconfigMapper; + + @Resource + private SysAppHomeconfigPlateMapper sysAppHomeconfigPlateMapper; + + @Resource + private SysAppHomeconfigPlateListMapper sysAppHomeconfigPlateListMapper; + + @Override + public Long saveInfo(SysAppHomeconfigVO configVO, String ipAddress) { + SysAppHomeconfig config = new SysAppHomeconfig(); + BeanUtils.copyProperties(configVO, config); + config.setXtZhxgsj(new Date()); + config.setXtCjsj(new Date()); + config.setXtLrip(ipAddress); + config.setBz(configVO.getBz()); + config.setXtLrsj(new Date()); + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.NATURE.code); + sysAppHomeconfigMapper.insert(config); + return config.getId(); + } + + @Override + public void updateInfo(SysAppHomeconfigVO configVO, String ipAddress) { + SysAppHomeconfig oldConfig = this.getBaseMapper().selectById(configVO.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的应用信息不存在", configVO.getId()); + SysAppHomeconfig config = BeanUtil.copyProperties(configVO, SysAppHomeconfig.class); + config.setXtZxbz(DeletedEnum.NATURE.code); + config.setXtZhxgsj(new Date()); + config.setXtLrip(ipAddress); + sysAppHomeconfigMapper.updateById(config); + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if(!CollectionUtils.isEmpty(list)) { + for(Long id : list) { + SysAppHomeconfig config = getBaseMapper().selectById(id); + if(config != null) { + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.DELETED.code); + config.setXtZhxgsj(new Date()); + config.setXtZhxgip(ipAddress); + if(userInfo != null) { + config.setXtZhxgrxm(userInfo.getUserName()); + config.setXtZhxgrbmid(userInfo.getDeptId() + ""); + config.setXtZhxgrbm(userInfo.getDeptName()); + } + sysAppHomeconfigMapper.updateById(config); + } + } + } + } + + @Override + public IPage selectByPage(SysAppHomeconfigPage cofigPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(cofigPage.getHomename())) { + queryWrapper.and(wrapper -> wrapper.like("homename", cofigPage.getHomename())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + cofigPage.setOrders(orderBy); + return sysAppHomeconfigMapper.selectPage(cofigPage, queryWrapper); + } + + @Override + public SysAppHomeconfigRsVO queryConfig(SysAppHomeconfigQuery configQuery) { + List plateList = new ArrayList<>(); + SysAppHomeconfigRsVO vo = new SysAppHomeconfigRsVO(); + if (configQuery.getId() == null) { + return vo; + } + SysAppHomeconfig config = sysAppHomeconfigMapper.selectById(configQuery.getId()); + BeanUtils.copyProperties(config, vo); + QueryWrapper plateWrapper = new QueryWrapper<>(); + plateWrapper.lambda().eq(SysAppHomeconfigPlate::getHomeid, config.getId()); + plateWrapper.lambda().eq(SysAppHomeconfigPlate::getXtZxbz, DeletedEnum.NATURE.code); + plateWrapper.orderByAsc("bksx"); + List plates = sysAppHomeconfigPlateMapper.selectList(plateWrapper); + if(!CollectionUtils.isEmpty(plates)) { + List plateIds = plates.stream().map(item->item.getId()).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(plateIds)) { + QueryWrapper plateListWrapper = new QueryWrapper<>(); + plateListWrapper.lambda().in(SysAppHomeconfigPlateList::getPlateId, plateIds); + plateListWrapper.lambda().eq(SysAppHomeconfigPlateList::getXtZxbz, DeletedEnum.NATURE.code); + plateListWrapper.orderByAsc("nrsx"); + plateList = sysAppHomeconfigPlateListMapper.selectList(plateListWrapper); + } + List plateVos = new ArrayList<>(); + for(SysAppHomeconfigPlate plate : plates) { + SysAppHomeconfigPlateVo plateVo = new SysAppHomeconfigPlateVo(); + BeanUtils.copyProperties(plate, plateVo); + if(!CollectionUtils.isEmpty(plateList)) { + List list = + plateList.parallelStream().filter(item->item.getPlateId().longValue()== plate.getId().longValue()).collect(Collectors.toList()); + plateVo.setPlateList(list); + } + plateVos.add(plateVo); + } + vo.setPlateList(plateVos); + } + return vo; + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..0f04127 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,592 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.base.util.ChineseCharacterUtil; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.mapper.SysDeptMapper; +import com.mosty.common.core.business.service.*; +import com.mosty.common.core.constant.DataPermissionConstant; +import com.mosty.common.core.login.dto.DeptAllVo; +import com.mosty.common.core.login.dto.DeptDTO; +import com.mosty.common.core.util.http.HttpUtils; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class SysDeptServiceImpl extends ServiceImpl + implements SysDeptService { + @Resource + private SysDeptMapper sysDeptMapper; + @Resource + private SysUserDeptService sysUserDeptService; + @Resource + private SysRoleDeptService sysRoleDeptService; + @Resource + private SysRoleService sysRoleService; + @Resource + private SysUserService sysUserService; + + public static String DEPT_URL = "http://80.149.27.78:8001/no-auth-api/system/jurisdictions/all"; + + @Value("${config.orgCode}") + private String orgCode; + + + @Override + public IPage selectByPage(DeptPage deptPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(deptPage.getDeptName())) { + queryWrapper.and(wrapper -> wrapper.like("org_name", deptPage.getDeptName())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + queryWrapper.and(wrapper -> wrapper.eq("parent_id", DeletedEnum.NATURE.code)); +// queryWrapper.and(wrapper -> wrapper.isNull("parent_id")); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + deptPage.setOrders(orderBy); + IPage iPage = this.baseMapper.selectPage(deptPage, queryWrapper); + if (CollectionUtils.isNotEmpty(iPage.getRecords())) { + List records = iPage.getRecords(); + records.forEach(this::wrapChildList); + iPage.setRecords(records); + } + return iPage; + } + + @Override + public List selectDept(DeptQuery dto) { + if (dto.getParentid() != null) { + return this.baseMapper.getDeptListByParentId(dto.getParentid(), dto.getDeptname()); + } + UserInfo user = UserInfoManager.get(); + String ssbm = getSsbm(user); + return this.baseMapper.getDeptListByOrgcode(ssbm, dto.getDeptname()); + } + + // 获取用户的查询条件 + public String getSsbm(UserInfo user) { + // 查询用户权限 + SysRoleVO role = null; + List userRoles = sysRoleService.getUserRoleList(user.getUserId()); + if (!CollectionUtils.isEmpty(userRoles)) { + int level = Integer.parseInt(userRoles.get(0).getDataPermissionLevel()); + role = userRoles.get(0); + for (SysRoleVO item : userRoles) { + if (level > Integer.parseInt(item.getDataPermissionLevel())) { + level = Integer.parseInt(item.getDataPermissionLevel()); + role = item; + } + } + } + if (role != null) { + String level = role.getDataPermissionLevel(); + if ("1".equals(level) || "2".equals(level)) { + return orgCode; + } else if ("3".equals(level)) { + return user.getDszDeptCode(); + } else if ("4".equals(level)) { + return user.getFxjDeptCode(); + } else { + return user.getDeptCode(); + } + } + return user.getDeptCode(); + } + + + private void wrapChildList1(SysDept item, List allList) { +// List list = this.list( +// new LambdaQueryWrapper() +// .eq(SysDept::getParentId, item.getId()) +// .eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code) +// ); + List list = allList.stream().filter(it -> + !Objects.isNull(it.getParentId()) && it.getParentId().equals(item.getId())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(list)) { + item.setChildDeptList(list); + list.forEach(it -> this.wrapChildList1(it, allList)); + } + } + + private void wrapChildList(SysDept item) { + List list = this.list( + new LambdaQueryWrapper() + .eq(SysDept::getParentId, item.getId()) + .eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code) + ); + if (CollectionUtils.isNotEmpty(list)) { + item.setChildDeptList(list); + list.forEach(this::wrapChildList); + } + } + + // 获取部门 + public IPage getDept(DeptPage deptPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + if (StringUtils.isBlank(deptPage.getDeptName())) { + if (StringUtils.isNotBlank(deptPage.getOrgCode())) { + queryWrapper.and(wrapper -> wrapper.eq("org_code", deptPage.getOrgCode())); + } else { + queryWrapper.and(wrapper -> wrapper.isNull("parent_id")); + } + } + if (StringUtils.isNotBlank(deptPage.getIds())) { + List list = Arrays.asList(deptPage.getIds().split(",")); + queryWrapper.in("id", list); + } + queryWrapper.like(StringUtils.isNotBlank(deptPage.getDeptName()), "org_name", deptPage.getDeptName()); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + deptPage.setOrders(orderBy); + return getBaseMapper().selectPage(deptPage, queryWrapper); + } + + @Override + public List selectUserDeptList(Long userId) { + return sysDeptMapper.selectUserDeptList(userId); + } + + @Override + public List getChildDeptList(Long deptId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("parent_id", deptId)); + return getBaseMapper().selectList(queryWrapper); + } + + @Override + public SysDeptVO getAllChildDeptList(SysDept sysDept, DeptTreeVO deptTreeVO) { + SysDeptVO sysDeptVO = BeanUtil.copyProperties(sysDept, SysDeptVO.class); + + String keyword = StringUtils.isEmpty(deptTreeVO.getKeyword()) ? null : deptTreeVO.getKeyword(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + UserInfo userInfo = UserInfoManager.get(); + //获取最大权限角色 + String level = userInfo.getLevel(); + if (DataPermissionConstant.DATA_SCOPE_COUNTY.equals(level) || DataPermissionConstant.DATA_SCOPE_DEPT_AND_CHILD.equals(level) || DataPermissionConstant.DATA_SCOPE_DEPT.equals(level) || DataPermissionConstant.DATA_SCOPE_SELF.equals(level)) { + queryWrapper.and(wrapper -> wrapper.like("root_path", sysDept.getRootPath() + "%")); + } + //部门查询 + List allDept = getBaseMapper().selectList(queryWrapper); + if (CollectionUtils.isEmpty(allDept)) { + return sysDeptVO; + } + List natureList = allDept.stream().filter(dept -> DeletedEnum.NATURE.code.equals(dept.getXtZxbz())) + .map(dept -> BeanUtil.copyProperties(dept, SysDeptVO.class)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(natureList)) { + return sysDeptVO; + } + + if (keyword != null) { + Map idMap = natureList.stream().collect(Collectors.toMap(SysDeptVO::getId, vo -> vo)); + Set containSet = Sets.newHashSet(); + natureList.stream().filter(dept -> dept.getOrgName().contains(keyword) || dept.getBmpyszm().toLowerCase().contains(keyword)) + .forEach(dept -> { + try { + for (String id : dept.getRootPath().split("_")) { + SysDeptVO sysDeptVO1 = idMap.get(Long.parseLong(id)); + if (sysDeptVO1 != null) { + containSet.add(sysDeptVO1); + } + } + } catch (Exception e) { + log.error("解析跟目录地址异常:dept={}" + JSON.toJSONString(dept)); + } + }); + natureList = Lists.newArrayList(containSet); + } + // 递归组织组织机构树 + wrapChildList(sysDeptVO, natureList); + + return sysDeptVO; + } + + @Override + @JwtSysUser + public Long saveInfo(AddDeptVO addDeptVO, String ipAddress) { + SysDept sysDept = BeanUtil.copyProperties(addDeptVO, SysDept.class); + String lowerCase = ChineseCharacterUtil.getLowerCase(addDeptVO.getOrgName(), false); + sysDept.setBmpyszm(lowerCase); + UserInfo userInfo = UserInfoManager.get(); + sysDept.setXtZxbz(DeletedEnum.NATURE.code); + String rootPath; + sysDept.setXtZhxgsj(new Date()); + sysDept.setXtCjsj(new Date()); + sysDept.setXtLrip(ipAddress); + sysDept.setXtZhxgid(userInfo.getUserId()); + sysDept.setXtZhxgrxm(userInfo.getUserName()); + sysDept.setXtZhxgrbmid(userInfo.getDeptId()); + sysDept.setXtZhxgrbm(userInfo.getDeptName()); + sysDept.setBz(addDeptVO.getBz()); + sysDept.setXtLrsj(new Date()); + sysDept.setXtLrrid(userInfo.getUserId()); + sysDept.setXtLrrxm(userInfo.getUserName()); + sysDept.setXtLrrbmid(userInfo.getDeptId().toString()); + sysDept.setXtLrrbm(userInfo.getDeptName()); + this.save(sysDept); + if (Objects.nonNull(sysDept.getParentId())) { + SysDept dept = this.getById(addDeptVO.getParentId()); + Asserts.check(dept == null, "传入的父id对应的部门信息不存在"); + rootPath = dept.getRootPath().endsWith("_") ? + (dept.getRootPath() + sysDept.getId()) : (dept.getRootPath() + "_" + sysDept.getId()); + } else { + rootPath = sysDept.getId() + "_"; + } + sysDept.setRootPath(rootPath); + sysDeptMapper.updateById(sysDept); + return sysDept.getId(); + + } + + @Override + @JwtSysUser + public void updateInfo(SysDeptVO sysDept, String ipAddress) { + SysDept oldSysDept = this.getBaseMapper().selectById(sysDept.getId()); + Asserts.check(oldSysDept == null, "主键为 %s 的部门信息不存在", sysDept.getId()); + SysDept sysDeptEntity = BeanUtil.copyProperties(sysDept, SysDept.class); + String lowerCase = ChineseCharacterUtil.getLowerCase(sysDept.getOrgName(), false); + sysDeptEntity.setBmpyszm(lowerCase); + UserInfo userInfo = UserInfoManager.get(); + sysDeptEntity.setXtZxbz(DeletedEnum.NATURE.code); + sysDeptEntity.setXtZhxgsj(new Date()); + sysDeptEntity.setXtLrip(ipAddress); + sysDeptEntity.setXtZhxgid(userInfo.getUserId()); + sysDeptEntity.setXtZhxgrxm(userInfo.getUserName()); + sysDeptEntity.setXtZhxgrbmid(userInfo.getDeptId()); + sysDeptEntity.setXtZhxgrbm(userInfo.getDeptName()); + this.updateById(sysDeptEntity); + + } + + @Override + @JwtSysUser + public void delete(DeleteDeptVO deleteDeptVO, String ipAddress, UserInfo userInfo) { + SysDept oldSysDept = this.getBaseMapper().selectById(deleteDeptVO.getId()); + Asserts.check(oldSysDept == null, "主键为 %s 的部门信息不存在", deleteDeptVO.getId()); + //判断部门角色表 + List userDepts = sysUserDeptService.listByDeptId(deleteDeptVO.getId()); + Asserts.check(!CollectionUtils.isEmpty(userDepts), "主键为 %s 的部门含有关联角色,请解绑", deleteDeptVO.getId()); + //判断部门用户表 + List roleDepts = sysRoleDeptService.listByDeptId(deleteDeptVO.getId()); + Asserts.check(!CollectionUtils.isEmpty(roleDepts), "主键为 %s 的部门含有关联用户,请解绑", deleteDeptVO.getId()); + oldSysDept.setXtZxbz(DeletedEnum.NATURE.code); + oldSysDept.setXtZhxgsj(new Date()); + oldSysDept.setXtLrip(ipAddress); + oldSysDept.setXtZhxgid(userInfo.getUserId()); + oldSysDept.setXtZhxgrxm(userInfo.getUserName()); + oldSysDept.setXtZhxgrbmid(userInfo.getDeptId()); + oldSysDept.setXtZhxgrbm(userInfo.getDeptName()); + oldSysDept.setXtZxbz(1); + oldSysDept.setXtZxyy(deleteDeptVO.getXtZxyy()); + this.updateById(oldSysDept); + } + + @Override + public IPage selectUserPageByDept(UserByDeptPage userByDeptPage) { + return sysDeptMapper.selectUserPageByDept(userByDeptPage); + } + + @Override + public IPage selectRolePageByDept(RoleByDeptPage roleByDeptPage) { + return sysDeptMapper.selectRolePageByDept(roleByDeptPage); + } + + @Override + public void saveRoleDeptInfo(AddRoleDeptVO roleDeptVO) { + SysDept dept = this.getById(roleDeptVO.getDeptId()); + Asserts.check(dept == null, "主键为 %s 的部门信息不存在", roleDeptVO.getDeptId()); + List sysRoleDeptList = new ArrayList<>(); + List roleIds = roleDeptVO.getRoleIds(); + roleIds.forEach(roleId -> { + SysRole role = sysRoleService.getById(roleId); + Asserts.check(role == null, "主键为 %s 的角色信息不存在", roleDeptVO.getDeptId()); + SysRoleDept sysRoleDept = new SysRoleDept(); + sysRoleDept.setDeptId(roleDeptVO.getDeptId()); + sysRoleDept.setRoleId(roleId); + sysRoleDeptList.add(sysRoleDept); + }); + sysRoleDeptService.remove(new LambdaQueryWrapper().eq(SysRoleDept::getDeptId, roleDeptVO.getDeptId())); + sysRoleDeptService.saveBatch(sysRoleDeptList); + } + + @Override + public void saveUserDeptInfo(AddUserDeptVO addUserDeptVO) { + SysUser user = sysUserService.getById(addUserDeptVO.getUserId()); + Asserts.check(user == null, "主键为 %s 的用户信息不存在", addUserDeptVO.getUserId()); + SysDept dept = this.getById(addUserDeptVO.getDeptId()); + Asserts.check(dept == null, "主键为 %s 的部门信息不存在", addUserDeptVO.getDeptId()); + SysUserDept userDept = sysUserDeptService.getByDeptIdAndUserId(addUserDeptVO.getDeptId(), addUserDeptVO.getUserId()); + Asserts.check(userDept != null, "该部门已经含有当前用户"); + SysUserDept sysUserDept = BeanUtil.copyProperties(addUserDeptVO, SysUserDept.class); + sysUserDeptService.save(sysUserDept); + } + + @Override + public void deleteUserDeptInfo(DeleteUserDeptVO deleteUserDeptVO) { + sysUserDeptService.remove(new LambdaQueryWrapper().eq(SysUserDept::getDeptId, deleteUserDeptVO.getDeptId()) + .in(SysUserDept::getUserId, deleteUserDeptVO.getUserIds())); + } + + @Override + public List getAllChildDeptIds(Long deptId) { + List ids = new ArrayList<>(); + wrapChildIdList(deptId, ids); + return ids; + } + + + private void wrapChildIdList(Long id, List ids) { + List list = this.list(new LambdaQueryWrapper().eq(SysDept::getParentId, id).eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code)); + + if (CollectionUtils.isNotEmpty(list)) { + List deptIds = list.stream().map(SysDept::getId).collect(Collectors.toList()); + ids.addAll(deptIds); + list.forEach(dept -> wrapChildIdList(dept.getId(), ids)); + } + } + + /** + * 递归查询子部门集合 + * + * @param sysDeptVO 当前部门信息 + * @param natureList 所有部门信息 + */ + private void wrapChildList(SysDeptVO sysDeptVO, List natureList) { + Long rootId = sysDeptVO.getId(); + List collect = natureList.stream().filter(dept -> rootId.equals(dept.getParentId())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + sysDeptVO.setChildDeptList(collect); + } + if (CollectionUtils.isNotEmpty(collect)) { + collect.forEach(dept -> wrapChildList(dept, natureList)); + } + } + + @Override + public SysDept getDeptByOrgCode(String orgCode) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(SysDept::getOrgCode, orgCode).eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code); + return sysDeptMapper.selectOne(lambdaQueryWrapper); + } + + @Override + public Boolean deptSys() { + Map params = new HashMap<>(); + String rs = HttpUtils.executeGet(DEPT_URL, params); + JSONObject json = JSONObject.parseObject(rs); + if (json.getBoolean("success")) { + JSONArray array = json.getJSONArray("data"); + if (CollectionUtils.isNotEmpty(array)) { + for (int i = 0; i < array.size(); i++) { + JSONObject deptJson = array.getJSONObject(i); + String orgCode = deptJson.getString("jurisdictionCode"); + if (orgCode.startsWith("511421")) { + String xtLrsj = deptJson.getString("createTime"); + xtLrsj = xtLrsj.replace("T", " "); + String xtZhxgsj = deptJson.getString("lastModifiedTime"); + xtZhxgsj = xtZhxgsj.replace("T", " "); + Integer xtZxbz = DeletedEnum.NATURE.code; + if (!"1".equals(deptJson.getString("zt"))) { + xtZxbz = DeletedEnum.DELETED.code; + } + SysDept sysDept = getDeptByOrgCode(orgCode); + if (sysDept == null) { + sysDept = new SysDept(); + } + sysDept.setOrgCode(deptJson.getString("jurisdictionCode")); + sysDept.setOrgName(deptJson.getString("jurisdictionName")); +// String orgJc = deptJson.getString("jurisdictionName").replace("四川省眉山市", ""); +// sysDept.setOrgJc(orgJc); + sysDept.setXtCjsj(new Date()); + sysDept.setXtLrsj(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, xtLrsj)); + sysDept.setXtZhxgsj(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, xtZhxgsj)); + sysDept.setXzqh("511421"); + sysDept.setXtZxbz(xtZxbz); + if (sysDept.getId() == null) { + String rootPath = ""; + String lowerCase = ChineseCharacterUtil.getLowerCase(sysDept.getOrgName(), false); + sysDept.setBmpyszm(lowerCase); + this.save(sysDept); + JSONObject parent = deptJson.getJSONObject("parent"); + if (Objects.nonNull(parent)) { + String parentOrgCode = parent.getString("jurisdictionCode"); + if (parentOrgCode.startsWith("511421")) { + SysDept dept = getDeptByOrgCode(parentOrgCode); + Asserts.check(dept == null, "传入的父CODE对应的部门信息不存在"); + rootPath = dept.getRootPath().endsWith("_") ? + (dept.getRootPath() + sysDept.getId()) : (dept.getRootPath() + "_" + sysDept.getId()); + } + } else { + rootPath = sysDept.getId() + "_"; + } + sysDept.setRootPath(rootPath); + sysDeptMapper.updateById(sysDept); + } else { + sysDept.setXtZxbz(DeletedEnum.NATURE.code); + sysDeptMapper.updateById(sysDept); + } + } + } + } + } + return true; + } + + @Override + public IPage getDeptList(DeptPage deptPage) { + if (StringUtils.isBlank(deptPage.getOrgCode())) { + throw new BusinessException("orgCode不能为null"); + } + deptPage.setOrgCode(deptPage.getOrgCode()); + IPage iPage = getDept(deptPage); + if (CollectionUtils.isNotEmpty(iPage.getRecords())) { + List records = iPage.getRecords(); + records.forEach(this::wrapChildList); + iPage.setRecords(records); + } + return iPage; + } + + @Override + public List getChildDept(String deptid) { + SysDept dept = this.baseMapper.selectById(deptid); + List deptIds = new ArrayList<>(); + this.getChildList(dept, deptIds); + return deptIds; + } + + @Override + public List getChildDeptByOrgCode(String orgcode) { + SysDept dept = this.baseMapper.selectOne( + new LambdaQueryWrapper() + .eq(SysDept::getXtZxbz, "0") + .eq(SysDept::getOrgCode, orgcode) + ); + List orgcodes = new ArrayList<>(); + this.getChildListByOrgcode(dept, orgcodes); + return orgcodes; + } + + @Override + public DeptAllVo getOrgByDeptId(String deptid) { + DeptAllVo vo = new DeptAllVo(); + SysDept dept = this.baseMapper.selectById(deptid); + if (dept != null) { + vo.setOrgType(dept.getOrgType()); + vo.setOrgLevel(dept.getOrgLevel()); + vo.setOrgBizType(dept.getOrgBizType()); + String rootPath = dept.getRootPath(); + // 省厅 + if (dept.getParentId() == 0) { + this.setDept(vo, dept); + return vo; + } + if (rootPath != null) { + String[] paths = rootPath.split("_"); + this.setDept(vo, dept); + SysDept dept1 = this.baseMapper.selectById(paths[1]); + this.setDsz(vo, dept1); + if (paths.length == 2 || paths.length == 3) { + this.setFxj(vo, dept); + } else if (paths.length >= 4) { + SysDept dept2 = this.baseMapper.selectById(paths[2]); + this.setFxj(vo, dept2); + } + } + } + return vo; + } + + + // 设置分县局 + private void setFxj(DeptAllVo vo, SysDept dept) { + if (dept != null) { + vo.setFxjid(dept.getId()); + vo.setFxjcode(dept.getOrgCode()); + vo.setFxjname(dept.getOrgName()); + } + } + + // 设置地市州 + private void setDsz(DeptAllVo vo, SysDept dept) { + if (dept != null) { + vo.setDszid(dept.getId()); + vo.setDszcode(dept.getOrgCode()); + vo.setDszname(dept.getOrgName()); + } + } + + // 设置所属单位 + private void setDept(DeptAllVo vo, SysDept dept) { + if (dept != null) { + vo.setDeptid(dept.getId()); + vo.setDeptcode(dept.getOrgCode()); + vo.setDeptname(dept.getOrgName()); + } + } + + private void getChildListByOrgcode(SysDept dept, List orgcodes) { + orgcodes.add(String.valueOf(dept.getOrgCode())); + List tempList1 = this.baseMapper.selectList( + new LambdaQueryWrapper() + .eq(SysDept::getParentId, dept.getId()) + ); + if (tempList1.size() > 0) { + orgcodes.addAll(tempList1.stream().map(SysDept::getOrgCode).collect(Collectors.toList())); + tempList1.forEach(item -> this.getChildListByOrgcode(item, orgcodes)); + } + } + + private void getChildList(SysDept dept, List deptIds) { + deptIds.add(String.valueOf(dept.getId())); + List tempList1 = this.baseMapper.selectList( + new LambdaQueryWrapper() + .eq(SysDept::getParentId, dept.getId()) + ); + if (tempList1.size() > 0) { + deptIds.addAll(tempList1.stream().map(item -> String.valueOf(item.getId())).collect(Collectors.toList())); + tempList1.forEach(item -> this.getChildList(item, deptIds)); + } + } + + public List getDeptUser(Long deptId) { + List userIds = new ArrayList<>(); + List childDepts = getChildDept(String.valueOf(deptId)); + System.out.println("childDepts--->" + JSONArray.toJSONString(childDepts)); + List deptUsers = sysUserDeptService.listByDeptIds(childDepts); + System.out.println("deptUsers---->" + JSONArray.toJSONString(deptUsers)); + if (CollectionUtils.isNotEmpty(deptUsers)) { + deptUsers.forEach(item -> { + userIds.add(item.getUserId()); + }); + } + return userIds; + } + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..60e30f3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.java @@ -0,0 +1,191 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.base.constant.Constants; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysLogininfor; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.SysUserDept; +import com.mosty.common.core.business.entity.request.LoginLogPage; +import com.mosty.common.core.business.entity.vo.DeptVo; +import com.mosty.common.core.business.mapper.SysDeptMapper; +import com.mosty.common.core.business.mapper.SysLogininforMapper; +import com.mosty.common.core.business.mapper.SysUserDeptMapper; +import com.mosty.common.core.business.service.SysLogininforService; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import com.mosty.common.util.PermissionsUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * @author li + * @description 针对表【sys_logininfor(系统访问记录)】的数据库操作Service实现 + * @createDate 2022-03-20 15:01:16 + */ +@Service +public class SysLogininforServiceImpl extends ServiceImpl + implements SysLogininforService { + @Resource + private SysLogininforMapper sysLogininforMapper; + @Resource + private SysDeptMapper sysDeptMapper; + @Resource + private SysUserDeptMapper sysUserDeptMapper; + + @Override + public void recordLogininfor(SysUser user, String status, String message, HttpServletRequest request, String type) { + UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent")); + + // 获取客户端操作系统 + String os = userAgent.getOs().getName() == null ? "未知" : userAgent.getOs().getName(); + // 获取客户端浏览器 + String browser = userAgent.getBrowser().getName() == null ? "未知" : userAgent.getBrowser().getName(); + // 封装对象 + SysLogininfor logininfor = new SysLogininfor(); + try { + String ipAddress = IpUtil.getIpAddress(request); + logininfor.setIpaddr(ipAddress); + }catch (Exception e){ + log.error("IP获取异常"+e.getMessage()); + } + logininfor.setUserName(user.getUserName()); + logininfor.setBrowser(browser); + logininfor.setOs(os); + logininfor.setMsg(message); + logininfor.setType(type); + logininfor.setAccessTime(LocalDateTime.now()); + logininfor.setUserId(String.valueOf(user.getId())); + logininfor.setSfzh(user.getIdEntityCard()); + // 日志状态 + if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { + logininfor.setStatus(Constants.SUCCESS); + } else if (Constants.LOGIN_FAIL.equals(status)) { + logininfor.setStatus(Constants.FAIL); + } + DeptVo dept = this.getDeptInfoByUserId(String.valueOf(user.getId())); + logininfor.setSsbm(dept.getDeptname()); + logininfor.setSsbmid(dept.getDeptid()); + logininfor.setSsbmdm(dept.getDeptcode()); + logininfor.setSsxgajdm(dept.getFxjcode()); + logininfor.setSsxgajid(dept.getFxjid()); + logininfor.setSsxgaj(dept.getFxjname()); + logininfor.setSssgaj(dept.getDszname()); + logininfor.setSssgajdm(dept.getDszcode()); + logininfor.setSssgajid(dept.getDszid()); + + // 插入数据 + this.save(logininfor); + } + + public DeptVo getDeptInfoByUserId(String userId) { + SysUserDept sysUserDept = this.sysUserDeptMapper.selectOne( + new QueryWrapper() + .eq("user_id", String.valueOf(userId)) + .last(" limit 1") + ); + if (sysUserDept != null) { + SysDept sysDept = this.sysDeptMapper.selectById(sysUserDept.getDeptId()); + if (sysDept != null) { + return this.getOrgByDeptId(String.valueOf(sysDept.getId())); + } + } + return null; + } + + public DeptVo getOrgByDeptId(String deptid) { + DeptVo vo = new DeptVo(); + SysDept dept = this.sysDeptMapper.selectById(deptid); + if (dept != null) { + vo.setOrgType(dept.getOrgType()); + vo.setOrgLevel(dept.getOrgLevel()); + String rootPath = dept.getRootPath(); + if (rootPath != null) { + String[] paths = rootPath.split("_"); + if (paths.length == 2) { + this.setDept(vo, dept); + this.setDsz(vo, dept); + } else if (paths.length == 3) { + this.setDept(vo, dept); + this.setFxj(vo, dept); + SysDept dsz = this.sysDeptMapper.selectById(paths[1]); + this.setDsz(vo, dsz); + } else if (paths.length >= 4) { + this.setDept(vo, dept); + SysDept fxj = this.sysDeptMapper.selectById(paths[2]); + this.setFxj(vo, fxj); + SysDept dsz = this.sysDeptMapper.selectById(paths[1]); + this.setDsz(vo, dsz); + } + } + } + return vo; + } + + // 设置所属单位 + private void setDept(DeptVo vo, SysDept dept) { + if (dept != null) { + vo.setDeptid(String.valueOf(dept.getId())); + vo.setDeptcode(dept.getOrgCode()); + vo.setDeptname(dept.getOrgName()); + } + } + + // 设置分县局 + private void setFxj(DeptVo vo, SysDept dept) { + if (dept != null) { + vo.setFxjid(String.valueOf(dept.getId())); + vo.setFxjcode(dept.getOrgCode()); + vo.setFxjname(dept.getOrgName()); + } + } + + // 设置地市州 + private void setDsz(DeptVo vo, SysDept dept) { + if (dept != null) { + vo.setDszid(String.valueOf(dept.getId())); + vo.setDszcode(dept.getOrgCode()); + vo.setDszname(dept.getOrgName()); + } + } + + @Override + public void deleteOperLogByIds(List ids) { + sysLogininforMapper.delete(new LambdaQueryWrapper().in(SysLogininfor::getInfoId, ids)); + } + + @Override + public void cleanOperLog() { + sysLogininforMapper.cleanOperLog(); + } + + @Override + public IPage selectByPage(LoginLogPage dto) { + QueryWrapper qw = new QueryWrapper<>(); + UserInfo user = UserInfoManager.get(); + PermissionsUtil.queryWrapperUtil(qw, user); + qw.lambda().like(StringUtils.isNotBlank(dto.getUserName()), SysLogininfor::getUserName, dto.getUserName()) + .eq(Objects.nonNull(dto.getStatus()), SysLogininfor::getStatus, dto.getStatus()); + qw.lambda().orderByDesc(SysLogininfor::getInfoId); + return this.page(dto, qw); + } +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..bf34adb --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,208 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Sets; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.constant.enums.MenuTypeEnum; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.business.entity.vo.AddSysMenuVO; +import com.mosty.common.core.business.entity.vo.MenuPage; +import com.mosty.common.core.business.entity.vo.MenuQuery; +import com.mosty.common.core.business.mapper.SysMenuMapper; +import com.mosty.common.core.business.service.SysMenuService; +import com.mosty.common.core.login.LoginResponseVO; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import lombok.AllArgsConstructor; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Set; + +/** + *

+ * 菜单表 服务实现类 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Service +@AllArgsConstructor +public class SysMenuServiceImpl extends ServiceImpl implements SysMenuService { + + private final SysMenuMapper sysMenuMapper; + + @Override + public IPage selectByPage(MenuPage menuPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(menuPage.getMenuName())) { + queryWrapper.and(wrapper -> wrapper.like("menu_name", menuPage.getMenuName())); + } else { + queryWrapper.and(wrapper -> wrapper.eq("menu_type", MenuTypeEnum.MENU_GROUP.code)); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + IPage iPage = getBaseMapper().selectPage(menuPage, queryWrapper); + List records = iPage.getRecords(); + if (StringUtils.isBlank(menuPage.getMenuName())) { + records.forEach(item -> { + wrapChildList(null, item, null); + }); + } + iPage.setRecords(records); + return iPage; + } + + @Override + public List selectList(MenuQuery menuQuery) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + queryWrapper.and(wrapper -> wrapper.eq("menu_type", MenuTypeEnum.MENU_GROUP.code)); + List list = getBaseMapper().selectList(queryWrapper); + list.forEach(item -> { + wrapChildList(null, item, null); + }); + return list; + } + + private void wrapChildList(Set menuIds, SysMenu item, Set menuCodeSet) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper() + .eq(SysMenu::getParentId, item.getId()).eq(SysMenu::getXtZxbz, DeletedEnum.NATURE.code); + if (CollectionUtils.isNotEmpty(menuIds)) { + lambdaQueryWrapper.in(SysMenu::getId, menuIds); + } + List list = this.list(lambdaQueryWrapper); + if (CollectionUtils.isNotEmpty(list)) { + item.setSysMenuList(list); + list.forEach(menu -> { + if (menuCodeSet != null) { + menuCodeSet.add(menu.getMenuCode()); + } + wrapChildList(menuIds, menu, menuCodeSet); + }); + } + } + + private void wrapChildListByType(Set menuIds, SysMenu item, MenuTypeEnum menuTypeEnum) { + wrapChildListByType(menuIds, item, menuTypeEnum, null); + } + + private void wrapChildListByType(Set menuIds, SysMenu item, MenuTypeEnum menuTypeEnum, Set menuCodeSet) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper() + .eq(SysMenu::getParentId, item.getId()) + .eq(SysMenu::getXtZxbz, DeletedEnum.NATURE.code) + .eq(SysMenu::getMenuType, menuTypeEnum.code); + if (CollectionUtils.isNotEmpty(menuIds)) { + lambdaQueryWrapper.in(SysMenu::getId, menuIds); + } + List list = this.list(lambdaQueryWrapper); + + if (CollectionUtils.isNotEmpty(list)) { + item.setSysMenuList(list); + list.forEach(menu -> { + if (menuCodeSet != null) { + menuCodeSet.add(menu.getMenuCode()); + } + wrapChildList(menuIds, menu, menuCodeSet); + }); + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void addSysMenuInfo(AddSysMenuVO addSysMenuVo, SysMenu parentMenu) { + // 初始化菜单信息 + SysMenu sysMenu = initMenuInfo(addSysMenuVo); + + // 添加菜单信息 + sysMenuMapper.insert(sysMenu); + + SysMenu sysMenuForUpdate = new SysMenu(); + Long id = sysMenu.getId(); + if (parentMenu == null) { + sysMenuForUpdate.setParentPath(id.toString()); + } else { + sysMenuForUpdate.setParentPath(parentMenu.getParentPath() + "_" + id); + } + sysMenuMapper.updateById(sysMenuForUpdate); + } + + @Override + public List listByType(Set menuIds, MenuTypeEnum menuGroup, LoginResponseVO loginResponseVO) { + Set menuCodeSet = Sets.newHashSet(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(SysMenu::getMenuType, menuGroup.code) + .eq(SysMenu::getXtZxbz, DeletedEnum.NATURE.code); + if (CollectionUtils.isNotEmpty(menuIds)) { + queryWrapper.in(SysMenu::getId, menuIds); + } + List list = this.list(queryWrapper); + list.forEach(item -> { + menuCodeSet.add(item.getMenuCode()); + wrapChildListByType(menuIds, item, MenuTypeEnum.MENU, menuCodeSet); + }); + loginResponseVO.setMenuCodeSet(menuCodeSet); + return list; + } + + @Override + public SysMenu getMenuChild(Long menuId) { + SysMenu sysMenu = this.getOne(new LambdaQueryWrapper() + .eq(SysMenu::getId, menuId) + .eq(SysMenu::getXtZxbz, DeletedEnum.NATURE.code)); + wrapChildListByType(null, sysMenu, MenuTypeEnum.MENU); + return sysMenu; + } + + + /** + * 初始化菜单信息 + * + * @param addSysMenuVo 添加菜单请求 + * @return 菜单信息 + */ + private SysMenu initMenuInfo(AddSysMenuVO addSysMenuVo) { + SysMenu sysMenu = new SysMenu(); + sysMenu.setParentId(addSysMenuVo.getParentId()); + sysMenu.setMenuName(addSysMenuVo.getMenuName()); + sysMenu.setMenuCode(addSysMenuVo.getMenuCode()); + sysMenu.setMenuUrl(addSysMenuVo.getMenuUrl()); + sysMenu.setMenuType(addSysMenuVo.getMenuType()); + + sysMenu.setOrderNo(addSysMenuVo.getOrderNo()); + sysMenu.setShowMode(addSysMenuVo.getShowMode()); + sysMenu.setBz(addSysMenuVo.getBz()); + + UserInfo userInfo = UserInfoManager.get(); + sysMenu.setXtZxbz(DeletedEnum.NATURE.code); + + sysMenu.setXtCjsj(new Date()); + sysMenu.setXtZhxgsj(new Date()); + sysMenu.setXtZhxgrid(userInfo.getUserId().toString()); + sysMenu.setXtZhxgrxm(userInfo.getUserName()); + sysMenu.setXtZhxgrbmid(userInfo.getDeptId().toString()); + sysMenu.setXtZhxgrbm(userInfo.getDeptName()); + + sysMenu.setXtLrsj(new Date()); + sysMenu.setXtLrrid(userInfo.getUserId().toString()); + sysMenu.setXtLrrxm(userInfo.getUserName()); + sysMenu.setXtLrrbmid(userInfo.getDeptId().toString()); + sysMenu.setXtLrrbm(userInfo.getDeptName()); + + // 获取ip地址 + String ipAddress = IpUtil.getIpAddress(); + sysMenu.setXtLrip(ipAddress); + sysMenu.setXtZhxgip(ipAddress); + return sysMenu; + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysOssServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysOssServiceImpl.java new file mode 100644 index 0000000..b70bf25 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysOssServiceImpl.java @@ -0,0 +1,29 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.core.business.entity.SysOss; +import com.mosty.common.core.business.mapper.SysOssMapper; +import com.mosty.common.core.business.mapper.SysPositionMapper; +import com.mosty.common.core.business.service.SysOssService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +/** + *

+ * OSS云存储表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-31 + */ +@Service +@AllArgsConstructor +public class SysOssServiceImpl extends ServiceImpl implements SysOssService { + + private final SysOssMapper sysOssMapper; + + @Override + public void saveSysOss(SysOss sysOss) { + sysOssMapper.insert(sysOss); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.java new file mode 100644 index 0000000..a853b0a --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.java @@ -0,0 +1,83 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.config.entity.vo.EditPositionVO; +import com.mosty.common.core.business.entity.SysPosition; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.PositionPage; +import com.mosty.common.core.business.mapper.SysPositionMapper; +import com.mosty.common.core.business.mapper.SysUserMapper; +import com.mosty.common.core.business.service.SysPositionService; +import com.mosty.common.core.business.service.SysUserService; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + *

+ * 岗位表 服务实现类 + *

+ * + * @author kevin + * @since 2022-02-12 + */ +@Slf4j +@Service +@AllArgsConstructor +public class SysPositionServiceImpl extends ServiceImpl implements SysPositionService { + + private final SysUserService sysUserService; + private final SysPositionMapper sysPositionMapper; + + @Override + public IPage selectByPage(PositionPage page) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(page.getPositionName())) { + queryWrapper.and(wrapper -> wrapper.like("post_name", page.getPositionName())); + } + if (StringUtils.isNotBlank(page.getPositionCode())) { + queryWrapper.and(wrapper -> wrapper.eq("post_code", page.getPositionCode())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + queryWrapper.orderByDesc("xt_zhxgsj"); + return getBaseMapper().selectPage(page, queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateSysPost(SysPosition oldSysPosition, EditPositionVO editPositionVO) { + // 当岗位名称变更,去修改用户表中的岗位名称 + if (!oldSysPosition.getPostName().equals(editPositionVO.getPostName())) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("position_id", oldSysPosition.getId()) + .set("position_name", editPositionVO.getPostName()); + boolean update = sysUserService.update(updateWrapper); + log.info("岗位名称发送变更后,修改了用户表的{}条岗位名称数据", update); + } + oldSysPosition.setBz(editPositionVO.getBz()); + oldSysPosition.setPostCode(editPositionVO.getPostCode()); + oldSysPosition.setPostName(editPositionVO.getPostName()); + oldSysPosition.setPostDesc(editPositionVO.getPostDesc()); + + UserInfo userInfo = UserInfoManager.get(); + + oldSysPosition.setXtZhxgsj(new Date()); + oldSysPosition.setXtZhxgrid(userInfo.getUserId().toString()); + oldSysPosition.setXtZhxgrxm(userInfo.getUserName()); + oldSysPosition.setXtZhxgrbmid(userInfo.getDeptId().toString()); + oldSysPosition.setXtZhxgrbm(userInfo.getDeptName()); + + sysPositionMapper.updateById(oldSysPosition); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.java new file mode 100644 index 0000000..434d374 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.java @@ -0,0 +1,38 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.core.business.entity.SysRoleDept; +import com.mosty.common.core.business.service.SysRoleDeptService; +import com.mosty.common.core.business.mapper.SysRoleDeptMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author li +* @description 针对表【sys_role_dept(角色和部门关联表)】的数据库操作Service实现 +* @createDate 2022-02-12 16:53:15 +*/ +@Service +public class SysRoleDeptServiceImpl extends ServiceImpl + implements SysRoleDeptService { + + @Override + public List listByDeptId(Long deptId) { + List list = this.list(new LambdaQueryWrapper() + .eq(SysRoleDept::getDeptId, deptId)); + return list; + } + + @Override + public SysRoleDept getByDeptIdAndRoleId(Long deptId, Long roleId) { + SysRoleDept one = this.getOne(new LambdaQueryWrapper() + .eq(SysRoleDept::getDeptId, deptId).eq(SysRoleDept::getRoleId, roleId)); + return one; + } +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.java new file mode 100644 index 0000000..502e8ca --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.java @@ -0,0 +1,42 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.core.business.entity.SysRoleMenu; +import com.mosty.common.core.business.service.SysRoleMenuService; +import com.mosty.common.core.business.mapper.SysRoleMenuMapper; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** +* @author li +* @description 针对表【sys_role_menu(角色和菜单关联表)】的数据库操作Service实现 +* @createDate 2022-02-12 16:53:18 +*/ +@Service +@AllArgsConstructor +public class SysRoleMenuServiceImpl extends ServiceImpl implements SysRoleMenuService { + + @Override + public List listByRoleIds(Set rolesSet) { + List list = this.list(new LambdaQueryWrapper().in(SysRoleMenu::getRoleId, rolesSet)); + return list; + } + + @Override + public Set listByMenuId(Long menuId) { + List list = this.list(new LambdaQueryWrapper().in(SysRoleMenu::getMenuId, menuId)); + if (!list.isEmpty()){ + return list.stream().map(SysRoleMenu::getRoleId).collect(Collectors.toSet()); + } + return null; + } +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..f0a655c --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,292 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.constant.enums.PermissionLevelEnum; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.mapper.SysDeptMapper; +import com.mosty.common.core.business.mapper.SysRoleDeptMapper; +import com.mosty.common.core.business.mapper.SysRoleMapper; +import com.mosty.common.core.business.mapper.SysUserRoleMapper; +import com.mosty.common.core.business.service.*; +import com.mosty.common.token.DeptInfo; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author li + * @description 针对表【sys_role(角色表)】的数据库操作Service实现 + * @createDate 2022-02-12 16:53:11 + */ +@Service +public class SysRoleServiceImpl extends ServiceImpl implements SysRoleService { + @Resource + private SysUserRoleService sysUserRoleService; + @Resource + private SysRoleMenuService sysRoleMenuService; + @Resource + private SysMenuService sysMenuService; + @Resource + private SysUserRoleMapper sysUserRoleMapper; + @Resource + private SysRoleDeptMapper sysRoleDeptMapper; + @Resource + private SysDeptMapper sysDeptMapper; + @Resource + private SysDeptService sysDeptService; + + + @Override + public DeptInfo getSysDeptLevel(String orgCode) { + DeptInfo deptInfo = new DeptInfo(); + SysDept sysDept = sysDeptMapper.selectOne(new QueryWrapper().eq("org_code", orgCode).eq("xt_zxbz", 0)); + if (sysDept != null) { + deptInfo.setSsbmid(sysDept.getId()); + deptInfo.setSsbmdm(sysDept.getOrgCode()); + deptInfo.setSsbm(sysDept.getOrgName()); + //获取地市州 + SysDept dszDept = getDszDept(sysDept); + if (dszDept != null) { + deptInfo.setSssgajid(dszDept.getId()); + deptInfo.setSssgajdm(dszDept.getOrgCode()); + deptInfo.setSssgaj(dszDept.getOrgName()); + } + //获取分县局 + SysDept fxjDept = getFxjDept(sysDept); + if (fxjDept != null) { + deptInfo.setSsxgajid(fxjDept.getId()); + deptInfo.setSsxgajdm(fxjDept.getOrgCode()); + deptInfo.setSsxgaj(fxjDept.getOrgName()); + } + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("dept_id", sysDept.getId()); + List list = sysRoleDeptMapper.selectList(queryWrapper); + if (CollectionUtil.isEmpty(list)) { + return deptInfo; + } + List roleList = list.stream().map(SysRoleDept::getRoleId).collect(Collectors.toList()); + Collection sysRoles = super.listByIds(roleList); + List collect = sysRoles.stream().filter(role -> DeletedEnum.NATURE.code.equals(role.getXtZxbz())) + .map(role -> BeanUtil.copyProperties(role, SysRoleVO.class)) + .sorted(Comparator.comparing(SysRoleVO::getDataPermissionLevel)) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + deptInfo.setPermissionsLevel(collect.get(0).getDataPermissionLevel()); + if (deptInfo.getPermissionsLevel().equals("5")) { + // 本部门以及下级部门权限 + // 查询下级部门 + List childDeptIds = sysDeptService.getAllChildDeptIds(sysDept.getId()); + List collect1 = childDeptIds.stream().map(String::valueOf).collect(Collectors.toList()); + collect1.add(String.valueOf(sysDept.getId())); + deptInfo.setIds(String.join(",", collect1)); + } + } + } + return deptInfo; + } + + + // 根据当前地市州 + public SysDept getDszDept(SysDept sysDept) { + if (sysDept == null) { + return null; + } + long id; + String path = sysDept.getRootPath(); + if (path.contains("_")) { + String[] paths = path.split("_"); + id = Long.parseLong(paths[1]); + } else { + id = Long.parseLong(path); + } + return sysDeptService.getById(id); + } + + // 根据当前部门获取分县局部门 + public SysDept getFxjDept(SysDept sysDept) { + if (sysDept == null) { + return null; + } + Long id = null; + String path = sysDept.getRootPath(); + if (path.contains("_")) { + String[] paths = path.split("_"); + if (paths.length == 2) { + id = Long.valueOf(paths[1]); + } else if (paths.length == 3) { + id = Long.valueOf(paths[2]); + } else if (paths.length >= 4) { + id = Long.valueOf(paths[2]); + } + } else { + id = Long.valueOf(path); + } + return sysDeptService.getById(id); + } + + @Override + public IPage selectByPage(RolePage rolePage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(rolePage.getRoleName())) { + queryWrapper.and(wrapper -> wrapper.like("role_name", rolePage.getRoleName())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + return getBaseMapper().selectPage(rolePage, queryWrapper); + } + + @Override + public List getUserRoleList(Long userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id", String.valueOf(userId)); + List list = sysUserRoleService.list(queryWrapper); + if (CollectionUtil.isEmpty(list)) { + return Lists.newArrayList(); + } + + List roleList = list.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()); + Collection sysRoles = super.listByIds(roleList); + + return sysRoles.stream().filter(role -> DeletedEnum.NATURE.code.equals(role.getXtZxbz())) + .map(role -> BeanUtil.copyProperties(role, SysRoleVO.class)) + .collect(Collectors.toList()); + } + + @Override + public void insertRole(AddRoleVO addRoleVo, String ipAddress) { + SysRole sysRole = BeanUtil.copyProperties(addRoleVo, SysRole.class); + + UserInfo userInfo = UserInfoManager.get(); + sysRole.setXtZxbz(DeletedEnum.NATURE.code); + + sysRole.setXtCjsj(new Date()); + sysRole.setXtZhxgsj(new Date()); + sysRole.setXtZhxgrid(userInfo.getUserId().toString()); + sysRole.setXtZhxgrxm(userInfo.getUserName()); + sysRole.setXtZhxgrbmid(userInfo.getDeptId().toString()); + sysRole.setXtZhxgrbm(userInfo.getDeptName()); + + sysRole.setXtLrsj(new Date()); + sysRole.setXtLrrid(userInfo.getUserId().toString()); + sysRole.setXtLrrxm(userInfo.getUserName()); + sysRole.setXtLrrbmid(userInfo.getDeptId().toString()); + sysRole.setXtLrrbm(userInfo.getDeptName()); + + sysRole.setXtZhxgip(ipAddress); + sysRole.setXtLrip(ipAddress); + + this.save(sysRole); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveRoleMenuInfo(AddRoleMenuVO roleMenuVO) { + // 先删除已绑定的菜单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("role_id", roleMenuVO.getRoleId()); + sysRoleMenuService.remove(queryWrapper); + + List list = new ArrayList<>(); + List menuIds = roleMenuVO.getMenuIds(); + menuIds.forEach(item -> { + SysRoleMenu sysRoleMenu = new SysRoleMenu(); + sysRoleMenu.setRoleId(roleMenuVO.getRoleId()); + sysRoleMenu.setMenuId(item); + list.add(sysRoleMenu); + }); + sysRoleMenuService.saveBatch(list); + } + + @Override + public void saveDataPermission(AddRoleDataPartitionVO addRoleDataPartitionVO, String ipAddress) { + UserInfo userInfo = UserInfoManager.get(); + SysRole sysRole = new SysRole(); + sysRole.setId(addRoleDataPartitionVO.getId()); + sysRole.setDataPermissionLevel(addRoleDataPartitionVO.getDataPermissionLevel()); + sysRole.setXtZhxgsj(new Date()); + sysRole.setXtZhxgrid(userInfo.getUserId().toString()); + sysRole.setXtZhxgrxm(userInfo.getUserName()); + sysRole.setXtZhxgrbmid(userInfo.getDeptId().toString()); + sysRole.setXtZhxgrbm(userInfo.getDeptName()); + sysRole.setXtZhxgip(ipAddress); + sysRole.setXtLrip(ipAddress); + + this.updateById(sysRole); + } + + @Override + public DataPermissionVO getDataPermission(String menuUrl) { + UserInfo userInfo = UserInfoManager.get(); + DataPermissionVO vo = new DataPermissionVO(); + SysMenu menu = sysMenuService.getOne(new LambdaQueryWrapper() + .eq(SysMenu::getMenuUrl, menuUrl).eq(SysMenu::getXtZxbz, DeletedEnum.NATURE.code)); + Set roleIds = sysRoleMenuService.listByMenuId(menu.getId()); + if (CollectionUtils.isNotEmpty(roleIds)) { + SysRole sysRole = this.list(new LambdaQueryWrapper() + .in(SysRole::getId, roleIds).orderByAsc(SysRole::getDataPermissionLevel)).get(0); + vo.setPermissionLevel(sysRole.getDataPermissionLevel()); + if (PermissionLevelEnum.DEPT_AND_CHILD.level.equals(sysRole.getDataPermissionLevel())) { + List deptIds = sysDeptService.getAllChildDeptIds(userInfo.getDeptId()); + vo.setDeptIds(deptIds); + } + } else { + vo.setPermissionLevel(PermissionLevelEnum.ALL.level.toString()); + } + + return vo; + } + + @Override + public IPage selectUnAccreditPage(RolePage rolePage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(rolePage.getRoleName())) { + queryWrapper.and(wrapper -> wrapper.like("role_name", rolePage.getRoleName())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + QueryWrapper sysUserRoleQueryWrapper = new QueryWrapper<>(); + sysUserRoleQueryWrapper.and(wrapper -> wrapper.eq("user_id", rolePage.getUserId())); + List list = sysUserRoleService.list(sysUserRoleQueryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + List roleList = list.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()); + queryWrapper.and(wrapper -> wrapper.notIn("id", roleList)); + } + return getBaseMapper().selectPage(rolePage, queryWrapper); + } + + @Override + public IPage getRoleUserList(GetUserRoleListVo vo) { + List roleUserList = sysUserRoleMapper.getRoleUserList(vo); + Page page = BeanUtil.copyProperties(roleUserList, Page.class); + page.setRecords(roleUserList); + page.setTotal(roleUserList.size()); + return page; + } + + @Override + public List getRoleMenuIds(Long roleId) { + List list = sysRoleMenuService.list(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, roleId)); + return list.stream().map(SysRoleMenu::getMenuId).collect(Collectors.toList()); + } + + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.java new file mode 100644 index 0000000..8971b24 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.java @@ -0,0 +1,175 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlate; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlateList; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigPlateListPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlateListPage; +import com.mosty.common.core.business.mapper.SysUserAppHomeconfigPlateListMapper; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateListService; +import com.mosty.common.token.UserInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + *

+ * 用户app首页配置-板块内容表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service +public class SysUserAppHomeconfigPlateListServiceImpl extends ServiceImpl implements SysUserAppHomeconfigPlateListService { + + @Resource + private SysUserAppHomeconfigPlateListMapper sysUserAppHomeconfigPlateListMapper; + + @Override + public Long saveInfo(SysUserAppHomeconfigPlateList plate, String ipAddress) { + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigPlateListMapper.insert(plate); + return plate.getId(); + } + + @Override + public boolean saveInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + Long pzId = plates.get(0).getPzId(); + Long pzPlateId = plates.get(0).getPzPlateId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("pz_id", pzId)); + queryWrapper.and(wrapper -> wrapper.eq("pz_plate_id", pzPlateId)); + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List list = sysUserAppHomeconfigPlateListMapper.selectList(queryWrapper); + for(SysUserAppHomeconfigPlateList plate : plates) { + boolean bool = isExist(list, plate.getPzId(), plate.getPzPlateId(), plate.getPlateListId()); + if(!bool) { + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.and(wrapper -> wrapper.eq("pz_id", plate.getPzId())); + queryWrapper1.and(wrapper -> wrapper.eq("pz_plate_id", plate.getPzPlateId())); + queryWrapper1.and(wrapper -> wrapper.eq("plate_list_id", plate.getPlateListId())); + SysUserAppHomeconfigPlateList plateList = + sysUserAppHomeconfigPlateListMapper.selectOne(queryWrapper1); + if(plateList != null) { + sysUserAppHomeconfigPlateListMapper.updateById(plateList.getPzId(), plateList.getPzPlateId(), + plateList.getPlateListId(), DeletedEnum.NATURE.code); + } + } + if(!CollectionUtils.isEmpty(list)) { + // list 库中 plateList 参数, + for(SysUserAppHomeconfigPlateList plateList : list) { + boolean bools = isExist(plates, plateList.getPzId(), plateList.getPzPlateId(), + plateList.getPlateListId()); + if(!bools) { + sysUserAppHomeconfigPlateListMapper.updateById(plate.getPzId(), plate.getPzPlateId(), + plate.getPlateListId(), DeletedEnum.DELETED.code); + } + } + } + } + } + return true; + } + + /** + * 判断用户配置板块是否存在 + * @param list + * @param pzid + * @param pzPlateId + * @return + */ + public boolean isExist(List list, Long pzid, Long pzPlateId, Long plateListId) { + if(CollectionUtils.isEmpty(list)) { + return false; + } + for(SysUserAppHomeconfigPlateList plate : list) { + if(plate.getPzId().longValue() == pzid.longValue() && plate.getPzPlateId().longValue() == pzPlateId.longValue() && plate.getPlateListId().longValue() == plateListId.longValue()) { + return true; + } + } + return false; + } + + @Override + public void updateInfo(SysUserAppHomeconfigPlateList plate, String ipAddress) { + SysUserAppHomeconfigPlateList oldConfig = sysUserAppHomeconfigPlateListMapper.selectById(plate.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的信息不存在", oldConfig.getId()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + plate.setXtZhxgsj(new Date()); + plate.setXtLrip(ipAddress); + sysUserAppHomeconfigPlateListMapper.updateById(plate); + } + + @Override + public void updateInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + sysUserAppHomeconfigPlateListMapper.deleteByPzId(plates.get(0).getPzId(), plates.get(0).getPzPlateId()); + for(SysUserAppHomeconfigPlateList plate : plates) { + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigPlateListMapper.insert(plate); + } + } + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if(!CollectionUtils.isEmpty(list)) { + for(Long id : list) { + SysUserAppHomeconfigPlateList plate = sysUserAppHomeconfigPlateListMapper.selectById(id); + if(plate != null) { + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.DELETED.code); + plate.setXtZhxgsj(new Date()); + plate.setXtZhxgip(ipAddress); + if(userInfo != null) { + plate.setXtZhxgrxm(userInfo.getUserName()); + plate.setXtZhxgrbmid(userInfo.getDeptId() + ""); + plate.setXtZhxgrbm(userInfo.getDeptName()); + } + sysUserAppHomeconfigPlateListMapper.updateById(plate); + } + } + } + } + + @Override + public IPage selectByPage(SysUserAppHomeconfigPlateListPage cofigPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (cofigPage.getPzId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("pz_id", cofigPage.getPzId())); + } + if (cofigPage.getPzPlateId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("pz_plate_id", cofigPage.getPzPlateId())); + } + if (cofigPage.getPlateListId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("plate_list_id", cofigPage.getPlateListId())); + } + if (StringUtils.isNotBlank(cofigPage.getNrmc())) { + queryWrapper.and(wrapper -> wrapper.like("nrmc", cofigPage.getNrmc())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + cofigPage.setOrders(orderBy); + return sysUserAppHomeconfigPlateListMapper.selectPage(cofigPage, queryWrapper); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.java new file mode 100644 index 0000000..469fde1 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.java @@ -0,0 +1,176 @@ +package com.mosty.common.core.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysUserAppHomeconfig; +import com.mosty.common.core.business.entity.SysUserAppHomeconfigPlate; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPlatePage; +import com.mosty.common.core.business.mapper.SysUserAppHomeconfigPlateMapper; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateService; +import com.mosty.common.token.UserInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + *

+ * 用户app首页配置-板块表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service +public class SysUserAppHomeconfigPlateServiceImpl extends ServiceImpl implements SysUserAppHomeconfigPlateService { + + @Resource + private SysUserAppHomeconfigPlateMapper sysUserAppHomeconfigPlateMapper; + + @Override + public Long saveInfo(SysUserAppHomeconfigPlate plate, String ipAddress) { + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigPlateMapper.insert(plate); + return plate.getId(); + } + + @Override + public boolean saveInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + Long pzId = plates.get(0).getPzId(); +// sysUserAppHomeconfigPlateMapper.deleteByPzid(pzId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("pz_id", pzId)); + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List list = sysUserAppHomeconfigPlateMapper.selectList(queryWrapper); + for(SysUserAppHomeconfigPlate plate : plates) { + boolean bool = isExist(list, plate.getPzId(), plate.getPlateId()); + + if(!bool) { + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.and(wrapper -> wrapper.eq("pz_id", plate.getPzId())); + queryWrapper1.and(wrapper -> wrapper.eq("plate_id", plate.getPlateId())); + SysUserAppHomeconfigPlate userPlate = + sysUserAppHomeconfigPlateMapper.selectOne(queryWrapper1); +// plate.setXtCjsj(new Date()); +// plate.setXtLrip(ipAddress); +// plate.setXtLrsj(new Date()); +// plate.setXtZhxgsj(new Date()); +// plate.setXtZxbz(DeletedEnum.NATURE.code); +// sysUserAppHomeconfigPlateMapper.insert(plate); + sysUserAppHomeconfigPlateMapper.updateById(userPlate.getId(), 0); + } + } + if(!CollectionUtils.isEmpty(list)) { + for(SysUserAppHomeconfigPlate plate : list) { + boolean bool = isExist(plates, plate.getPzId(), plate.getPlateId()); + if(!bool) { + sysUserAppHomeconfigPlateMapper.updateById(plate.getId(), 1); + } + } + } + + } + return true; + } + + @Override + public void updateInfo(SysUserAppHomeconfigPlate plate, String ipAddress) { + SysUserAppHomeconfigPlate oldConfig = sysUserAppHomeconfigPlateMapper.selectById(plate.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的信息不存在", oldConfig.getId()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + plate.setXtZhxgsj(new Date()); + plate.setXtLrip(ipAddress); + sysUserAppHomeconfigPlateMapper.updateById(plate); + } + + @Override + public void updateInfoBatch(List plates, String ipAddress) { + if(!CollectionUtils.isEmpty(plates)) { + Long pzid = plates.get(0).getPzId(); + sysUserAppHomeconfigPlateMapper.deleteByPzid(pzid); + for(SysUserAppHomeconfigPlate plate : plates) { + plate.setXtCjsj(new Date()); + plate.setXtLrip(ipAddress); + plate.setXtLrsj(new Date()); + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigPlateMapper.insert(plate); + } + } + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if(!CollectionUtils.isEmpty(list)) { + for(Long id : list) { + SysUserAppHomeconfigPlate plate = sysUserAppHomeconfigPlateMapper.selectById(id); + if(plate != null) { + plate.setXtZhxgsj(new Date()); + plate.setXtZxbz(DeletedEnum.DELETED.code); + plate.setXtZhxgsj(new Date()); + plate.setXtZhxgip(ipAddress); + if(userInfo != null) { + plate.setXtZhxgrxm(userInfo.getUserName()); + plate.setXtZhxgrbmid(userInfo.getDeptId() + ""); + plate.setXtZhxgrbm(userInfo.getDeptName()); + } + sysUserAppHomeconfigPlateMapper.updateById(plate); + } + } + } + } + + @Override + public IPage selectByPage(SysUserAppHomeconfigPlatePage platePage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (platePage.getPzId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("pz_id", platePage.getPzId())); + } + if (platePage.getPlateId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("plate_id", platePage.getPlateId())); + } + if (StringUtils.isNotBlank(platePage.getBklx())) { + queryWrapper.and(wrapper -> wrapper.eq("bklx", platePage.getBklx())); + } + if (StringUtils.isNotBlank(platePage.getBkmc())) { + queryWrapper.and(wrapper -> wrapper.like("bkmc", platePage.getBkmc())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + platePage.setOrders(orderBy); + return sysUserAppHomeconfigPlateMapper.selectPage(platePage, queryWrapper); + } + + /** + * 判断用户配置板块是否存在 + * @param list + * @param pzid + * @param plateId + * @return + */ + public boolean isExist(List list, Long pzid, Long plateId) { + if(CollectionUtils.isEmpty(list)) { + return false; + } + for(SysUserAppHomeconfigPlate plate : list) { + if(plate.getPzId().longValue() == pzid.longValue() && plate.getPlateId().longValue() == plateId.longValue()) { + return true; + } + } + return false; + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.java new file mode 100644 index 0000000..dac460e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.java @@ -0,0 +1,343 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.request.SysAppHomeconfigQuery; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigPage; +import com.mosty.common.core.business.entity.request.SysUserAppHomeconfigQuery; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.mapper.*; +import com.mosty.common.core.business.service.SysAppHomeconfigService; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateListService; +import com.mosty.common.core.business.service.SysUserAppHomeconfigPlateService; +import com.mosty.common.core.business.service.SysUserAppHomeconfigService; +import com.mosty.common.token.UserInfo; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.units.qual.A; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 用户app首页配置表 服务实现类 + *

+ * + * @author zengbo + * @since 2022-08-18 + */ +@Service +public class SysUserAppHomeconfigServiceImpl extends ServiceImpl implements SysUserAppHomeconfigService { + + private static final Logger log = LoggerFactory.getLogger(SysUserAppHomeconfigServiceImpl.class); + + @Resource + private SysUserAppHomeconfigMapper sysUserAppHomeconfigMapper; + + @Resource + private SysUserAppHomeconfigPlateMapper sysUserAppHomeconfigPlateMapper; + + @Resource + private SysUserAppHomeconfigPlateListMapper sysUserAppHomeconfigPlateListMapper; + + @Resource + private SysAppHomeconfigService sysAppHomeconfigService; + + @Resource + private SysUserAppHomeconfigPlateService sysUserAppHomeconfigPlateService; + + @Resource + private SysUserAppHomeconfigPlateListService sysUserAppHomeconfigPlateListService; + + + @Override + public Long saveInfo(SysUserAppHomeconfig config, String ipAddress) { + config.setXtCjsj(new Date()); + config.setXtLrip(ipAddress); + config.setXtLrsj(new Date()); + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigMapper.insert(config); + return config.getId(); + } + + @Override + public void saveInfoBatch(List configs, String ipAddress) { + if (!CollectionUtils.isEmpty(configs)) { + for (SysUserAppHomeconfig config : configs) { + config.setXtCjsj(new Date()); + config.setXtLrip(ipAddress); + config.setXtLrsj(new Date()); + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigMapper.insert(config); + } + } + } + + @Override + public void updateInfo(SysUserAppHomeconfig config, String ipAddress) { + SysUserAppHomeconfig oldConfig = sysUserAppHomeconfigMapper.selectById(config.getId()); + Asserts.check(oldConfig == null, "主键为 %s 的信息不存在", config.getId()); + config.setXtZxbz(DeletedEnum.NATURE.code); + config.setXtZhxgsj(new Date()); + config.setXtLrip(ipAddress); + sysUserAppHomeconfigMapper.updateById(config); + } + + @Override + public void updateInfoBatch(List configs, String ipAddress) { + if (!CollectionUtils.isEmpty(configs)) { + String sfzh = configs.get(0).getUserSfzh(); + sysUserAppHomeconfigMapper.deleteBySfzh(sfzh); + for (SysUserAppHomeconfig config : configs) { + config.setXtZhxgsj(new Date()); + config.setXtCjsj(new Date()); + config.setXtLrip(ipAddress); + config.setXtLrsj(new Date()); + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.NATURE.code); + sysUserAppHomeconfigMapper.insert(config); + } + } + } + + @Override + public void delete(List list, String ipAddress, UserInfo userInfo) { + if (!CollectionUtils.isEmpty(list)) { + for (Long id : list) { + SysUserAppHomeconfig config = sysUserAppHomeconfigMapper.selectById(id); + if (config != null) { + config.setXtZhxgsj(new Date()); + config.setXtZxbz(DeletedEnum.DELETED.code); + config.setXtZhxgsj(new Date()); + config.setXtZhxgip(ipAddress); + if (userInfo != null) { + config.setXtZhxgrxm(userInfo.getUserName()); + config.setXtZhxgrbmid(userInfo.getDeptId() + ""); + config.setXtZhxgrbm(userInfo.getDeptName()); + } + sysUserAppHomeconfigMapper.updateById(config); + } + } + } + } + + @Override + public IPage selectByPage(SysUserAppHomeconfigPage cofigPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(cofigPage.getHomename())) { + queryWrapper.and(wrapper -> wrapper.like("homename", cofigPage.getHomename())); + } + if (cofigPage.getHomeid() != null) { + queryWrapper.and(wrapper -> wrapper.eq("homeid", cofigPage.getHomeid())); + } + if (cofigPage.getUserId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("user_id", cofigPage.getUserId())); + } + if (StringUtils.isNotBlank(cofigPage.getUserSfzh())) { + queryWrapper.and(wrapper -> wrapper.eq("user_sfzh", cofigPage.getUserSfzh())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List orderBy = Lists.newArrayList(OrderItem.asc("id")); + cofigPage.setOrders(orderBy); + return sysUserAppHomeconfigMapper.selectPage(cofigPage, queryWrapper); + } + + @Override + public List queryUserConfig(SysUserAppHomeconfigQuery cofigQuery) { + List homeconfigVos = new ArrayList<>(); + List configs = getConfigs(cofigQuery); + List plates = getPlates(configs); + List plateList = getPlateList(plates); + if (!CollectionUtils.isEmpty(configs)) { + for (SysUserAppHomeconfig config : configs) { + SysUserAppHomeconfigVo vo = new SysUserAppHomeconfigVo(); + BeanUtils.copyProperties(config, vo); + if (!CollectionUtils.isEmpty(plates)) { + List list = + plates.parallelStream().filter(item -> item.getPzId().longValue() == config.getId().longValue()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(list)) { + List voList = new ArrayList<>(); + for (SysUserAppHomeconfigPlate plate : list) { + SysUserAppHomeconfigPlateVo plateVo = new SysUserAppHomeconfigPlateVo(); + BeanUtils.copyProperties(plate, plateVo); + if (!CollectionUtils.isEmpty(plateList)) { + List platesArray = getList(plateList, plate.getId()); + plateVo.setPlateList(platesArray); + } + voList.add(plateVo); + } + vo.setPlates(voList); + } + } + homeconfigVos.add(vo); + } + } + return homeconfigVos; + } + + @Override + public Long saveDefaultConfig(SysUserHomeconfigVo configVo, String ipAddress) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(wrapper -> wrapper.eq("user_id", configVo.getUserId())); + queryWrapper.and(wrapper -> wrapper.eq("homeid", configVo.getHomeid())); + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + List configs = sysUserAppHomeconfigMapper.selectList(queryWrapper); + System.out.println(configs); + if (configs != null && configs.size() > 0 && + configs.get(0).getPzbks() != null && configs.get(0).getPzbks() != 0) { + System.out.println("configs------->" + configs.size()); + log.info(JSONObject.toJSONString(configs)); + return configs.get(0).getId(); + } + SysAppHomeconfigQuery query = new SysAppHomeconfigQuery(); + query.setId(configVo.getHomeid()); + SysAppHomeconfigRsVO vo = sysAppHomeconfigService.queryConfig(query); + //用户首页配置ID + SysUserAppHomeconfig config = new SysUserAppHomeconfig(); + config.setHomeid(configVo.getHomeid()); + config.setHomename(vo.getHomename()); + config.setUserId(configVo.getUserId()); + config.setUserXm(configVo.getUserXm()); + config.setUserSfzh(configVo.getUserSfzh()); + if (!CollectionUtils.isEmpty(vo.getPlateList())) { + config.setPzbks(vo.getPlateList().size()); + } + config.setPzsj(new Date()); + config.setSd(configVo.getSd()); + Long homeConfigId = saveInfo(config, ipAddress); + if (!CollectionUtils.isEmpty(vo.getPlateList())) { + //用户默认板块内容 + int i = 0; + for (SysAppHomeconfigPlateVo plate : vo.getPlateList()) { + i++; + SysUserAppHomeconfigPlate userPlate = new SysUserAppHomeconfigPlate(); + userPlate.setPzId(homeConfigId); + userPlate.setPlateId(plate.getId()); + userPlate.setBklx(plate.getBklx()); + userPlate.setBkmc(plate.getBkmc()); + userPlate.setBksx(i); + Long userPlateId = sysUserAppHomeconfigPlateService.saveInfo(userPlate, ipAddress); + if (!CollectionUtils.isEmpty(vo.getPlateList())) { + userPlate.setBknrs(vo.getPlateList().size()); + int j = 0; + for (SysAppHomeconfigPlateList plateVo : plate.getPlateList()) { + j++; + SysUserAppHomeconfigPlateList userList = new SysUserAppHomeconfigPlateList(); + userList.setPzId(homeConfigId); + userList.setPzPlateId(userPlateId); + userList.setPlateListId(plateVo.getId()); + userList.setNrmc(plateVo.getNrmc()); + userList.setBksx(j); + userList.setTzdz(plateVo.getTzdz()); + userList.setBz(plateVo.getBz()); + sysUserAppHomeconfigPlateListService.saveInfo(userList, ipAddress); + } + } + } + } + return homeConfigId; + } + + public List getList(List platesArray, Long id) { + List array = new ArrayList<>(); + if (CollectionUtils.isEmpty(platesArray)) { + return array; + } + log.info("platesArray:" + platesArray.size() + ",id:" + id); + for (SysUserAppHomeconfigPlateList plate : platesArray) { + if (plate.getPzPlateId().longValue() == id.longValue()) { + array.add(plate); + } + } + return array; + } + + /** + * 获取用户配置首页 + * + * @param cofigQuery + * @return + */ + public List getConfigs(SysUserAppHomeconfigQuery cofigQuery) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(cofigQuery.getHomename())) { + queryWrapper.and(wrapper -> wrapper.like("homename", cofigQuery.getHomename())); + } + if (cofigQuery.getHomeid() != null) { + queryWrapper.and(wrapper -> wrapper.eq("homeid", cofigQuery.getHomeid())); + } + if (cofigQuery.getUserId() != null) { + queryWrapper.and(wrapper -> wrapper.eq("user_id", cofigQuery.getUserId())); + } + if (StringUtils.isNotBlank(cofigQuery.getUserSfzh())) { + queryWrapper.and(wrapper -> wrapper.eq("user_sfzh", cofigQuery.getUserSfzh())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + queryWrapper.orderByAsc("ID"); + return sysUserAppHomeconfigMapper.selectList(queryWrapper); + } + + + /** + * 获取用户配置板块 + * + * @param configs + * @return + */ + public List getPlates(List configs) { + List plates = new ArrayList<>(); + if (!CollectionUtils.isEmpty(configs)) { + List configIds = configs.stream().map(item -> item.getId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(configIds)) { + QueryWrapper plateListWrapper = new QueryWrapper<>(); + plateListWrapper.lambda().in(SysUserAppHomeconfigPlate::getPzId, configIds); + plateListWrapper.lambda().eq(SysUserAppHomeconfigPlate::getXtZxbz, DeletedEnum.NATURE.code); + plateListWrapper.orderByAsc("bksx"); + plates = sysUserAppHomeconfigPlateMapper.selectList(plateListWrapper); + } + } + return plates; + } + + + /** + * 获取用户配置板块内容 + * + * @param plates + * @return + */ + public List getPlateList(List plates) { + List plateList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(plates)) { + List configIds = plates.stream().map(item -> item.getId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(configIds)) { + QueryWrapper plateListWrapper = new QueryWrapper<>(); + plateListWrapper.lambda().in(SysUserAppHomeconfigPlateList::getPzPlateId, configIds); + plateListWrapper.lambda().eq(SysUserAppHomeconfigPlateList::getXtZxbz, DeletedEnum.NATURE.code); + plateListWrapper.orderByAsc("bksx"); + plateList = sysUserAppHomeconfigPlateListMapper.selectList(plateListWrapper); + } + } + return plateList; + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.java new file mode 100644 index 0000000..30f3c71 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.java @@ -0,0 +1,64 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.stream.CollectorUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.core.business.entity.SysUserDept; +import com.mosty.common.core.business.service.SysUserDeptService; +import com.mosty.common.core.business.mapper.SysUserDeptMapper; +import org.apache.shiro.util.CollectionUtils; +import org.springframework.data.redis.connection.ConnectionUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author li + * @description 针对表【sys_user_dept(用户和部门关联表)】的数据库操作Service实现 + * @createDate 2022-02-12 16:53:21 + */ +@Service +public class SysUserDeptServiceImpl extends ServiceImpl + implements SysUserDeptService { + + @Override + public List listByDeptId(Long deptId) { + List list = this.list(new LambdaQueryWrapper() + .eq(SysUserDept::getDeptId, deptId)); + return list; + } + + @Override + public SysUserDept getByDeptIdAndUserId(Long deptId, Long userId) { + SysUserDept one = this.getOne(new LambdaQueryWrapper() + .eq(SysUserDept::getDeptId, deptId).eq(SysUserDept::getUserId, userId)); + return one; + } + + @Override + public List listByUserId(Long userId) { + List list = this.list(new LambdaQueryWrapper() + .eq(SysUserDept::getUserId, userId)); + if (!CollectionUtils.isEmpty(list)) { + return list.stream().map(SysUserDept::getDeptId).collect(Collectors.toList()); + } else { + return new ArrayList<>(); + } + } + + @Override + public List listByDeptIds(List ids) { + if (!CollectionUtils.isEmpty(ids)) { + List list = this.list(new LambdaQueryWrapper() + .in(SysUserDept::getDeptId, ids)); + return list; + } + return new ArrayList<>(); + } +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.java new file mode 100644 index 0000000..98dfca5 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.java @@ -0,0 +1,112 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.core.business.entity.SysRole; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.SysUserRole; +import com.mosty.common.core.business.entity.vo.RoleUserPage; +import com.mosty.common.core.business.entity.vo.RoleUserVO; +import com.mosty.common.core.business.entity.vo.SysUserVO; +import com.mosty.common.core.business.entity.vo.UserRoleVO; +import com.mosty.common.core.business.mapper.SysUserRoleMapper; +import com.mosty.common.core.business.service.LoginService; +import com.mosty.common.core.business.service.SysRoleService; +import com.mosty.common.core.business.service.SysUserRoleService; +import com.mosty.common.core.business.service.SysUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * @author li + * @description 针对表【sys_user_role(用户和角色关联表)】的数据库操作Service实现 + * @createDate 2022-02-12 16:53:24 + */ +@Slf4j +@Service +public class SysUserRoleServiceImpl extends ServiceImpl implements SysUserRoleService { + + @Resource + private SysUserRoleMapper sysUserRoleMapper; + + @Resource + private SysUserService sysUserService; + + @Resource + private SysRoleService sysRoleService; + + @Resource + private LoginService loginService; + + @Override + public IPage roleUserList(String rootPath, RoleUserPage roleUserPage) { + + List dataList = sysUserRoleMapper.roleUserList(rootPath, roleUserPage); + Page page = BeanUtil.copyProperties(dataList, Page.class); + page.setRecords(dataList); + return page; + } + + @Override + public List listByUserId(Long id) { + return this.list(new LambdaQueryWrapper() + .eq(SysUserRole::getUserId, id)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean grantRoleToUser(UserRoleVO userRoleVo) { + // 先删除所有的权限信息 + this.sysUserRoleMapper.delete( + new LambdaQueryWrapper() + .eq(SysUserRole::getUserId, userRoleVo.getUserId()) + ); + SysUser sysUser = sysUserService.getById(userRoleVo.getUserId()); + Asserts.check(sysUser == null || DeletedEnum.DELETED.code.equals(sysUser.getXtZxbz()), "用户不存在或已删除"); + List sysUserRoles = new ArrayList<>(); + List roleIds = userRoleVo.getRoleIds(); + roleIds.forEach(roleId -> { + SysRole sysRole = sysRoleService.getById(roleId); + Asserts.check(sysRole == null || DeletedEnum.DELETED.code.equals(sysRole.getXtZxbz()), "角色不存在或已删除"); + SysUserRole sysUserRole = new SysUserRole(); + sysUserRole.setRoleId(roleId); + sysUserRole.setUserId(userRoleVo.getUserId()); + sysUserRoles.add(sysUserRole); + }); + // 修改redis中用户缓存的信息 + return this.saveBatch(sysUserRoles); + } + + @Override + public boolean grantUserToRole(RoleUserVO roleUserVO) { + SysRole role = sysRoleService.getById(roleUserVO.getRoleId()); + Asserts.check(role == null || DeletedEnum.DELETED.code.equals(role.getXtZxbz()), "角色不存在或已删除"); + List sysUserRoles = new ArrayList<>(); + List userIds = roleUserVO.getUserIds(); + userIds.forEach(userId -> { + SysUser user = sysUserService.getById(userId); + Asserts.check(user == null || DeletedEnum.DELETED.code.equals(user.getXtZxbz()), "用户不存在或已删除"); + SysUserRole sysUserRole = new SysUserRole(); + sysUserRole.setRoleId(role.getId()); + sysUserRole.setUserId(userId); + sysUserRoles.add(sysUserRole); + }); + return this.saveBatch(sysUserRoles); + } + + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserServiceImpl.java b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..0b9f0f6 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/service/impl/SysUserServiceImpl.java @@ -0,0 +1,551 @@ +package com.mosty.common.core.business.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.base.constant.UserConstants; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.base.util.PasswordUtil; +import com.mosty.common.base.util.RandomUtil; +import com.mosty.common.config.config.SystemConfig; +import com.mosty.common.core.business.entity.*; +import com.mosty.common.core.business.entity.request.SysUserEditPasswordRequest; +import com.mosty.common.core.business.entity.vo.*; +import com.mosty.common.core.business.mapper.SysDeptMapper; +import com.mosty.common.core.business.mapper.SysUserDeptMapper; +import com.mosty.common.core.business.mapper.SysUserMapper; +import com.mosty.common.core.business.service.*; +import com.mosty.common.core.config.DefaultRoleConfig; +import com.mosty.common.core.util.BeanUtils; +import com.mosty.common.core.util.http.HttpUtils; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class SysUserServiceImpl extends ServiceImpl implements SysUserService { + + @Resource + private SysUserMapper sysUserMapper; + @Resource + private SysUserDeptService sysUserDeptService; + @Resource + private DefaultRoleConfig defaultRoleConfig; + @Resource + private SysUserRoleService sysUserRoleService; + @Resource + private SystemConfig systemConfig; + @Resource + private SysDeptService sysDeptService; + @Resource + private SysPositionService sysPositionService; + @Resource + private SysDeptMapper sysDeptMapper; + @Resource + private SysUserDeptMapper sysUserDeptMapper; + @Resource + private SysRoleService sysRoleService; + @Resource + private LoginService loginService; + public static String USER_URL = "http://80.149.27.78:8001/no-auth-api/coreUsersList"; + + @Override + public void saveInfo(AddSysUserVO sysUserVo) { + if (StringUtils.isBlank(sysUserVo.getSsbmdm())) return; + // 保存用户信息 + Long userId = saveUserInfo(sysUserVo); + // 保存用户部门关联关系 + // 验证部门并设置部门名称 +// List deptIds = sysUserVo.getDeptIds(); + List sysUserDeptList = new ArrayList<>(); +// deptIds.forEach(deptId -> { +// SysDept sysDept = sysDeptService.getById(deptId); +// Asserts.check(sysDept == null || sysDept.getXtZxbz() != 0, "部门 %s 不存在!", deptId); +// SysUserDept sysUserDept = new SysUserDept().setUserId(userId).setDeptId(deptId); +// sysUserDeptList.add(sysUserDept); +// }); + SysDept sysDept = sysDeptService.getDeptByOrgCode(sysUserVo.getSsbmdm()); + Asserts.check(sysDept == null || sysDept.getXtZxbz() != 0, "部门 %s 不存在!", sysUserVo.getSsbmdm()); + SysUserDept sysUserDept = new SysUserDept().setUserId(userId).setDeptId(sysDept.getId()); + sysUserDeptList.add(sysUserDept); + + sysUserDeptService.saveBatch(sysUserDeptList); + // 保存默认用户角色 + List defaultRoleList = defaultRoleConfig.getDefaultRoleList(); + if (CollectionUtils.isNotEmpty(defaultRoleList)) { + List collect = defaultRoleList.stream() + .map(roleId -> new SysUserRole(userId, roleId)).collect(Collectors.toList()); + sysUserRoleService.saveBatch(collect); + } + } + + // 保存用户信息 + private Long saveUserInfo(AddSysUserVO sysUserVo) { + SysUser sysUser = BeanUtil.copyProperties(sysUserVo, SysUser.class); + + // 初始化用户密码 + String salt = RandomUtil.generateString(8); + if (StringUtils.isNotBlank(sysUserVo.getPassword())) { + String encodePassword = PasswordUtil.encode(sysUserVo.getPassword(), salt); + sysUser.setPassword(encodePassword); + } else { + String passwordPzz = getDefaultPassword(salt); + sysUser.setPassword(passwordPzz); + } + sysUser.setSalt(salt); + UserInfo userInfo = UserInfoManager.get(); + sysUser.setXtZxbz(DeletedEnum.NATURE.code); + + sysUser.setXtCjsj(new Date()); + sysUser.setXtZhxgsj(new Date()); + sysUser.setXtZhxgid(userInfo.getUserId()); + sysUser.setXtZhxgrxm(userInfo.getUserName()); + sysUser.setXtZhxgrbmid(userInfo.getDeptId()); + sysUser.setXtZhxgrbm(userInfo.getDeptName()); + + sysUser.setXtLrsj(new Date()); + sysUser.setXtLrrid(userInfo.getUserId()); + sysUser.setXtLrrxm(userInfo.getUserName()); + sysUser.setXtLrrbmid(userInfo.getDeptId().toString()); + sysUser.setXtLrrbm(userInfo.getDeptName()); + + this.save(sysUser); + + return sysUser.getId(); + } + + // 获取默认的初始化密码 + private String getDefaultPassword(String salt) { + String passwordPzz = systemConfig.getDefaultPassword(); + return PasswordUtil.encode(passwordPzz, salt); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void editInfo(SysUserEditVO sysUserEditVo, SysUser userInfo) { + + if (StringUtils.isBlank(sysUserEditVo.getSsbmdm())) return; + + // 先删除用户id,再添加 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("user_id", userInfo.getId()); + + sysUserDeptService.remove(wrapper); + +// List saveRelation = sysUserEditVo.getDeptIds().stream().map(deptId -> +// new SysUserDept(userInfo.getId(), deptId)).collect(Collectors.toList()); + List sysUserDeptList = new ArrayList<>(); + SysDept sysDept = sysDeptService.getDeptByOrgCode(sysUserEditVo.getSsbmdm()); + Asserts.check(sysDept == null || sysDept.getXtZxbz() != 0, "部门 %s 不存在!", sysUserEditVo.getSsbmdm()); + SysUserDept sysUserDept = new SysUserDept().setUserId(sysUserEditVo.getId()).setDeptId(sysDept.getId()); + sysUserDeptList.add(sysUserDept); + sysUserDeptService.saveBatch(sysUserDeptList); + + SysPosition position = sysPositionService.getById(sysUserEditVo.getPositionId()); +// Asserts.check(position == null, "岗位信息不存在,请登陆"); + // 更改需要保存的字段 + userInfo.setPositionId(sysUserEditVo.getPositionId()); + userInfo.setPositionName(position != null ? position.getPostName() : ""); + userInfo.setUserName(sysUserEditVo.getUserName()); + userInfo.setEmail(sysUserEditVo.getEmail()); + userInfo.setMobile(sysUserEditVo.getMobile()); + userInfo.setTelePhone(sysUserEditVo.getTelePhone()); + userInfo.setPolitic(sysUserEditVo.getPolitic()); + userInfo.setMarital(sysUserEditVo.getMarital()); + userInfo.setType(sysUserEditVo.getType()); + userInfo.setBz(sysUserEditVo.getBz()); + userInfo.setIsVirtualUser(sysUserEditVo.getIsVirtualUser()); + userInfo.setSex(sysUserEditVo.getSex()); + userInfo.setUserType(sysUserEditVo.getUserType()); + userInfo.setInDustRialId(sysUserEditVo.getInDustRialId()); + userInfo.setBeginTime(sysUserEditVo.getBeginTime()); + userInfo.setEndTime(sysUserEditVo.getEndTime()); + userInfo.setBirthday(sysUserEditVo.getBirthday()); + userInfo.setIdEntityCard(sysUserEditVo.getIdEntityCard()); + userInfo.setWhcd(sysUserEditVo.getWhcd()); + userInfo.setNation(sysUserEditVo.getNation()); + userInfo.setLoginName(sysUserEditVo.getLoginName()); + userInfo.setSfrh(sysUserEditVo.getSfrh()); + userInfo.setMk(sysUserEditVo.getMk()); + super.updateById(userInfo); + } + + @Override + public void editPassword(SysUserEditPasswordRequest sysUserEditPasswordRequest) { + UserInfo userInfo = UserInfoManager.get(); + SysUser sysUser = this.getById(userInfo.getUserId()); + boolean match = PasswordUtil.match(sysUserEditPasswordRequest.getOldPassword(), sysUser.getPassword()); + Asserts.check(!match, "账号 %s 的密码错误", sysUser.getLoginName()); + String salt = RandomUtil.generateString(8); + String password = PasswordUtil.encode(sysUserEditPasswordRequest.getPassword(), salt); + sysUser.setPassword(password); + sysUser.setSalt(salt); + this.updateById(sysUser); + } + + @Override + public SysUser getUserInfo(Long id) { + return this.getById(id); + } + + @Override + public SysUser checkUserInfo(SysUser user) { + SysUser sysUser = this.getOne(new LambdaQueryWrapper().eq(SysUser::getLoginName, user.getLoginName()).eq(SysUser::getXtZxbz, UserConstants.NORMAL)); + Asserts.check(sysUser == null, "账号 %s 的用户不存在", user.getLoginName()); + boolean match = PasswordUtil.match(sysUser.getPassword(), sysUser.getPassword()); + Asserts.check(match, "账号 %s 的密码错误", sysUser.getLoginName()); + return sysUser; + } + + @Override + public IPage selectByPage(UserPage userPage) { + if (StringUtils.isBlank(userPage.getDeptId())) { + userPage.setOrgcode(this.getSsbm("", userPage.getIsChild())); + List list = sysUserMapper.selectByPage(userPage); + Page page = BeanUtil.copyProperties(userPage, Page.class); + page.setRecords(list); + return page; + } else { + SysDept dept = this.sysDeptMapper.selectById(userPage.getDeptId()); + if (dept != null) { + userPage.setOrgcode(this.getSsbm(dept.getOrgCode(), userPage.getIsChild())); + List list = sysUserMapper.selectByPage(userPage); + Page page = BeanUtil.copyProperties(userPage, Page.class); + page.setRecords(list); + return page; + } + return null; + } + } + + @Override + public void resetPassword(SysUser user) { + String defaultPassword = getDefaultPassword(user.getSalt()); + user.setPassword(defaultPassword); + sysUserMapper.updateById(user); + } + + @Override + public IPage selectUnAccreditPage(UserPage userPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtils.isNotBlank(userPage.getLoginName())) { + queryWrapper.and(wrapper -> wrapper.like("login_name", userPage.getLoginName())); + } + if (StringUtils.isNotBlank(userPage.getPhone())) { + queryWrapper.and(wrapper -> wrapper.like("mobile", userPage.getPhone())); + } + queryWrapper.and(wrapper -> wrapper.eq("xt_zxbz", DeletedEnum.NATURE.code)); + QueryWrapper sysUserRoleQueryWrapper = new QueryWrapper<>(); + sysUserRoleQueryWrapper.and(wrapper -> wrapper.eq("role_id", userPage.getRoleId())); + List list = sysUserRoleService.list(sysUserRoleQueryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + List userList = list.stream().map(SysUserRole::getUserId).collect(Collectors.toList()); + queryWrapper.and(wrapper -> wrapper.notIn("id", userList)); + } + UserPage page = this.baseMapper.selectPage(userPage, queryWrapper); + IPage resPage = new Page<>(userPage.getCurrent(), userPage.getSize()); + List voList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(page.getRecords())) { + page.getRecords().forEach(item -> { + SysUserVO userVO = new SysUserVO(); + BeanUtils.copyProperties(item, userVO); + voList.add(userVO); + }); + } + resPage.setRecords(voList); + resPage.setTotal(page.getTotal()); + return resPage; + } + + @Override + public IPage selectUserDeptPage(UserDeptPage userDeptPage) { + UserInfo user = UserInfoManager.get(); + if (StringUtils.isEmpty(userDeptPage.getSsbmdm())) { + userDeptPage.setSsbmdm(String.valueOf(user.getDeptCode())); + } +// else { +// userDeptPage.setOrgcode(userDeptPage.getDeptId()); +// } + userDeptPage.setOrgcode(userDeptPage.getSsbmdm().replaceAll("(00)+$", "")); + return sysUserMapper.selectUserDeptPage(userDeptPage); + } + + @Override + public Boolean userSys() { + Map params = new HashMap<>(); + String rs = HttpUtils.executeGet(USER_URL, params); + JSONObject json = JSONObject.parseObject(rs); + if (json.getBoolean("success")) { + JSONArray array = json.getJSONArray("data"); + if (CollectionUtils.isNotEmpty(array)) { + for (int i = 0; i < array.size(); i++) { + JSONObject userJson = array.getJSONObject(i); + String orgCode = userJson.getString("jurisdictionCode"); + SysDept sysDept = sysDeptService.getDeptByOrgCode(orgCode); + Asserts.check(sysDept == null, "用户code对应的部门信息不存在"); + String idNum = userJson.getString("idNum"); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idNum); + SysUser sysUser = sysUserMapper.selectOne(queryWrapper); + if (sysUser == null) { + sysUser = new SysUser(); + } + sysUser.setInDustRialId(userJson.getString("username")); + sysUser.setLoginName(userJson.getString("nickName")); + sysUser.setUserName(userJson.getString("nickName")); + sysUser.setMobile(userJson.getString("mobilePhone")); + sysUser.setIdEntityCard(userJson.getString("idNum")); + sysUser.setManagerOrgId(sysDept.getId()); + sysUser.setManagerOrgName(sysDept.getOrgJc()); + sysUser.setXtZxbz(DeletedEnum.NATURE.code); + sysUser.setXtCjsj(new Date()); + sysUser.setXtZhxgsj(new Date()); + if (sysUser.getId() == null) { + sysUser.setXtLrsj(new Date()); + this.save(sysUser); + SysUserDept userDept = new SysUserDept(); + userDept.setUserId(sysUser.getId()); + userDept.setDeptId(sysDept.getId()); + sysUserDeptService.save(userDept); + } else { + this.updateById(sysUser); + SysUserDept oldUserDept = sysUserDeptService.getByDeptIdAndUserId(sysDept.getId(), + sysUser.getId()); + if (oldUserDept == null) { + sysUserDeptService.remove(new LambdaQueryWrapper().eq(SysUserDept::getUserId, + sysUser.getId())); + SysUserDept userDept = new SysUserDept(); + userDept.setUserId(sysUser.getId()); + userDept.setDeptId(sysDept.getId()); + sysUserDeptService.save(userDept); + } + } + } + } + } + return true; + } + + + @Override + public void delById(Long id) { + this.baseMapper.delById(id); + } + + + @Override + public List getUserList(GetUserPage dto) { + UserInfo user = UserInfoManager.get(); + if ("1".equals(dto.getType())) { + return this.getUserListByDept(dto.getKeyword(), String.valueOf(user.getDeptId())); + } else { + return this.getUserListByAll(dto.getKeyword()); + } + } + + private List getUserListByAll(String keyword) { + List userVOList = new ArrayList<>(); + if (StringUtils.isNotBlank(keyword)) { + List list = this.sysDeptMapper.selectList( + new LambdaQueryWrapper() + .like(SysDept::getOrgName, keyword) + .eq(SysDept::getXtZxbz, "0") + ); + + if (list != null && list.size() > 0) { + List deptIds = list.stream().map(d -> String.valueOf(d.getId())).collect(Collectors.toList()); + List userList = this.baseMapper.getUserListByDeptId(deptIds, null); + userList.forEach(user -> { + SysUserVO userVO = new SysUserVO(); + BeanUtils.copyProperties(user, userVO); + SysDept dept = this.sysDeptMapper.getDeptByUserId(user.getId()); + userVO.setDeptId(dept.getId()); + userVO.setDeptCode(dept.getOrgCode()); + userVO.setDeptJc(dept.getOrgJc()); + userVO.setDeptName(dept.getOrgName()); + userVOList.add(userVO); + }); + } + } + List userList = this.baseMapper.selectList( + new LambdaQueryWrapper() + .eq(SysUser::getIsVirtualUser, "02") + .eq(SysUser::getXtZxbz, "0") + .and(StringUtils.isNotBlank(keyword), it -> it.like(SysUser::getLoginName, keyword) + .or() + .like(SysUser::getUserName, keyword)) + ); + userList.forEach(item -> { + SysUserVO userVO = new SysUserVO(); + BeanUtils.copyProperties(item, userVO); + SysUserDept sysUserDept = this.sysUserDeptMapper.selectOne( + new QueryWrapper() + .eq("user_id", String.valueOf(item.getId())) + .last(" limit 1") + ); + if (sysUserDept != null) { + SysDept sysDept = this.sysDeptMapper.selectById(sysUserDept.getDeptId()); + userVO.setDeptId(sysDept.getId()); + userVO.setDeptCode(sysDept.getOrgCode()); + userVO.setDeptJc(sysDept.getOrgJc()); + userVO.setDeptName(sysDept.getOrgName()); + } + userVOList.add(userVO); + }); + return userVOList; + } + + // 获取本部门下的所有的人员信息 + private List getUserListByDept(String keyword, String deptid) { + SysDept dept = this.sysDeptMapper.selectById(deptid); + List deptIds = new ArrayList<>(); + this.getChildList(dept, deptIds); + List userList = this.baseMapper.getUserListByDeptId(deptIds, keyword); + List userVOList = new ArrayList<>(); + userList.forEach(item -> { + SysUserVO userVO = new SysUserVO(); + BeanUtils.copyProperties(item, userVO); + userVO.setDeptId(dept.getId()); + userVO.setDeptCode(dept.getOrgCode()); + userVO.setDeptJc(dept.getOrgJc()); + userVO.setDeptName(dept.getOrgName()); + userVOList.add(userVO); + }); + return userVOList; + } + + private void getChildList(SysDept dept, List deptIds) { + deptIds.add(String.valueOf(dept.getId())); + List tempList1 = this.sysDeptMapper.selectList( + new LambdaQueryWrapper() + .eq(SysDept::getParentId, dept.getId()) + ); + if (tempList1.size() > 0) { + deptIds.addAll(tempList1.stream().map(item -> String.valueOf(item.getId())).collect(Collectors.toList())); + tempList1.forEach(item -> this.getChildList(item, deptIds)); + } + } + + public String getSsbm(String ssbmdm, String isChild) { + isChild = StringUtils.isNotBlank(isChild) ? isChild : "1"; + UserInfo user = UserInfoManager.getUser(); + // 如果用户信息存在,先查询用户权限 + SysRoleVO role = null; + if (StringUtils.isBlank(ssbmdm)) { + if (user != null) { + ssbmdm = user.getDeptCode(); + // 查询用户权限 + List userRoles = sysRoleService.getUserRoleList(user.getUserId()); + if (!org.springframework.util.CollectionUtils.isEmpty(userRoles)) { + int level = Integer.parseInt(userRoles.get(0).getDataPermissionLevel()); + role = userRoles.get(0); + for (SysRoleVO item : userRoles) { + if (level > Integer.parseInt(item.getDataPermissionLevel())) { + level = Integer.parseInt(item.getDataPermissionLevel()); + role = item; + } + } + } + } + if (role != null && !"5".equals(role.getDataPermissionLevel())) { + String level = role.getDataPermissionLevel(); + if ("1".equals(level) || "2".equals(level)) { + return "1".equals(isChild) ? ssbmdm.substring(0, 2) : ssbmdm; + } else if ("3".equals(level)) { + return "1".equals(isChild) ? ssbmdm.substring(0, 4) : ssbmdm; + } else if ("4".equals(level)) { + return "1".equals(isChild) ? ssbmdm.substring(0, 6) : ssbmdm; + } else if ("6".equals(level)) { + return ssbmdm; + } + } else { + if ("1".equals(isChild)) { + SysDept dept = this.sysDeptMapper.selectOne( + new LambdaQueryWrapper() + .eq(SysDept::getXtZxbz, "0") + .eq(SysDept::getOrgCode, ssbmdm) + ); + if (dept == null) { + throw new BusinessException("部门信息不存在!"); + } + if (StringUtils.isBlank(dept.getOrgLevel())) { + return ssbmdm; + } + switch (dept.getOrgLevel()) { + case "10": + case "11": + return ssbmdm.substring(0, 2); + case "21": + case "31": + return ssbmdm.substring(0, 8); + case "12": + case "32": + case "22": + return ssbmdm.substring(0, 10); + case "20": + return ssbmdm.substring(0, 4); + case "30": + return ssbmdm.substring(0, 6); + default: + return ssbmdm; + } + } + } + } else { + if ("1".equals(isChild)) { + SysDept dept = this.sysDeptMapper.selectOne( + new LambdaQueryWrapper() + .eq(SysDept::getXtZxbz, "0") + .eq(SysDept::getOrgCode, ssbmdm) + ); + if (dept == null) { + throw new BusinessException("部门信息不存在!"); + } + if (StringUtils.isBlank(dept.getOrgLevel())) { + return ssbmdm; + } + switch (dept.getOrgLevel()) { + case "10": + case "11": + return ssbmdm.substring(0, 2); + case "21": + case "31": + return ssbmdm.substring(0, 8); + case "12": + case "32": + case "22": + return ssbmdm.substring(0, 10); + case "20": + return ssbmdm.substring(0, 4); + case "30": + return ssbmdm.substring(0, 6); + default: + return ssbmdm; + } + } + } + return ssbmdm; + } + +} + + + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/business/timer/DeptUserSys.java b/common-core-starter/src/main/java/com/mosty/common/core/business/timer/DeptUserSys.java new file mode 100644 index 0000000..79e2053 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/business/timer/DeptUserSys.java @@ -0,0 +1,34 @@ +package com.mosty.common.core.business.timer; + +import com.mosty.common.core.business.service.SysDeptService; +import com.mosty.common.core.business.service.SysUserService; +import lombok.AllArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +/** + * 用户部门数据同步 + * @title: DeptUserSys + * @projectName mosty-common + * @description: TODO + * @date 2022/8/27 16:52 + */ +@Component +@AllArgsConstructor +public class DeptUserSys { + + private SysDeptService sysDeptService; + + private SysUserService sysUserService; + +// @Scheduled(cron = "0 0 1 * * ?") + @Transactional + public void run() { + //同步部门数据 + sysDeptService.deptSys(); + //同步用户数据 + sysUserService.userSys(); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/config/CaptchaConfig.java b/common-core-starter/src/main/java/com/mosty/common/core/config/CaptchaConfig.java new file mode 100644 index 0000000..41a0bc3 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/config/CaptchaConfig.java @@ -0,0 +1,72 @@ +package com.mosty.common.core.config; + +import com.google.code.kaptcha.impl.DefaultKaptcha; +import com.google.code.kaptcha.util.Config; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Properties; + +/** + * 验证码配置 + * + * @author xingsong + */ +@Data +@Slf4j +@Configuration +public class CaptchaConfig implements InitializingBean { + + /** 默认角色列表 多个使用逗号间隔 */ + @Value("${login.check.kaptcha:false}") + private Boolean loginCheckKaptcha; + + @Bean(name = "captchaProducerMath") + public DefaultKaptcha getKaptchaBeanMath() { + + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + Properties properties = new Properties(); + // 是否有边框 默认为true 我们可以自己设置yes,no + properties.setProperty("kaptcha.border", "yes"); + // 边框颜色 默认为Color.BLACK + properties.setProperty("kaptcha.border.color", "105,179,90"); + // 验证码文本字符颜色 默认为Color.BLACK + properties.setProperty("kaptcha.textproducer.font.color", "blue"); + // 验证码图片宽度 默认为200 + properties.setProperty("kaptcha.image.width", "160"); + // 验证码图片高度 默认为50 + properties.setProperty("kaptcha.image.height", "60"); + // 验证码文本字符大小 默认为40 + properties.setProperty("kaptcha.textproducer.font.size", "35"); + // KAPTCHA_SESSION_KEY + properties.setProperty("kaptcha.session.key", "kaptchaCodeMath"); + // 验证码文本字符间距 默认为2 + properties.setProperty("kaptcha.textproducer.char.space", "3"); + // 验证码文本字符长度 默认为5 + properties.setProperty("kaptcha.textproducer.char.length", "4"); + // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, + // fontSize) + properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier"); + // 验证码噪点颜色 默认为Color.BLACK + properties.setProperty("kaptcha.noise.color", "white"); + // 干扰实现类 + properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise"); + // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple + // 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy + // 阴影com.google.code.kaptcha.impl.ShadowGimpy + properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy"); + Config config = new Config(properties); + defaultKaptcha.setConfig(config); + + return defaultKaptcha; + } + + @Override + public void afterPropertiesSet() { + log.info("login check captcha is {}", loginCheckKaptcha); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/config/DefaultRoleConfig.java b/common-core-starter/src/main/java/com/mosty/common/core/config/DefaultRoleConfig.java new file mode 100644 index 0000000..3874596 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/config/DefaultRoleConfig.java @@ -0,0 +1,43 @@ +package com.mosty.common.core.config; + +import com.google.common.collect.Lists; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +/** + * 默认角色配置 + * @author kevin + * @date 2022/2/21 1:12 PM + * @since 1.0.0 + */ +@Configuration +@Data +@Slf4j +public class DefaultRoleConfig { + + /** 默认角色列表 多个使用逗号间隔 */ + @Value("${default.role:12345}") + private String defaultRole; + + public List getDefaultRoleList() { + List defaultRoleList = Lists.newArrayList(); + if (StringUtils.isEmpty(defaultRole)) { + return defaultRoleList; + } + String[] split = defaultRole.split(","); + for (String roleId : split) { + try { + defaultRoleList.add(Long.parseLong(roleId)); + } catch (Exception e) { + log.error("解析角色id异常", e); + } + } + return defaultRoleList; + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/config/MinIoClientConfig.java b/common-core-starter/src/main/java/com/mosty/common/core/config/MinIoClientConfig.java new file mode 100644 index 0000000..d3d08bc --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/config/MinIoClientConfig.java @@ -0,0 +1,46 @@ +package com.mosty.common.core.config; + +import io.minio.MinioClient; +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * minio配置 + * @author kevin + * @date 2022/3/7 10:41 AM + * @since 1.0.0 + */ +@Data +@Configuration +public class MinIoClientConfig { + + @Value("${minio.endpoint:http://123.60.67.142:8001}") + private String endpoint; + @Value("${minio.downloadEndpoint:http://123.60.67.142:8000}") + private String downloadEndpoint; + @Value("${minio.accessKey:root}") + private String accessKey; + @Value("${minio.secretKey:sczy@2022}") + private String secretKey; + /** 图片桶名称 */ + @Value("${minio.bucket.image:image}") + private String imageBucket; + /** 文件桶名称 */ + @Value("${minio.bucket.file:file}") + private String fileBucket; + + + /** + * 注入minio 客户端 + * @return + */ + @Bean + public MinioClient minioClient() { + return MinioClient.builder() + .endpoint(endpoint) + .credentials(accessKey, secretKey) + .build(); + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/constant/DataPermissionConstant.java b/common-core-starter/src/main/java/com/mosty/common/core/constant/DataPermissionConstant.java new file mode 100644 index 0000000..b70e657 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/constant/DataPermissionConstant.java @@ -0,0 +1,44 @@ +package com.mosty.common.core.constant; + +import lombok.AllArgsConstructor; + +/** + * 菜单类型枚举 + * @author kevin + * @date 2022/2/22 12:53 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public class DataPermissionConstant { + + /** + * 全部数据权限 + */ + public static final String DATA_SCOPE_ALL = "1"; + + /** + * 市级数据权限 + */ + public static final String DATA_SCOPE_CITY = "2"; + + /** + * 县级数据权限 + */ + public static final String DATA_SCOPE_COUNTY = "3"; + + + /** + * 部门及以下数据权限 + */ + public static final String DATA_SCOPE_DEPT_AND_CHILD = "4"; + /** + * 部门数据权限 + */ + public static final String DATA_SCOPE_DEPT = "5"; + + /** + * 仅本人数据权限 + */ + public static final String DATA_SCOPE_SELF = "99"; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/IdCardLoginRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/login/IdCardLoginRequest.java new file mode 100644 index 0000000..4b3cf70 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/IdCardLoginRequest.java @@ -0,0 +1,28 @@ +package com.mosty.common.core.login; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; + +/** + * pki登陆(身份证号登陆) + * @author kevin + * @date 2022/4/23 2:28 下午 + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("身份证号登陆请求") +public class IdCardLoginRequest { + + /** + * 身份证号 + */ + @NotEmpty(message = "身份证号不能为空") + @ApiModelProperty("身份证号") + private String idCardNo; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/ImageController.java b/common-core-starter/src/main/java/com/mosty/common/core/login/ImageController.java new file mode 100644 index 0000000..4e3eb20 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/ImageController.java @@ -0,0 +1,74 @@ +package com.mosty.common.core.login; + +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.login.dto.ImageRequest; +import com.mosty.common.core.util.Base64Util; +import com.mosty.common.util.ImageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLDecoder; + +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/image") +@Api(tags = "图片功能服务") +public class ImageController { + + @GetMapping("/base64") + @ApiOperation(value = "根据URL获取base64图片", httpMethod = "GET", response = SysDept.class) + public ResponseResult selectPage(ImageRequest imageRequest) { + try { + String base = ""; + if (imageRequest.getUrl().startsWith("https://")) { + base = ImageUtils.encodeImageToBase64Https(imageRequest.getUrl()); + } else { + base = ImageUtils.encodeImageToBase64(imageRequest.getUrl()); + } + return ResponseResult.success(base); + } catch (Exception e) { + return ResponseResult.fail("图片下载失败"); + } + } + + // 下载图片(返回二进制) + @RequestMapping(value = "/image", method = RequestMethod.GET) + public HttpEntity downloadFile(String url, HttpServletRequest request) throws Exception{ + byte[] obsBytes = null; + if (StringUtils.isNotBlank(url)) { + url= URLDecoder.decode(url,"UTF-8"); + if (url.startsWith("https://")) { + obsBytes = ImageUtils.encodeImageToByteHttps(url); + } else { + obsBytes = ImageUtils.encodeImageTobyte(url); + } + } + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.IMAGE_JPEG); + headers.setContentLength(obsBytes.length); + return new HttpEntity(obsBytes, headers); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/JwtTokenGenerator.java b/common-core-starter/src/main/java/com/mosty/common/core/login/JwtTokenGenerator.java new file mode 100644 index 0000000..9f5f0ec --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/JwtTokenGenerator.java @@ -0,0 +1,236 @@ +package com.mosty.common.core.login; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.interfaces.Claim; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.auth0.jwt.interfaces.JWTVerifier; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.SysRoleVO; +import com.mosty.common.core.login.dto.DeptAllVo; +import com.mosty.common.core.login.dto.DeptDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_ISSUER; +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_KEY; + +/** + * jwt token工具类 + * + * @author kevin + * @date 2022/2/15 10:32 PM + * @since 1.0.0 + */ +@Slf4j +@Component +public class JwtTokenGenerator { + + /** + * 配置文件中过期时间,单位秒 + */ + @Value("${jwt.expiration:864000}") + private Long expiration; + + /** + * 配置文件中的jwt秘钥 + */ + @Value("${jwt.secret:RVvjAORWxgmDyvGP8RkD7HuaYEuekN7rXyaDaLn2jbk6OJvFupTXzicR883pFUmI}") + private String secret; + + @Value("${jwt.issuer:mosty-admin}") + private String issuer; + + /** + * 获取当前登陆的token + *

+ * private String id;//人员主键 userId + * private String identitycard;//人员账号 + * private String identitycard;//身份证号码 + * private String identitycard;//行业号码 + * private String username;//人员姓名 + * private String orgname;//所在部门名称 + * private String orgcode;//所在部门代码 + * private String orgid;//所在部门ID + * private String org_level;//所在部门等级代码 [部门等级] + * private String orgid;//所在部门业务类型代码 org_biz_type + * private String position;//登陆时间 + * + * @param sysUser 用户信息 + * @param dept 当前登陆用户部门 + * @return token信息 + */ + public String generateToken(SysUser sysUser, DeptAllVo dept) { + try { + long currentMills = System.currentTimeMillis(); + Algorithm algorithm = Algorithm.HMAC256(secret); + + Date expireDate = DateUtils.parseDate("2099-12-31 00:00:00"); + return JWT.create() + .withIssuer(issuer) + .withIssuedAt(new Date(currentMills)) + .withClaim("userId", sysUser.getId()) + .withClaim("userName", sysUser.getUserName()) + .withClaim("userType", sysUser.getUserType()) + .withClaim("userLoginName", sysUser.getLoginName()) + .withClaim("inDustRialId", sysUser.getInDustRialId()) + .withClaim("idEntityCard", sysUser.getIdEntityCard()) + .withClaim("phone", sysUser.getMobile()) + .withClaim("isVirtualUser", sysUser.getIsVirtualUser()) + .withClaim("deptId", dept.getDeptid()) + .withClaim("deptCode", dept.getDeptcode()) + .withClaim("deptName", dept.getDeptname()) + .withClaim("deptLevel", dept.getOrgLevel()) + .withClaim("deptBizType", dept.getOrgType()) + .withClaim("fxjDeptId", dept.getFxjid()) + .withClaim("fxjDeptName", dept.getFxjname()) + .withClaim("fxjDeptCode", dept.getFxjcode()) + .withClaim("dszDeptId", dept.getDszid()) + .withClaim("dszDeptName", dept.getDszname()) + .withClaim("dszDeptCode", dept.getDszcode()) + .withIssuedAt(new Date()) + .withSubject("admin") + //设置时间长一点,永不过期 +// .withExpiresAt(new Date(currentMills + expiration * 1000)) + .withExpiresAt(expireDate) + .sign(algorithm); + } catch (Exception e) { + log.error("生产token异常", e); + return null; + } + } + + public String generatePromotionToken(Long promotionId, String promotionMobile, Integer promotionType, String pageUrl) { + try { +// Long expiration = 7200L; + long currentMills = System.currentTimeMillis(); + Algorithm algorithm = Algorithm.HMAC256(secret); + /*DecodedJWT verify = verify(token, secret, issuer); + Claim promotionMobile1 = verify.getClaims().get("promotionId");*/ + return JWT.create() + .withIssuer(issuer) + .withIssuedAt(new Date(currentMills)) + .withClaim("promotionId", promotionId) + .withClaim("promotionMobile", promotionMobile) + .withClaim("promotionType", promotionType) + .withClaim("pageUrl", pageUrl) + .withSubject("promotion") + //设置过期时间为2小时 + .withExpiresAt(new Date(currentMills + expiration * 1000)) + .sign(algorithm); + + } catch (Exception e) { + log.error("生产token异常:{}", e); + return null; + } + } + + public Map getPromotionFromToken(String token) { + try { + DecodedJWT decodedJWT = verify(token, secret, issuer); + return decodedJWT.getClaims(); + } catch (Exception e) { + throw new BusinessException("获取用户身份异常,请退出重新登录"); + } + } + + public static DecodedJWT verify(String token, String secret, String issuer) { + DecodedJWT result = null; + try { + Algorithm algorithm = Algorithm.HMAC256(secret); + JWTVerifier verifier = JWT.require(algorithm) + .withIssuer(issuer) + .build(); + DecodedJWT decodedJWT = verifier.verify(token); + Date expiresAt = decodedJWT.getExpiresAt(); + result = expiresAt.after(new Date()) ? decodedJWT : null; + } finally { + return result; + } + } + + public static void main(String[] args) { +// String token = generatePromotionToken(32232L, "13212120222", 1); +// System.out.println(token); +// String s = new JwtTokenUtil().generateToken(123); +// System.out.println(s); +// + DecodedJWT result = null; + try { +// String tokenStr = StrUtil.sub(token, 9, token.length()); + String secret = TOKEN_KEY, issuer = TOKEN_ISSUER; + Algorithm algorithm = Algorithm.HMAC256(secret); + JWTVerifier verifier = JWT.require(algorithm) + .withIssuer(issuer) + .build(); + String s = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6Inprai1mcG0tc3RvcmVhZG1pbiIsImV4cCI6MTYwNjc3MjQwNywiaWF0IjoxNjA2NzI5MjA3LCJ1c2VySWQiOjEyM30.VLFq7RZ8a_e6d2AXI0hS31mAbFj1T-OrZ9Ol7KNIUA8"; + DecodedJWT decodedJWT = verifier.verify(s); + Date expiresAt = decodedJWT.getExpiresAt(); + result = expiresAt.after(new Date()) ? decodedJWT : null; + System.out.println(result.getId()); + Map claims = result.getClaims(); +// Long promotionId = claims.get("promotionId").asLong(); +// String promotionMobile = claims.get("promotionMobile").asString(); +// Integer promotionType = claims.get("promotionType").asInt(); +// System.out.println(promotionId + "_" + promotionMobile + "_" + promotionType); + } catch (Exception e) { + } + } + + /** + * 获取jwt的属性值 + * + * @param token token信息 + * @param pwtKey jwt的属性 + * @return jwt属性对应的值 + */ + public Integer getPropertyFromToken(String token, String pwtKey) { + Algorithm algorithm = Algorithm.HMAC256(secret); + return JWT.require(algorithm).build() + .verify(token) + .getClaim(pwtKey) + .asInt(); + } + + public void removeToken(SysUser sysUser, DeptAllVo sysDept) { + long currentMills = System.currentTimeMillis(); + Algorithm algorithm = Algorithm.HMAC256(secret); + JWT.create() + .withIssuer(issuer) + .withIssuedAt(new Date(currentMills)) + .withClaim("userId", sysUser.getId()) + .withClaim("userName", sysUser.getUserName()) + .withClaim("userType", sysUser.getUserType()) + .withClaim("userLoginName", sysUser.getLoginName()) + .withClaim("inDustRialId", sysUser.getInDustRialId()) + .withClaim("idEntityCard", sysUser.getIdEntityCard()) + .withClaim("isVirtualUser", sysUser.getIsVirtualUser()) + .withClaim("phone", sysUser.getMobile()) + .withClaim("deptId", sysDept.getDeptid()) + .withClaim("deptCode", sysDept.getDeptcode()) + .withClaim("deptName", sysDept.getDeptname()) + .withClaim("deptLevel", sysDept.getOrgLevel()) + .withClaim("deptBizType", sysDept.getOrgBizType()) + .withClaim("fxjDeptId", sysDept.getFxjid()) + .withClaim("fxjDeptName", sysDept.getFxjname()) + .withClaim("fxjDeptCode", sysDept.getFxjcode()) + .withClaim("dszDeptId", sysDept.getDszid()) + .withClaim("dszDeptName", sysDept.getDszname()) + .withClaim("dszDeptCode", sysDept.getDszcode()) + .withIssuedAt(new Date()) + .withSubject("admin") + //设置立马过期 + .withExpiresAt(new Date()) + .sign(algorithm); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/LoginEntity.java b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginEntity.java new file mode 100644 index 0000000..82e11d4 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginEntity.java @@ -0,0 +1,32 @@ +package com.mosty.common.core.login; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; + +/** + * 登陆服务 + * @author kevin + * @date 2022/2/15 8:26 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("用户登陆请求") +public class LoginEntity { + + @NotEmpty(message = "用户名不能为空!") + @ApiModelProperty(value = "用户名", required = true) + private String userName; + + @NotEmpty(message = "密码不能为空!") + @ApiModelProperty(value = "密码(密码需要进行base64 加密)", required = true) + private String password; + + @ApiModelProperty(value = "加密token", required = true) + private String token; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/LoginRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginRequest.java new file mode 100644 index 0000000..51dd6cf --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginRequest.java @@ -0,0 +1,35 @@ +package com.mosty.common.core.login; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; + +/** + * 登陆服务 + * @author kevin + * @date 2022/2/15 8:26 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("用户登陆请求") +public class LoginRequest { + + @NotEmpty(message = "用户名不能为空!") + @ApiModelProperty(value = "用户名", required = true) + private String userName; + + @NotEmpty(message = "密码不能为空!") + @ApiModelProperty(value = "密码(密码需要进行base64 加密)", required = true) + private String password; + + @ApiModelProperty(value = "验证码", allowEmptyValue = true) + private String kaptcha; + +// @ApiModelProperty("是否组装vue路由") +// private Boolean wrapRouter = Boolean.TRUE; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/LoginResponseVO.java b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginResponseVO.java new file mode 100644 index 0000000..c65a816 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginResponseVO.java @@ -0,0 +1,108 @@ +package com.mosty.common.core.login; + +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.login.dto.DeptDTO; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Set; + +/** + * 登陆返回信息 + * + * @author kevin + * @date 2022/2/15 10:24 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class LoginResponseVO { +// +// @ApiModelProperty("jwt token信息") +// private String jwtToken; +// +// @ApiModelProperty("用户id") +// private Long userId; +// +// @ApiModelProperty("用户名称") +// private String userName; +// +// @ApiModelProperty("权限信息") +// private UserPermissionsInfo permissionsInfo; +// +// @ApiModelProperty("用户挂的部门集合") +// private List deptList; +// +// @ApiModelProperty("用户挂一级菜单和菜单组") +// private List menuList; +// +// @ApiModelProperty("菜单唯一编码集合") +// private Set menuCodeSet; +// +// @ApiModelProperty("分县局") +// private SysDept fxjDept; +// +// @ApiModelProperty("地市州") +// private SysDept dszDept; +// +// @ApiModelProperty(value = "身份证号") +// private String idEntityCard; + + + @ApiModelProperty("jwt token信息") + private String jwtToken; + + @ApiModelProperty("用户id") + private Long userId; + + @ApiModelProperty("用户名称") + private String userName; + + @ApiModelProperty("用户部门") + private List deptList; + + @ApiModelProperty("用户挂一级菜单和菜单组") + private List menuList; + + @ApiModelProperty("菜单唯一编码集合") + private Set menuCodeSet; + + @ApiModelProperty(value = "身份证号") + private String idEntityCard; + + @ApiModelProperty(value = "是否融合") + private String sfrh; + + @ApiModelProperty(value = "模块") + private String mk; + + + public LoginResponseVO(String jwtToken, Long userId, String userName, List deptList, String idEntityCard, String sfrh, String mk) { + this.jwtToken = jwtToken; + this.userId = userId; + this.userName = userName; + this.deptList = deptList; + this.idEntityCard = idEntityCard; + this.sfrh = sfrh; + this.mk = mk; + } + + public LoginResponseVO(Long userId, String userName, List deptList, + SysDept fxjDept, SysDept dszDept, String idEntityCard, String sfrh, String mk) { + this.userId = userId; + this.userName = userName; + this.deptList = deptList; +// this.fxjDept = fxjDept; +// this.dszDept = dszDept; + this.idEntityCard = idEntityCard; + this.sfrh = sfrh; + this.mk = mk; + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/LoginServiceController.java b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginServiceController.java new file mode 100644 index 0000000..690025f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/LoginServiceController.java @@ -0,0 +1,331 @@ +package com.mosty.common.core.login; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.google.code.kaptcha.Producer; +import com.mosty.common.base.constant.Constants; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.base.util.Base64Util; +import com.mosty.common.base.util.PasswordUtil; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.entity.vo.SysUserVO; +import com.mosty.common.core.business.service.*; +import com.mosty.common.core.config.CaptchaConfig; +import com.mosty.common.core.login.dto.DeptAllVo; +import com.mosty.common.core.login.dto.DeptDTO; +import com.mosty.common.redis.service.RedisService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.nio.charset.StandardCharsets; +import java.util.List; + +import static com.mosty.common.base.constant.Constants.LOGOUT; +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_PREFIX; + +/** + * 登陆服务 + *

+ * jwt: + * secret: "" # 验签的key + * # expiration: 432000 # 配置文件中过期时间,单位秒 + * issuer: "" + * + * @author kevin + * @date 2022/2/15 8:25 PM + * @since 1.0.0 + */ +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/") +@Api(tags = "登陆服务") +public class LoginServiceController { + + private final SysUserService sysUserService; + private final SysDeptService sysDeptService; + private final Producer captchaProducer; + private final RedisService redisService; + private final JwtTokenGenerator jwtTokenGenerator; + private final SysUserRoleService sysUserRoleService; + private final SysRoleService sysRoleService; + private final SysLogininforService sysLogininforService; + private final CaptchaConfig captchaConfig; + private final LoginService loginService; + + @PostMapping("/login") + @ApiOperation(value = "根据账号和密码登录", httpMethod = "POST", response = LoginResponseVO.class) + public ResponseResult login(@Valid @RequestBody LoginRequest dto, HttpServletRequest httpServletRequest) throws Exception { + String status = ""; + String message = ""; + // 验证用户信息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", dto.getUserName()); + queryWrapper.eq("xt_zxbz", "0"); + queryWrapper.or().eq("in_dust_rial_id", dto.getUserName()); + SysUser sysUser = sysUserService.getBaseMapper().selectOne(queryWrapper); + if (sysUser == null) return ResponseResult.fail(String.format("用户名或密码错误!")); + try { + // 验证密码 + String password = new String(Base64Util.decryptBASE64(dto.getPassword().getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + boolean match = PasswordUtil.match(password, sysUser.getPassword()); + if (!match) return ResponseResult.fail("用户名或密码错误!"); + // 查询用户关联的部门 + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO dept = CollectionUtils.isNotEmpty(deptList) ? deptList.get(0) : null; + if (dept == null) throw new BusinessException("用户未绑定任何部门!"); + //创建JWTToken + DeptAllVo allVo = this.sysDeptService.getOrgByDeptId(String.valueOf(dept.getDeptId())); + String jwtToken = jwtTokenGenerator.generateToken(sysUser, allVo); + LoginResponseVO loginResponseVO = new LoginResponseVO(jwtToken, sysUser.getId(), + sysUser.getUserName(), deptList, sysUser.getIdEntityCard() + , sysUser.getSfrh(), sysUser.getMk()); + this.loginService.getMenus(dept, sysUser, loginResponseVO); + // 在数据库中排序,获取第一个作为当前登陆的用户部门 + status = Constants.LOGIN_SUCCESS; + message = "登录成功"; + loginResponseVO.setUserName(sysUser.getUserName()); + redisService.setCacheObject(TOKEN_PREFIX + dept.getDeptId() + ":" + sysUser.getId(), System.currentTimeMillis()); + return ResponseResult.success(loginResponseVO); + } catch (Exception e) { + e.printStackTrace(); + status = Constants.LOGIN_FAIL; + message = "登录失败" + e.getMessage(); + throw new Exception(e.getMessage()); + } finally { + try { + sysLogininforService.recordLogininfor(sysUser, status, message, httpServletRequest, "02"); + } catch (Exception e) { + log.warn("记录日志失败,message={}", e.getMessage()); + e.printStackTrace(); + } + } + } + + + @PostMapping("/loginOauth") + @ApiOperation(value = "根据账号和密码登录(无需权限信息和token)", httpMethod = "POST", response = SysUserVO.class) + public ResponseResult loginOauth(@Valid @RequestBody LoginEntity loginEntity, HttpServletRequest request) throws Exception { + String status = "", message = ""; + // 验证用户信息 + SysUserVO userVO = new SysUserVO(); + SysUser sysUser = sysUserService.getBaseMapper().selectOne( + new LambdaQueryWrapper() + .eq(SysUser::getXtZxbz, "0") + .and( + it -> it.eq(SysUser::getInDustRialId, loginEntity.getUserName()) + .or() + .eq(SysUser::getIdEntityCard, loginEntity.getUserName()) + ) + .last(" limit 1") + ); + if (sysUser == null) return ResponseResult.fail("用户名或密码错误"); + + try { + // 验证密码 + String password = new String(Base64Util.decryptBASE64(loginEntity.getPassword().getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + boolean match = PasswordUtil.match(password, sysUser.getPassword()); + if (!match) return ResponseResult.fail("用户名或密码错误!"); + // 查询用户关联的部门 + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO dept = CollectionUtils.isNotEmpty(deptList) ? deptList.get(0) : null; + if (dept == null) throw new BusinessException("用户未绑定任何部门!"); + //创建JWTToken + DeptAllVo allVo = this.sysDeptService.getOrgByDeptId(String.valueOf(dept.getDeptId())); + String jwtToken = jwtTokenGenerator.generateToken(sysUser, allVo); + LoginResponseVO loginResponseVO = new LoginResponseVO(jwtToken, sysUser.getId(), + sysUser.getUserName(), deptList, sysUser.getIdEntityCard(), sysUser.getSfrh(), sysUser.getMk()); + this.loginService.getMenus(dept, sysUser, loginResponseVO); + // 在数据库中排序,获取第一个作为当前登陆的用户部门 + status = Constants.LOGIN_SUCCESS; + message = "登录成功"; + loginResponseVO.setUserName(sysUser.getUserName()); + redisService.setCacheObject(TOKEN_PREFIX + dept.getDeptId() + ":" + sysUser.getId(), System.currentTimeMillis()); + return ResponseResult.success(loginResponseVO); + } catch (BusinessException e) { + throw e; + } catch (Exception e) { + e.printStackTrace(); + status = Constants.LOGIN_FAIL; + message = "登录失败" + e.getMessage(); + throw new Exception(e.getMessage()); + } finally { + try { + sysLogininforService.recordLogininfor(sysUser, status, message, request, "02"); + } catch (Exception e) { + log.warn("记录日志失败,message={}", e.getMessage()); + e.printStackTrace(); + } + } + } + + // 根据当前部门获取分县局部门 + public SysDept getFxjDept(DeptDTO currentDept) { + if (currentDept == null) { + return null; + } + Long id = null; + String path = currentDept.getPath(); + if (path.contains("_")) { + String[] paths = path.split("_"); + log.info("paths length--->" + paths.length); + if (paths.length == 2) { + id = Long.valueOf(paths[1]); + } else if (paths.length == 3) { + id = Long.valueOf(paths[2]); + } else if (paths.length >= 4) { + id = Long.valueOf(paths[2]); + } + } else { + id = Long.valueOf(path); + } + return sysDeptService.getById(id); + } + + // 根据当前地市州 + public SysDept getDszDept(DeptDTO currentDept) { + if (currentDept == null) return null; + long id; + String path = currentDept.getPath(); + if (path.contains("_")) { + String[] paths = path.split("_"); + id = Long.parseLong(paths[1]); + } else { + id = Long.parseLong(path); + } + return sysDeptService.getById(id); + } + + @PostMapping("/idCardNoLogin") + @ApiOperation(value = "APP--身份证号登陆", httpMethod = "POST", response = LoginResponseVO.class) + public ResponseResult idCardNoLogin(@Valid @RequestBody IdCardLoginRequest idCardLoginRequest, + HttpServletRequest httpServletRequest) throws Exception { + String status = ""; + String message = ""; + SysUser sysUser = null; + try { + // 验证用户信息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idCardLoginRequest.getIdCardNo()); + sysUser = sysUserService.getBaseMapper().selectOne(queryWrapper); + if (sysUser == null) return ResponseResult.fail("用户不存在!!"); + + // 查询用户关联的部门 + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO dept = CollectionUtils.isNotEmpty(deptList) ? deptList.get(0) : null; + //除非用户是超级管理员,否则部门为空不允许登陆 + if (dept == null) return ResponseResult.fail("用户未分配任何部门!!"); + //创建JWTToken + DeptAllVo allVo = this.sysDeptService.getOrgByDeptId(String.valueOf(dept.getDeptId())); + String jwtToken = jwtTokenGenerator.generateToken(sysUser, allVo); + LoginResponseVO loginResponseVO = new LoginResponseVO(jwtToken, sysUser.getId(), sysUser.getUserName(), deptList, + sysUser.getIdEntityCard(), sysUser.getSfrh(), sysUser.getMk()); + // 在数据库中排序,获取第一个作为当前登陆的用户部门 + status = Constants.LOGIN_SUCCESS; + message = "登录成功"; + redisService.setCacheObject(TOKEN_PREFIX + dept.getDeptId() + ":" + sysUser.getId(), System.currentTimeMillis()); + return ResponseResult.success(loginResponseVO); + } catch (Exception e) { + e.printStackTrace(); + status = Constants.LOGIN_FAIL; + message = "登录失败" + e.getMessage(); + throw new Exception(e.getMessage()); + } finally { + if (sysUser != null) { + try { + sysLogininforService.recordLogininfor(sysUser, status, message, httpServletRequest, "01"); + } catch (Exception e) { + log.warn("记录日志失败,message={}", e.getMessage()); + } + } + } + } + + @PostMapping("/ssoLogin") + @ApiOperation(value = "APP--身份证号登陆", httpMethod = "POST", response = LoginResponseVO.class) + public ResponseResult ssoLogin(@RequestBody LoginEntity loginEntity, + HttpServletRequest httpServletRequest) throws Exception { + if (StringUtils.isBlank(loginEntity.getToken())) { + return ResponseResult.fail("用户名不能为空"); + } + String status = "", message = "", userName; + SysUser sysUser = null; + userName = new String(Base64Util.decryptBASE64(loginEntity.getToken().getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + + try { + // 验证用户信息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", userName); + sysUser = sysUserService.getBaseMapper().selectOne(queryWrapper); + if (sysUser == null) return ResponseResult.fail("用户不存在!!"); + // 查询用户关联的部门 + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO dept = CollectionUtils.isNotEmpty(deptList) ? deptList.get(0) : null; + if (dept == null) throw new BusinessException("用户未绑定任何部门!"); + //创建JWTToken + DeptAllVo allVo = this.sysDeptService.getOrgByDeptId(String.valueOf(dept.getDeptId())); + String jwtToken = jwtTokenGenerator.generateToken(sysUser, allVo); + LoginResponseVO loginResponseVO = new LoginResponseVO(jwtToken, sysUser.getId(), + sysUser.getUserName(), deptList, sysUser.getIdEntityCard(), sysUser.getSfrh(), sysUser.getMk()); + this.loginService.getMenus(dept, sysUser, loginResponseVO); + // 在数据库中排序,获取第一个作为当前登陆的用户部门 + status = Constants.LOGIN_SUCCESS; + message = "登录成功"; + loginResponseVO.setUserName(sysUser.getUserName()); + redisService.setCacheObject(TOKEN_PREFIX + dept.getDeptId() + ":" + sysUser.getId(), System.currentTimeMillis()); + return ResponseResult.success(loginResponseVO); + } catch (Exception e) { + e.printStackTrace(); + status = Constants.LOGIN_FAIL; + message = "登录失败" + e.getMessage(); + throw new Exception(e.getMessage()); + } finally { + if (sysUser != null) { + try { + sysLogininforService.recordLogininfor(sysUser, status, message, httpServletRequest, "01"); + } catch (Exception e) { + log.warn("记录日志失败,message={}", e.getMessage()); + } + } + } + } + + + @JwtSysUser + @PostMapping("/loginOut") + @ApiOperation(value = "登出", httpMethod = "POST", response = LoginResponseVO.class) + public ResponseResult loginOut(HttpServletRequest httpServletRequest) throws Exception { + try { + UserInfo userInfo = UserInfoManager.getUser(); + if (userInfo != null) { + SysUser sysUser = sysUserService.getUserInfo(userInfo.getUserId()); + // 查询用户关联的部门 + SysDept sysDept = sysDeptService.getById(userInfo.getDeptId()); + DeptAllVo allVo = this.sysDeptService.getOrgByDeptId(String.valueOf(sysDept.getId())); + // 在数据库中排序,获取第一个作为当前登陆的用户部门 + jwtTokenGenerator.removeToken(sysUser, allVo); + //清除用户jwtToken + redisService.deleteObject(TOKEN_PREFIX + userInfo.getDeptId() + ":" + sysUser.getId()); + sysLogininforService.recordLogininfor(sysUser, LOGOUT, "用户登出", httpServletRequest, "02"); + } + return ResponseResult.success(Boolean.TRUE); + } catch (Exception e) { + log.error("登出错误:", e); + e.printStackTrace(); + throw new Exception(e.getMessage()); + } + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/TokenRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/login/TokenRequest.java new file mode 100644 index 0000000..b3cb4f7 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/TokenRequest.java @@ -0,0 +1,33 @@ +package com.mosty.common.core.login; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 登陆服务 + * @author kevin + * @date 2022/2/15 8:26 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("用户切换部门获取token请求") +public class TokenRequest { + + @NotNull(message = "部门id不能为空!") + @ApiModelProperty("部门id") + private Long deptId; + + @NotEmpty(message = "token!") + @ApiModelProperty("token不能为空") + private String authorization; + + @ApiModelProperty("是否组装vue路由") + private Boolean wrapRouter; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/UnifiedLoginRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/login/UnifiedLoginRequest.java new file mode 100644 index 0000000..bb76457 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/UnifiedLoginRequest.java @@ -0,0 +1,36 @@ +package com.mosty.common.core.login; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; + +/** + * 登陆服务 + * @author + * @date 2022/8/12 8:26 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("用户登陆请求") +public class UnifiedLoginRequest { + + /** + * 登陆token + */ + @NotEmpty(message = "登陆token!") + @ApiModelProperty(value = "登陆token", required = true) + private String token; + + /** + * 密码 + */ + @NotEmpty(message = "系统ID!") + @ApiModelProperty(value = "系统ID", required = false) + private String systemId; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/UserPermissionsInfo.java b/common-core-starter/src/main/java/com/mosty/common/core/login/UserPermissionsInfo.java new file mode 100644 index 0000000..7e7c133 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/UserPermissionsInfo.java @@ -0,0 +1,41 @@ +package com.mosty.common.core.login; + +import com.mosty.common.core.business.entity.SysMenu; +import com.mosty.common.core.login.dto.DeptDTO; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Set; + +/** + * 用户权限信息 + * + * @author Lhh + * @date 2022/06/27 17:24 + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class UserPermissionsInfo { + + @ApiModelProperty("权限过滤条件ids") + private String ids; + + @ApiModelProperty("权限过滤条件orgcodes") + private String orgcodes; + + @ApiModelProperty("权限等级(D_ZDY_SJQX)") + private String permissionsLevel; + + @ApiModelProperty("权限SQL(ssbmid)") + private String permissionsSql; + + @ApiModelProperty("权限SQL(ssbmdm)") + private String permissionsSqlCode; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptAllVo.java b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptAllVo.java new file mode 100644 index 0000000..f3c8f5d --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptAllVo.java @@ -0,0 +1,59 @@ +package com.mosty.common.core.login.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * @author dw + * @since 2022/8/1 + * 返回的组织机构对象,包含所属部门 所属分县局 所属地市州 + **/ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "DeptAllVo 对象", description = "返回的组织机构对象,包含所属部门 所属分县局 所属地市州") +public class DeptAllVo implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("所属部门ID") + private Long deptid; + + @ApiModelProperty("所属部门代码") + private String deptcode; + + @ApiModelProperty("所属部门名称") + private String deptname; + + @ApiModelProperty("部门类型") + private String orgType; + + @ApiModelProperty("部门等级") + private String orgLevel; + + @ApiModelProperty("部门业务等级") + private String orgBizType; + + @ApiModelProperty("所属分县局id") + private Long fxjid; + + @ApiModelProperty("所属分县局代码") + private String fxjcode; + + @ApiModelProperty("所属分现局名称") + private String fxjname; + + @ApiModelProperty("所属地市州id") + private Long dszid; + + @ApiModelProperty("所属地市州代码") + private String dszcode; + + @ApiModelProperty("所属地市州名称") + private String dszname; +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptDTO.java b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptDTO.java new file mode 100644 index 0000000..97db76c --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/DeptDTO.java @@ -0,0 +1,40 @@ +package com.mosty.common.core.login.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 部门信息对象 + * @author kevin + * @date 2022/2/16 9:42 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +public class DeptDTO implements Serializable { + + @ApiModelProperty("部门id") + private Long deptId; + + @ApiModelProperty("部门祖籍列表") + private String path; + + @ApiModelProperty("部门名称") + private String deptName; + + @ApiModelProperty("部门简称") + private String deptJc; + + @ApiModelProperty("部门编码") + private String deptCode; + + @ApiModelProperty("部门等级") + private String deptLevel; + + @ApiModelProperty("所在部门业务类型代码") + private String deptBizType; + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/login/dto/ImageRequest.java b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/ImageRequest.java new file mode 100644 index 0000000..605b0a1 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/login/dto/ImageRequest.java @@ -0,0 +1,29 @@ +package com.mosty.common.core.login.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotEmpty; + +/** + * 图片请求参数 + * @author + * @date 2022/2/15 8:26 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@ApiModel("图片请求参数") +public class ImageRequest { + + /** + * 图片地址 + */ + @NotEmpty(message = "图片地址不能为空!") + @ApiModelProperty(value = "图片地址", required = true) + private String url; + + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/minio/UploadController.java b/common-core-starter/src/main/java/com/mosty/common/core/minio/UploadController.java new file mode 100644 index 0000000..100ee65 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/minio/UploadController.java @@ -0,0 +1,292 @@ +package com.mosty.common.core.minio; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.config.entity.SysConfig; +import com.mosty.common.config.mapper.SysConfigMapper; +import com.mosty.common.core.business.entity.SysOss; +import com.mosty.common.core.business.entity.vo.Base64Str; +import com.mosty.common.core.business.service.SysOssService; +import com.mosty.common.core.config.MinIoClientConfig; +import com.mosty.common.core.util.BASE64DecodedMultipartFile; +import com.mosty.common.util.ImageUtils; +import com.mosty.common.util.UUIDGenerator; +import io.minio.*; +import io.minio.errors.*; +import io.minio.http.Method; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +import javax.servlet.http.HttpServletRequest; +import java.io.*; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +@Slf4j +@RestController +@RequestMapping("/minio") +@AllArgsConstructor +@Api(tags = "图片上传服务") +@SuppressWarnings("unused") +public class UploadController { + + private final MinioClient minioClient; + private final MinIoClientConfig minIoClientConfig; + private final SysOssService sysOssService; + private final SysConfigMapper sysConfigMapper; + + + @GetMapping("/image/downloadBaes64/{id}") + @ApiOperation(value = "获取图片Base64", httpMethod = "GET", response = String.class) + public ResponseResult downloadBaes64(@PathVariable("id") String id) { + try { + if (StringUtils.isEmpty(id)) { + return ResponseResult.success(); + } + SysOss oss = sysOssService.getById(id); + if (!ObjectUtils.isEmpty(oss)) { + byte[] data = ImageUtils.encodeImageToByte(this.getMonioUrl() + oss.getUrl()); + BASE64Encoder encoder = new BASE64Encoder(); + String base64 = encoder.encode(data).replaceAll("[\\s*\t\n\r]", ""); + return ResponseResult.success(base64); + } + return ResponseResult.success(); + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + } + + + @PostMapping("/file/upload") + @ApiOperation(value = "前端上传组件使用:上传文件(返回文件的访问地址)", httpMethod = "POST", response = String.class) + public ResponseResult uploadFile(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) + throws Exception { + if (file.getSize() > 0) { + return uploadOssWithBucket(file, minIoClientConfig.getFileBucket()); + } + return ResponseResult.fail("未选择任何文件,上传失败"); + } + + @PostMapping("/{bucketName}/upload") + @ApiOperation(value = "指定桶上传文件(返回文件的访问地址)", httpMethod = "POST", response = String.class) + public ResponseResult upload(@JSONField(serialize = false) @RequestParam("file") MultipartFile file, + @PathVariable("bucketName") String bucketName) throws Exception { + Asserts.check(StringUtils.isEmpty(bucketName), "桶名称不能为空!"); + boolean bucketExists = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()); + Asserts.check(!bucketExists, "桶%s不存在!", bucketName); + if (file.getSize() > 0) { + return uploadOssWithBucket(file, bucketName); + } + return ResponseResult.fail("未选择任何文件,上传失败"); + } + + @PostMapping("/image/upload/id") + @ApiOperation(value = "前端上传组件使用:上传图片(返回图片ID)", httpMethod = "POST", response = String.class) + public ResponseResult uploadImageId(@JSONField(serialize = false) @RequestParam("file") MultipartFile file) + throws Exception { + if (file.getSize() > 0) { + return uploadOssWithBucketById(file, minIoClientConfig.getImageBucket()); + } + return ResponseResult.fail("文件为空,或文件无内容!!"); + } + + @GetMapping("/image/download/{id}") + @ApiOperation(value = "根据ID下载图片(返回二进制文件)", httpMethod = "GET", response = String.class) + public ResponseEntity downloadImageId(@PathVariable("id") String id, HttpServletRequest request) { + try { + if (StringUtils.isEmpty(id)) { + return ResponseEntity.ok(null); + } + return downloadFile(id, request); + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + } + + @GetMapping("/file/download/{id}") + @ApiOperation(value = "根据ID查询文件的访问地址", httpMethod = "GET", response = String.class) + public ResponseResult> downloadFileId(@PathVariable("id") String id) { + if (StringUtils.isEmpty(id)) { + throw new BusinessException("附件ID不能为空"); + } + return downloadFileById(id); + } + + @GetMapping("/file/getFileList") + @ApiOperation(value = "查询文件", httpMethod = "GET", response = String.class) + public ResponseResult>> getFileList(String fileIds) { + List> list = new ArrayList<>(); + List fileList = Arrays.asList(fileIds.split(",")); + fileList.forEach(item -> { + SysOss oss = this.sysOssService.getById(item); + if (oss != null) { + Map map = new HashMap<>(); + map.put("id", oss.getId()); + map.put("url", this.getMonioUrl() + oss.getUrl()); + map.put("name", oss.getFileName()); + map.put("originalName", oss.getOriginalName()); + map.put("suffix", oss.getFileSuffix()); + list.add(map); + } + }); + return ResponseResult.success(list); + } + + // 获取minio的请求地址 + private String getMonioUrl() { + SysConfig config = this.sysConfigMapper.selectOne( + new LambdaQueryWrapper() + .eq(SysConfig::getPzj, "MINIO_URL") + .eq(SysConfig::getXtZxbz, DeletedEnum.NATURE) + ); + if (config != null) { + return config.getPzz(); + } + return "http://80.35.1.150:9009/"; + } + + @NotNull + private ResponseResult uploadOssWithBucket(MultipartFile file, String bucketName) + throws IOException, ServerException, InsufficientDataException, ErrorResponseException, + NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException { + // 原文件名 + String fileName = file.getOriginalFilename(); + if (StringUtils.isEmpty(fileName)) { + return ResponseResult.fail("文件名不能为空!"); + } + // 文件类型 + String suffixName = fileName.substring(fileName.lastIndexOf(".")); + // 生成新文件名,确保唯一性 + String objectName = UUIDGenerator.getUUID(); + // 文件类型 + String fileType = file.getContentType(); + String fileUrl = DateUtils.datePathString() + "/" + objectName + suffixName; + // 使用putObject上传一个文件到存储桶中 + PutObjectArgs build = PutObjectArgs.builder().object(fileUrl) + .bucket(bucketName) + .contentType(file.getContentType()) + .stream(file.getInputStream(), file.getSize(), -1).build(); + + boolean exist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()); + Asserts.check(!exist, "minio bucket %s 不存在,请联系管理员", bucketName); + minioClient.putObject(build); + // 得到文件 url + String url = bucketName + "/" + fileUrl; + SysOss oss = new SysOss(); + oss.setId(objectName); + oss.setFileName(objectName + suffixName); + oss.setOriginalName(fileName); + oss.setFileSuffix(suffixName); + oss.setUrl(url); + oss.setXtCjsj(new Date()); + oss.setXtLrsj(new Date()); + oss.setXtZhxgsj(new Date()); + oss.setXtZxbz("0"); + sysOssService.save(oss); + return ResponseResult.success(this.getMonioUrl() + url); + } + + @NotNull + private ResponseResult uploadOssWithBucketById(MultipartFile file, String bucketName) throws IOException, + ServerException, InsufficientDataException, ErrorResponseException, NoSuchAlgorithmException, + InvalidKeyException, InvalidResponseException, XmlParserException, InternalException { + // 原文件名 + String fileName = file.getOriginalFilename(); + if (StringUtils.isEmpty(fileName)) { + return ResponseResult.fail("文件名不能为空!"); + } + // 文件类型 + String suffixName = fileName.substring(fileName.lastIndexOf(".")); + // 生成新文件名,确保唯一性 + String objectName = UUIDGenerator.getUUID(); + // 文件类型 + String fileType = file.getContentType(); + String fileUrl = DateUtils.datePathString() + "/" + objectName + suffixName; + // 使用putObject上传一个文件到存储桶中 + PutObjectArgs build = PutObjectArgs.builder().object(fileUrl) + .bucket(bucketName) + .contentType(file.getContentType()) + .stream(file.getInputStream(), file.getSize(), -1).build(); + boolean exist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()); + Asserts.check(!exist, "minio bucket %s 不存在,请联系管理员", bucketName); + minioClient.putObject(build); + // 得到文件 url + String url = bucketName + "/" + fileUrl; + SysOss oss = new SysOss(); + oss.setId(objectName); + oss.setFileName(objectName + suffixName); + oss.setOriginalName(fileName); + oss.setFileSuffix(suffixName); + oss.setUrl(url); + oss.setXtCjsj(new Date()); + oss.setXtLrsj(new Date()); + oss.setXtZhxgsj(new Date()); + oss.setXtZxbz("0"); + sysOssService.save(oss); + return ResponseResult.success(objectName); + } + + // 下载图片(返回文件的URL) + public ResponseResult> downloadFileById(String id) { + try { + SysOss oss = sysOssService.getById(id); + Map map = new HashMap<>(); + map.put("id", oss.getId()); + map.put("url", this.getMonioUrl() + oss.getUrl()); + map.put("name", oss.getFileName()); + map.put("originalName", oss.getOriginalName()); + map.put("suffix", oss.getFileSuffix()); + return ResponseResult.success(map); + } catch (Exception e) { + log.error("Minio-Obs下载对象失败:", e); + throw new BusinessException("获取附件下载地址失败!!"); + } + } + + // 下载图片(返回二进制) + public ResponseEntity downloadFile(String id, HttpServletRequest request) { + try { + + SysOss oss = sysOssService.getById(id); + byte[] obsBytes = ImageUtils.encodeImageToByte(this.getMonioUrl() + oss.getUrl()); + HttpHeaders headers = new HttpHeaders(); + headers.setContentDispositionFormData("attachment", oss.getFileName()); + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); + return new ResponseEntity<>(obsBytes, headers, HttpStatus.CREATED); + } catch (Exception e) { + log.error("Minio-Obs下载对象失败:", e); + throw new BusinessException("下载对象失败"); + } + } + + // inputStream转换成byte数组 + private byte[] inputStreamTobyte(InputStream inputStream) throws IOException { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + byte[] buff = new byte[100]; + int rc; + while ((rc = inputStream.read(buff, 0, 100)) > 0) { + byteArrayOutputStream.write(buff, 0, rc); + } + return byteArrayOutputStream.toByteArray(); + } + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/BASE64DecodedMultipartFile.java b/common-core-starter/src/main/java/com/mosty/common/core/util/BASE64DecodedMultipartFile.java new file mode 100644 index 0000000..1ccd367 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/BASE64DecodedMultipartFile.java @@ -0,0 +1,59 @@ +package com.mosty.common.core.util; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +public class BASE64DecodedMultipartFile implements MultipartFile { + + + private final byte[] imgContent; + private final String header; + + public BASE64DecodedMultipartFile(byte[] imgContent, String header) { + this.imgContent = imgContent; +// this.header = header.split(";")[0]; + this.header = header.split(";")[0]; + } + + @Override + public String getName() { + // TODO - implementation depends on your requirements + return System.currentTimeMillis() + Math.random() + "." + header.split("/")[1]; + } + + @Override + public String getOriginalFilename() { + // TODO - implementation depends on your requirements + return System.currentTimeMillis() + (int)Math.random() * 10000 + "." + header.split("/")[1]; + } + + @Override + public String getContentType() { + // TODO - implementation depends on your requirements + return header.split(":")[1]; + } + + @Override + public boolean isEmpty() { + return imgContent == null || imgContent.length == 0; + } + + @Override + public long getSize() { + return imgContent.length; + } + + @Override + public byte[] getBytes() throws IOException { + return imgContent; + } + + @Override + public InputStream getInputStream() throws IOException { + return new ByteArrayInputStream(imgContent); + } + + @Override + public void transferTo(File dest) throws IOException, IllegalStateException { + new FileOutputStream(dest).write(imgContent); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/Base64Util.java b/common-core-starter/src/main/java/com/mosty/common/core/util/Base64Util.java new file mode 100644 index 0000000..634f7ff --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/Base64Util.java @@ -0,0 +1,83 @@ +package com.mosty.common.core.util; + + +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +import javax.imageio.stream.FileImageInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Base64Util { + /** + * 字符串转图片 + * @param base64Str + * @return + */ + public static byte[] decode(String base64Str){ + byte[] b = null; + BASE64Decoder decoder = new BASE64Decoder(); + try { + b = decoder.decodeBuffer(replaceEnter(base64Str)); + } catch (IOException e) { + e.printStackTrace(); + } + return b; + } + + /** + * 图片转字符串 + * @param image + * @return + */ + public static String encode(byte[] image){ + BASE64Encoder decoder = new BASE64Encoder(); + return replaceEnter(decoder.encode(image)); + } + + public static String encode(String uri){ + BASE64Encoder encoder = new BASE64Encoder(); + return replaceEnter(encoder.encode(uri.getBytes())); + } + /** + * + * @path 图片路径 + * @return + */ + + public static byte[] imageTobyte(String path){ + byte[] data = null; + FileImageInputStream input = null; + try { + input = new FileImageInputStream(new File(path)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buf = new byte[1024]; + int numBytesRead = 0; + while((numBytesRead = input.read(buf)) != -1){ + output.write(buf, 0, numBytesRead); + } + data = output.toByteArray(); + output.close(); + input.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + + return data; + } + + + public static String replaceEnter(String str){ + String reg ="[\n-\r]"; + Pattern p = Pattern.compile(reg); + Matcher m = p.matcher(str); + return m.replaceAll(""); + } + + + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/BeanUtils.java b/common-core-starter/src/main/java/com/mosty/common/core/util/BeanUtils.java new file mode 100644 index 0000000..9101134 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/BeanUtils.java @@ -0,0 +1,104 @@ +package com.mosty.common.core.util; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Bean 工具类 + * + * @author ruoyi + */ +public class BeanUtils extends org.springframework.beans.BeanUtils { + /** + * Bean方法名中属性名开始的下标 + */ + private static final int BEAN_METHOD_PROP_INDEX = 3; + + /** + * 匹配getter方法的正则表达式 + */ + private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); + + /** + * 匹配setter方法的正则表达式 + */ + private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); + + /** + * Bean属性复制工具方法。 + * + * @param dest 目标对象 + * @param src 源对象 + */ + public static void copyBeanProp(Object dest, Object src) { + try { + copyProperties(src, dest); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 获取对象的setter方法。 + * + * @param obj 对象 + * @return 对象的setter方法列表 + */ + public static List getSetterMethods(Object obj) { + // setter方法列表 + List setterMethods = new ArrayList(); + + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + + // 查找setter方法 + + for (Method method : methods) { + Matcher m = SET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 1)) { + setterMethods.add(method); + } + } + // 返回setter方法列表 + return setterMethods; + } + + /** + * 获取对象的getter方法。 + * + * @param obj 对象 + * @return 对象的getter方法列表 + */ + + public static List getGetterMethods(Object obj) { + // getter方法列表 + List getterMethods = new ArrayList(); + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + // 查找getter方法 + for (Method method : methods) { + Matcher m = GET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 0)) { + getterMethods.add(method); + } + } + // 返回getter方法列表 + return getterMethods; + } + + /** + * 检查Bean方法名中的属性名是否相等。
+ * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 + * + * @param m1 方法名1 + * @param m2 方法名2 + * @return 属性名一样返回true,否则返回false + */ + + public static boolean isMethodPropEquals(String m1, String m2) { + return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/CacheUtils.java b/common-core-starter/src/main/java/com/mosty/common/core/util/CacheUtils.java new file mode 100644 index 0000000..241b869 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/CacheUtils.java @@ -0,0 +1,179 @@ +package com.mosty.common.core.util; + +import com.mosty.common.base.util.SpringIocContext; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.cache.Cache; +import org.apache.shiro.cache.CacheManager; +import org.apache.shiro.cache.ehcache.EhCacheManager; + +import java.util.Iterator; +import java.util.Set; + +/** + * Cache工具类 + * + * @author ruoyi + */ +@Slf4j +public class CacheUtils { + + private static CacheManager cacheManager = SpringIocContext.getBean(CacheManager.class); + + private static final String SYS_CACHE = "sys-cache"; + + /** + * 获取SYS_CACHE缓存 + * + * @param key + * @return + */ + public static Object get(String key) { + return get(SYS_CACHE, key); + } + + /** + * 获取SYS_CACHE缓存 + * + * @param key + * @param defaultValue + * @return + */ + public static Object get(String key, Object defaultValue) { + Object value = get(key); + return value != null ? value : defaultValue; + } + + /** + * 写入SYS_CACHE缓存 + * + * @param key + * @return + */ + public static void put(String key, Object value) { + put(SYS_CACHE, key, value); + } + + /** + * 从SYS_CACHE缓存中移除 + * + * @param key + * @return + */ + public static void remove(String key) { + remove(SYS_CACHE, key); + } + + /** + * 获取缓存 + * + * @param cacheName + * @param key + * @return + */ + public static Object get(String cacheName, String key) { + return getCache(cacheName).get(getKey(key)); + } + + /** + * 获取缓存 + * + * @param cacheName + * @param key + * @param defaultValue + * @return + */ + public static Object get(String cacheName, String key, Object defaultValue) { + Object value = get(cacheName, getKey(key)); + return value != null ? value : defaultValue; + } + + /** + * 写入缓存 + * + * @param cacheName + * @param key + * @param value + */ + public static void put(String cacheName, String key, Object value) { + getCache(cacheName).put(getKey(key), value); + } + + /** + * 从缓存中移除 + * + * @param cacheName + * @param key + */ + public static void remove(String cacheName, String key) { + getCache(cacheName).remove(getKey(key)); + } + + /** + * 从缓存中移除所有 + * + * @param cacheName + */ + public static void removeAll(String cacheName) { + Cache cache = getCache(cacheName); + Set keys = cache.keys(); + for (Iterator it = keys.iterator(); it.hasNext(); ) { + cache.remove(it.next()); + } + log.info("清理缓存: {} => {}", cacheName, keys); + } + + /** + * 从缓存中移除指定key + * + * @param keys + */ + public static void removeByKeys(Set keys) { + removeByKeys(SYS_CACHE, keys); + } + + /** + * 从缓存中移除指定key + * + * @param cacheName + * @param keys + */ + public static void removeByKeys(String cacheName, Set keys) { + for (Iterator it = keys.iterator(); it.hasNext(); ) { + remove(it.next()); + } + log.info("清理缓存: {} => {}", cacheName, keys); + } + + /** + * 获取缓存键名 + * + * @param key + * @return + */ + private static String getKey(String key) { + return key; + } + + /** + * 获得一个Cache,没有则显示日志。 + * + * @param cacheName + * @return + */ + public static Cache getCache(String cacheName) { + Cache cache = cacheManager.getCache(cacheName); + if (cache == null) { + throw new RuntimeException("当前系统中没有定义“" + cacheName + "”这个缓存。"); + } + return cache; + } + + /** + * 获取所有缓存 + * + * @return 缓存组 + */ + public static String[] getCacheNames() { + return ((EhCacheManager) cacheManager).getCacheManager().getCacheNames(); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/HttpClientUtil.java b/common-core-starter/src/main/java/com/mosty/common/core/util/HttpClientUtil.java new file mode 100644 index 0000000..6670c2f --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/HttpClientUtil.java @@ -0,0 +1,129 @@ +package com.mosty.common.core.util; + +import com.alibaba.fastjson.JSON; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLContexts; +import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.util.CollectionUtils; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.Map; + +/** + * DATE: 18/9/3 + * + * @author: wan + */ +@Slf4j +public class HttpClientUtil { + + private static final String UTF_8 = "UTF-8"; + + private static final int TIME_OUT = 60000; + + /** + * post 参数json字符串,返回String + * + * @param uri 请求uri + * @return 返回结果 + */ + public static HttpResponse postRequest(String uri, Map headerMap) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException { + log.info("httpclient调用地址为:{},加密后身份证号 :{}", uri); +// String output; + HttpResponse response; + CloseableHttpClient httpClient; + + if (uri.startsWith("https")) { + SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory( + SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build(), NoopHostnameVerifier.INSTANCE); + httpClient = HttpClients.custom().setSSLSocketFactory(scsf).build(); + } else { + httpClient = HttpClients.createDefault(); + } + try { + HttpPost postRequest = new HttpPost(uri); + //设置超时时间。 + RequestConfig requestConfig = setRequestConfig(); + postRequest.setConfig(requestConfig); + if (!CollectionUtils.isEmpty(headerMap)) { + headerMap.forEach(postRequest::setHeader); + } + + response = httpClient.execute(postRequest); + +// = EntityUtils.toString(response.getEntity(), UTF_8); + } catch (IOException e) { + throw new RuntimeException("POST调用异常", e); + } finally { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return response; + } + + public static void main(String[] args) throws UnsupportedEncodingException { + String uri ="http://10.68.2.210:7001/login/app?key=asdasd+"; + String url = URLEncoder.encode(uri, "UTF-8"); + System.out.println(url); + + } + + /** + * 绕过证书 + * @return + */ + public static CloseableHttpClient wrapHttpsClient() { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); + X509TrustManager tm = new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] arg0, + String arg1) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] arg0, + String arg1) throws CertificateException { + } + }; + ctx.init(null, new TrustManager[] { tm }, null); + SSLConnectionSocketFactory ssf = new SSLConnectionSocketFactory( + ctx, NoopHostnameVerifier.INSTANCE); + CloseableHttpClient httpclient = HttpClients.custom() + .setSSLSocketFactory(ssf).build(); + return httpclient; + } catch (Exception e) { + log.error("顺丰HttpClient异常", e); + return HttpClients.createDefault(); + } + } + + private static RequestConfig setRequestConfig(){ + return RequestConfig.custom().setSocketTimeout(TIME_OUT).setConnectTimeout(TIME_OUT).build(); + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/KafkaProducerConfig.java b/common-core-starter/src/main/java/com/mosty/common/core/util/KafkaProducerConfig.java new file mode 100644 index 0000000..a865465 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/KafkaProducerConfig.java @@ -0,0 +1,70 @@ +package com.mosty.common.core.util; + +//import org.apache.kafka.clients.producer.ProducerConfig; +//import org.apache.kafka.common.serialization.StringSerializer; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.kafka.core.DefaultKafkaProducerFactory; +//import org.springframework.kafka.core.KafkaTemplate; +//import org.springframework.kafka.core.ProducerFactory; +// +//import java.util.HashMap; +//import java.util.Map; +// +//@Configuration +public class KafkaProducerConfig { +//// @Value("${spring.kafka.bootstrap-servers}") +// private static String servers = "82.157.32.48:9092"; +//// @Value("${spring.kafka.producer.retries}") +// private static int retries = 0; +//// @Value("${spring.kafka.producer.acks}") +// private static String acks = "1"; +//// @Value("${spring.kafka.producer.batch-size}") +// private static int batchSize = 16384; +//// @Value("${spring.kafka.producer.properties.linger.ms}") +// private static int linger = 0; +//// @Value("${spring.kafka.producer.buffer-memory}") +// private static int bufferMemory = 33554432; +// +// public static Map producerConfigs() { +// Map props = new HashMap<>(); +// props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, servers); +// props.put(ProducerConfig.RETRIES_CONFIG, retries); +// props.put(ProducerConfig.ACKS_CONFIG, acks); +// props.put(ProducerConfig.BATCH_SIZE_CONFIG, batchSize); +// props.put(ProducerConfig.LINGER_MS_CONFIG, linger); +// props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, bufferMemory); +// props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); +// props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class); +// return props; +// } +// +// public static ProducerFactory producerFactory() { +// return new DefaultKafkaProducerFactory<>(producerConfigs()); +// } +// +//// @Bean +// public static KafkaTemplate kafkaTemplate() { +// KafkaTemplate template = new KafkaTemplate(producerFactory()); +// template.setDefaultTopic("platform-log1"); // 设置默认的 topic +// return template; +// } +// +// public static void main(String[] args) { +// KafkaTemplate template = KafkaProducerConfig.kafkaTemplate(); +// template.setDefaultTopic("2022-09-16---aaaaaaaaaaaaa"); +// template.send("platform-log1", "2022-09-16---bbbbbbbbbbb").addCallback(success -> { +// // 消息发送到的topic +// String topic = success.getRecordMetadata().topic(); +// // 消息发送到的分区 +// int partition = success.getRecordMetadata().partition(); +// // 消息在分区内的offset +// long offset = success.getRecordMetadata().offset(); +// System.out.println("发送消息成功:" + topic + "-" + partition + "-" + offset); +// }, failure -> { +// System.out.println("发送消息失败:" + failure.getMessage()); +// }); +// } + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/RSAUtil.java b/common-core-starter/src/main/java/com/mosty/common/core/util/RSAUtil.java new file mode 100644 index 0000000..eaf26a7 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/RSAUtil.java @@ -0,0 +1,278 @@ +package com.mosty.common.core.util; + + +import org.apache.tomcat.util.codec.binary.Base64; + +import javax.crypto.Cipher; +import java.security.*; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.HashMap; +import java.util.Map; + +/** + * RSA加密和解密工具 + */ +public class RSAUtil { + + /** + * 数字签名,密钥算法 + */ + private static final String RSA_KEY_ALGORITHM = "RSA"; + + /** + * 数字签名签名/验证算法 + */ + private static final String SIGNATURE_ALGORITHM = "MD5withRSA"; + + /** + * RSA密钥长度,RSA算法的默认密钥长度是1024密钥长度必须是64的倍数,在512到65536位之间 + */ + private static final int KEY_SIZE = 1024; + + /** + * 生成密钥对 + */ + private static Map initKey() throws Exception { + KeyPairGenerator keygen = KeyPairGenerator.getInstance(RSA_KEY_ALGORITHM); + SecureRandom secrand = new SecureRandom(); + /** + * 初始化随机产生器 + */ + secrand.setSeed("initSeed".getBytes()); + /** + * 初始化密钥生成器 + */ + keygen.initialize(KEY_SIZE, secrand); + KeyPair keys = keygen.genKeyPair(); + + byte[] pub_key = keys.getPublic().getEncoded(); + String publicKeyString = Base64.encodeBase64String(pub_key); + + byte[] pri_key = keys.getPrivate().getEncoded(); + String privateKeyString = Base64.encodeBase64String(pri_key); + + Map keyPairMap = new HashMap<>(); + keyPairMap.put("publicKeyString", publicKeyString); + keyPairMap.put("privateKeyString", privateKeyString); + + return keyPairMap; + } + + /** + * 密钥转成字符串 + * + * @param key + * @return + */ + public static String encodeBase64String(byte[] key) { + return Base64.encodeBase64String(key); + } + + /** + * 密钥转成byte[] + * + * @param key + * @return + */ + public static byte[] decodeBase64(String key) { + return Base64.decodeBase64(key); + } + + /** + * 公钥加密 + * + * @param data 加密前的字符串 + * @param publicKey 公钥 + * @return 加密后的字符串 + * @throws Exception + */ + public static String encryptByPubKey(String data, String publicKey) throws Exception { + byte[] pubKey = RSAUtil.decodeBase64(publicKey); + byte[] enSign = encryptByPubKey(data.getBytes(), pubKey); + return Base64.encodeBase64String(enSign); + } + + /** + * 公钥加密 + * + * @param data 待加密数据 + * @param pubKey 公钥 + * @return + * @throws Exception + */ + public static byte[] encryptByPubKey(byte[] data, byte[] pubKey) throws Exception { + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey); + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + PublicKey publicKey = keyFactory.generatePublic(x509KeySpec); + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + return cipher.doFinal(data); + } + + /** + * 私钥加密 + * + * @param data 加密前的字符串 + * @param privateKey 私钥 + * @return 加密后的字符串 + * @throws Exception + */ + public static String encryptByPriKey(String data, String privateKey) throws Exception { + byte[] priKey = RSAUtil.decodeBase64(privateKey); + byte[] enSign = encryptByPriKey(data.getBytes(), priKey); + return Base64.encodeBase64String(enSign); + } + + /** + * 私钥加密 + * + * @param data 待加密的数据 + * @param priKey 私钥 + * @return 加密后的数据 + * @throws Exception + */ + public static byte[] encryptByPriKey(byte[] data, byte[] priKey) throws Exception { + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey); + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + cipher.init(Cipher.ENCRYPT_MODE, privateKey); + return cipher.doFinal(data); + } + + /** + * 公钥解密 + * + * @param data 待解密的数据 + * @param pubKey 公钥 + * @return 解密后的数据 + * @throws Exception + */ + public static byte[] decryptByPubKey(byte[] data, byte[] pubKey) throws Exception { + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey); + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + PublicKey publicKey = keyFactory.generatePublic(x509KeySpec); + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + cipher.init(Cipher.DECRYPT_MODE, publicKey); + return cipher.doFinal(data); + } + + /** + * 公钥解密 + * + * @param data 解密前的字符串 + * @param publicKey 公钥 + * @return 解密后的字符串 + * @throws Exception + */ + public static String decryptByPubKey(String data, String publicKey) throws Exception { + byte[] pubKey = RSAUtil.decodeBase64(publicKey); + byte[] design = decryptByPubKey(Base64.decodeBase64(data), pubKey); + return new String(design); + } + + /** + * 私钥解密 + * + * @param data 待解密的数据 + * @param priKey 私钥 + * @return + * @throws Exception + */ + public static byte[] decryptByPriKey(byte[] data, byte[] priKey) throws Exception { + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey); + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + return cipher.doFinal(data); + } + + /** + * 私钥解密 + * + * @param data 解密前的字符串 + * @param privateKey 私钥 + * @return 解密后的字符串 + * @throws Exception + */ + public static String decryptByPriKey(String data, String privateKey) throws Exception { + byte[] priKey = RSAUtil.decodeBase64(privateKey); + byte[] design = decryptByPriKey(Base64.decodeBase64(data), priKey); + return new String(design); + } + + /** + * RSA签名 + * + * @param data 待签名数据 + * @param priKey 私钥 + * @return 签名 + * @throws Exception + */ + public static String sign(byte[] data, byte[] priKey) throws Exception { + // 取得私钥 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey); + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + // 生成私钥 + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + // 实例化Signature + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + // 初始化Signature + signature.initSign(privateKey); + // 更新 + signature.update(data); + return Base64.encodeBase64String(signature.sign()); + } + + /** + * RSA校验数字签名 + * + * @param data 待校验数据 + * @param sign 数字签名 + * @param pubKey 公钥 + * @return boolean 校验成功返回true,失败返回false + */ + public boolean verify(byte[] data, byte[] sign, byte[] pubKey) throws Exception { + // 实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + // 初始化公钥 + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey); + // 产生公钥 + PublicKey publicKey = keyFactory.generatePublic(x509KeySpec); + // 实例化Signature + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + // 初始化Signature + signature.initVerify(publicKey); + // 更新 + signature.update(data); + // 验证 + return signature.verify(sign); + } + + public static void main(String[] args) { + try { + Map keyMap = initKey(); + String publicKeyString = keyMap.get("publicKeyString"); + String privateKeyString = keyMap.get("privateKeyString"); + System.out.println("公钥:" + publicKeyString); + System.out.println("私钥:" + privateKeyString); + + // 待加密数据 + String data = "admin123"; + // 公钥加密 + String encrypt = RSAUtil.encryptByPubKey(data, publicKeyString); + // 私钥解密 + String decrypt = RSAUtil.decryptByPriKey(encrypt, privateKeyString); + + System.out.println("加密前:" + data); + System.out.println("加密后:" + encrypt); + System.out.println("解密后:" + decrypt); + } catch (Exception e) { + e.printStackTrace(); + } + } +} + + diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/ShiroUtils.java b/common-core-starter/src/main/java/com/mosty/common/core/util/ShiroUtils.java new file mode 100644 index 0000000..839b228 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/ShiroUtils.java @@ -0,0 +1,75 @@ +package com.mosty.common.core.util; + +import com.mosty.common.base.entity.realm.SysUser; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.crypto.SecureRandomNumberGenerator; +import org.apache.shiro.session.Session; +import org.apache.shiro.subject.PrincipalCollection; +import org.apache.shiro.subject.SimplePrincipalCollection; +import org.apache.shiro.subject.Subject; + +import java.util.Objects; + +/** + * shiro 工具类 + * + * @author ruoyi + */ +public class ShiroUtils { + public static Subject getSubject() { + return SecurityUtils.getSubject(); + } + + public static Session getSession() { + return SecurityUtils.getSubject().getSession(); + } + + public static void logout() { + getSubject().logout(); + } + + public static SysUser getSysUser() { + SysUser user = null; + Object obj = getSubject().getPrincipal(); + if (!Objects.isNull(obj)) { + user = new SysUser(); + BeanUtils.copyBeanProp(user, obj); + } + return user; + } + + public static void setSysUser(SysUser user) { + Subject subject = getSubject(); + PrincipalCollection principalCollection = subject.getPrincipals(); + String realmName = principalCollection.getRealmNames().iterator().next(); + PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName); + // 重新加载Principal + subject.runAs(newPrincipalCollection); + } + + public static Long getUserId() { + return getSysUser().getUserId().longValue(); + } + + public static String getLoginName() { + return getSysUser().getLoginName(); + } + + public static String getIp() { + return getSubject().getSession().getHost(); + } + + public static String getSessionId() { + return String.valueOf(getSubject().getSession().getId()); + } + + /** + * 生成随机盐 + */ + public static String randomSalt() { + // 一个Byte占两个字节,此处生成的3字节,字符串长度为6 + SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator(); + String hex = secureRandom.nextBytes(3).toHex(); + return hex; + } +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpUtils.java b/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpUtils.java new file mode 100644 index 0000000..959d38e --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpUtils.java @@ -0,0 +1,463 @@ +package com.mosty.common.core.util.http; + +import java.io.*; +import java.net.*; +import java.util.Map; + +public class HttpUtils { + + public static final String POST = "POST"; + + public static final String GET = "GET"; + + public static final int CONNECTTIMEOUT = 10 * 60 * 1000; + + public static final int READTIMEOUT = 10 * 60 * 1000; + + public static final String charset = "utf-8"; + + public static final String DEFAULT_CONTENT_TYPE = "application/x-www-form-urlencoded"; + + public static final String JSON_CONTENT_TYPE = "application/json"; + + public static final String XML_CONTENT_TYPE = "application/xml"; + + public static String executePost(String urlStr, Map params, + Map headerOpitions) { + return executeHttpMethod(POST, urlStr, params, headerOpitions); + } + + /** + * post请求 + * @param urlStr + * @param params + * @return + */ + public static String executePost(String urlStr, Map params) { + return executeHttpMethod(POST, urlStr, params); + } + + /** + * @Title http POST json数据 + * @author lijiaqi + * @description + * @param urlStr + * @param jsonStr + * @return + */ + public static String executeHttpsPostJSON(String urlStr, String jsonStr, Map headerOpitions) { + return executeHttpsPost(urlStr, jsonStr, JSON_CONTENT_TYPE, headerOpitions); + } + + /** + * @Title http POST json数据 + * @author lijiaqi + * @description + * @param urlStr + * @param jsonStr + * @return + */ + public static String executePostJSON(String urlStr, String jsonStr, Map headerOpitions) { + return executePost(urlStr, jsonStr, JSON_CONTENT_TYPE, headerOpitions); + } + + + /** + * + * @Title http post xml数据 + * @author lijiaqi + * @description + * @param urlStr + * @param xmlStr + * @return + */ + public static String executePostXML(String urlStr, String xmlStr, Map headerOpitions) { + return executePost(urlStr, xmlStr, XML_CONTENT_TYPE, headerOpitions); + } + + public static String executePost(String urlStr, String postStr, String contenType, Map headerOptions) { + String result = null; + URL url = null; + HttpURLConnection connection = null; + String method = "POST"; + InputStreamReader in = null; + try { + + url = new URL(urlStr); + connection = (HttpURLConnection) url.openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod(method); + connection.setRequestProperty("Content-Type", contenType); + connection.setRequestProperty("Charset", "UTF-8"); + connection.setConnectTimeout(CONNECTTIMEOUT); + connection.setReadTimeout(READTIMEOUT); + if (headerOptions != null && headerOptions.size() > 0) { + for (String key : headerOptions.keySet()) { + connection.setRequestProperty(key, headerOptions.get(key)); + } + } + + if (method.equals(POST)) { + DataOutputStream dop = new DataOutputStream(connection.getOutputStream()); + dop.write(postStr.getBytes("UTF-8")); + dop.flush(); + dop.close(); + } + // 连接 + connection.connect(); + int code = connection.getResponseCode(); + // 如果返回状态码200 + if (200 == code) { + // 读取返回数据 + in = new InputStreamReader(connection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(in); + StringBuffer strBuffer = new StringBuffer(); + String line = null; + while ((line = bufferedReader.readLine()) != null) { + strBuffer.append(line); + } + result = strBuffer.toString(); + } + if (code > 400) { + System.err.println("请求出错状态码: " + code); + throw new RuntimeException("code " + code); + + } + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new RuntimeException("不合法的http地址", e); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("读取数据失败", e); + } finally { + if (connection != null) { + connection.disconnect(); + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("关闭流失败", e); + } + } + } + return result; + + } + + /** + * https请求 + * @param urlStr + * @param postStr + * @param contenType + * @param headerOptions + * @return + */ + public static String executeHttpsPost(String urlStr, String postStr, String contenType, + Map headerOptions) { + String result = null; + URL url = null; + HttpURLConnection connection = null; + String method = "POST"; + InputStreamReader in = null; + try { + + url = new URL(urlStr); + connection = (HttpURLConnection) url.openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod(method); + connection.setRequestProperty("Content-Type", contenType); + connection.setRequestProperty("Charset", "UTF-8"); + connection.setConnectTimeout(CONNECTTIMEOUT); + connection.setReadTimeout(READTIMEOUT); + if (headerOptions != null && headerOptions.size() > 0) { + for (String key : headerOptions.keySet()) { + connection.setRequestProperty(key, headerOptions.get(key)); + } + } + + if (method.equals(POST)) { + DataOutputStream dop = new DataOutputStream(connection.getOutputStream()); + dop.write(postStr.getBytes("UTF-8")); + dop.flush(); + dop.close(); + } + // 连接 + connection.connect(); + int code = connection.getResponseCode(); + // 如果返回状态码200 + if (200 == code) { + // 读取返回数据 + in = new InputStreamReader(connection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(in); + StringBuffer strBuffer = new StringBuffer(); + String line = null; + while ((line = bufferedReader.readLine()) != null) { + strBuffer.append(line); + } + result = strBuffer.toString(); + } + System.err.println("请求出错状态码: " + code); + if (code > 400) { + System.err.println("请求出错状态码: " + code); + throw new RuntimeException("code " + code); + + } + } catch (MalformedURLException e) { + System.out.println("MalformedURLException: " + e.getMessage()); + e.printStackTrace(); + throw new RuntimeException("不合法的http地址", e); + } catch (IOException e) { + e.printStackTrace(); + System.out.println("IOException: " + e.getMessage()); + throw new RuntimeException("读取数据失败", e); + } finally { + if (connection != null) { + connection.disconnect(); + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("关闭流失败", e); + } + } + } + return result; + + } + + /** + * post请求 + * @param urlStr + * @return + */ + public static String executePost(String urlStr, String postStr, Map headerOptions) { + return executePost(urlStr, postStr, "application/x-www-form-urlencoded", headerOptions); + } + + /** + * get请求 + * @param urlStr + * @param params + * @return + */ + public static String executeGet(String urlStr, Map params) { + return executeHttpMethod(GET, urlStr, params); + } + + /** + * get请求 + * @param urlStr + * @param params + * @return + */ + public static String executeGet(String urlStr, Map params, + Map headerOpitions) { + return executeHttpMethod(GET, urlStr, params, headerOpitions); + } + + public static String executeHttpMethod(String method, String urlStr, + Map params) { + return executeHttpMethod(method, urlStr, params, null); + } + + public static String executeHttpMethod(String method, String urlStr, Map params, + Map headerOptions, String proxyHost, + int proxyPort) { + Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)); + String result = null; + URL url = null; + HttpURLConnection connection = null; + InputStreamReader in = null; + try { + if (method.equals(GET)) { + urlStr = String.format("%s?%s", urlStr, buildParamsString(params)); + } + url = new URL(urlStr); + connection = (HttpURLConnection) url.openConnection(proxy); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod(method); + connection.setRequestProperty("Content-Type", + "application/x-www-form-urlencoded; charset=UTF-8"); + connection.setRequestProperty("Charset", "UTF-8"); + + if (headerOptions != null && headerOptions.size() > 0) { + for (String key : headerOptions.keySet()) { + connection.setRequestProperty(key, headerOptions.get(key)); + } + } + + connection.setConnectTimeout(5000); + connection.setReadTimeout(10000); + if (method.equals(POST)) { + DataOutputStream dop = new DataOutputStream(connection.getOutputStream()); + // 构建传递参数 + String paramStr = buildParamsString(params); + dop.write(paramStr.getBytes()); + dop.flush(); + dop.close(); + } + // 连接 + connection.connect(); + int code = connection.getResponseCode(); + + if (code > 400) { + throw new RuntimeException("code " + code); + } + // 如果返回状态码200 + if (200 == code) { + // 读取返回数据 + in = new InputStreamReader(connection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(in); + StringBuffer strBuffer = new StringBuffer(); + String line = null; + while ((line = bufferedReader.readLine()) != null) { + strBuffer.append(line); + } + result = strBuffer.toString(); + } + } catch (MalformedURLException e) { + throw new RuntimeException("不合法的http地址", e); + } catch (IOException e) { + throw new RuntimeException("读取数据失败", e); + } finally { + if (connection != null) { + connection.disconnect(); + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + throw new RuntimeException("关闭流失败", e); + } + } + } + return result; + } + + public static String executeHttpMethod(String method, String urlStr, Map params, + Map headerOptions) { + String result = null; + URL url = null; + HttpURLConnection connection = null; + InputStreamReader in = null; + try { + if (method.equals(GET)) { + urlStr = String.format("%s?%s", urlStr, buildParamsString(params)); + } + url = new URL(urlStr); + connection = (HttpURLConnection) url.openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setConnectTimeout(60000); + connection.setReadTimeout(60000); + connection.setRequestMethod(method); + connection.setRequestProperty("Content-Type", + "application/x-www-form-urlencoded; charset=UTF-8"); + connection.setRequestProperty("Charset", "UTF-8"); + + if (headerOptions != null && headerOptions.size() > 0) { + for (String key : headerOptions.keySet()) { + connection.setRequestProperty(key, headerOptions.get(key)); + } + } + + connection.setConnectTimeout(CONNECTTIMEOUT); + connection.setReadTimeout(READTIMEOUT); + if (method.equals(POST)) { + DataOutputStream dop = new DataOutputStream(connection.getOutputStream()); + // 构建传递参数 + String paramStr = buildParamsString(params); + dop.write(paramStr.getBytes()); + dop.flush(); + dop.close(); + } + // 连接 + connection.connect(); + int code = connection.getResponseCode(); + + if (code > 400) { + throw new RuntimeException("code " + code); + } + // 如果返回状态码200 + if (200 == code) { + // 读取返回数据 + in = new InputStreamReader(connection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(in); + StringBuffer strBuffer = new StringBuffer(); + String line = null; + while ((line = bufferedReader.readLine()) != null) { + strBuffer.append(line); + } + result = strBuffer.toString(); + } + } catch (MalformedURLException e) { + throw new RuntimeException("不合法的http地址", e); + } catch (IOException e) { + throw new RuntimeException("读取数据失败", e); + } finally { + if (connection != null) { + connection.disconnect(); + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + throw new RuntimeException("关闭流失败", e); + } + } + } + return result; + } + + /** + * 是否是存在的文件 + * @param ulrStr + * @return + */ + public static boolean isNetFileAvailable(String ulrStr) { + try { + //设置此类是否应该自动执行 HTTP 重定向(响应代码为 3xx 的请求)。 + HttpURLConnection.setFollowRedirects(false); + //到 URL 所引用的远程对象的连接 + HttpURLConnection con = (HttpURLConnection) new URL(ulrStr).openConnection(); + /* 设置 URL 请求的方法, GET POST HEAD OPTIONS PUT DELETE TRACE 以上方法之一是合法的,具体取决于协议的限制。*/ + con.setRequestMethod("HEAD"); + //从 HTTP 响应消息获取状态码 + return (con.getResponseCode() == HttpURLConnection.HTTP_OK); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 构建参数字符串 + * + * @param params + * @return + * @throws UnsupportedEncodingException + */ + private static String buildParamsString(Map params) throws UnsupportedEncodingException { + StringBuffer paramsBuffer = new StringBuffer(); + int flag = 0; + if (params != null) { + for (String key : params.keySet()) { + if (flag != 0) { + paramsBuffer.append("&"); + } + String value = URLEncoder.encode(String.valueOf(params.get(key)), "utf-8"); + paramsBuffer.append(key).append("=").append(value); + flag = 1; + } + } + return paramsBuffer.toString(); + } + +} diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpsPostUtil.java b/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpsPostUtil.java new file mode 100644 index 0000000..ef82502 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/http/HttpsPostUtil.java @@ -0,0 +1,259 @@ +package com.mosty.common.core.util.http; + +import org.apache.commons.lang3.StringUtils; + +import javax.net.ssl.*; +import javax.servlet.http.HttpServletRequest; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.security.cert.X509Certificate; +import java.util.HashMap; +import java.util.Map; + +public class HttpsPostUtil { + //添加主机名验证程序类,设置不验证主机 + private final static HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + //添加信任主机 + private static void trustAllHosts() { + // 创建不验证证书链的信任管理器 这里使用的是x509证书 + TrustManager[] trustAllCerts = new TrustManager[]{new MyX509TrustManager() { + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + + public void checkClientTrusted(X509Certificate[] chain, String authType) { + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) { + } + }}; + // 安装所有信任的信任管理器 + try { + SSLContext sc = SSLContext.getInstance("TLS"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + //HttpsURLConnection通过SSLSocket来建立与HTTPS的安全连接,SSLSocket对象是由SSLSocketFactory生成的。 + HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 发送post 数据 + * @param urls + * @return + */ + public static String heart(String urls, String param, String contentType, String method) { + StringBuffer sb=new StringBuffer(); + DataOutputStream out = null; + BufferedReader responseReader = null; + InputStream in1 = null; + try { + trustAllHosts(); + // 创建url资源 + URL url = new URL(urls); + // 建立http连接 + HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); + conn.setHostnameVerifier(DO_NOT_VERIFY); + // 设置不用缓存 + conn.setUseCaches(false); + // 设置允许输出 + conn.setDoOutput(true); + // 设置允许输入 + conn.setDoInput(true); + // 设置传递方式 + conn.setRequestMethod(method); + //System.out.println(conn.getRequestMethod()); + // 设置维持长连接 + conn.setRequestProperty("Connection", "Keep-Alive"); + // 设置文件字符集: + conn.setRequestProperty("Charset", "UTF-8"); + // 转换为字节数组 +// byte[] data = (param).getBytes(); +// // 设置文件长度 +// conn.setRequestProperty("Content-Length", String.valueOf(data.length)); + // 设置文件类型: + conn.setRequestProperty("Content-Type", contentType); + conn.setRequestProperty("Authorization", param); + // 开始连接请求 + conn.connect(); + out = new DataOutputStream(conn.getOutputStream()); + // 写入请求的字符串 + out.writeBytes(param); + out.flush(); + + //System.out.println(conn.getResponseCode()); + + // 请求返回的状态 + if (HttpURLConnection.HTTP_OK == conn.getResponseCode()) { + System.out.println("连接成功"); + // 请求返回的数据 + in1 = conn.getInputStream(); + String readLine; + responseReader = new BufferedReader(new InputStreamReader(in1)); + while((readLine=responseReader.readLine()) != null){ + sb.append(readLine).append("\n"); + } + } else { + System.out.println("error++"); + } + } catch (Exception e) { + + } finally { + try { + if (null != responseReader) + responseReader.close(); + if (null != in1) + in1.close(); + } catch(Exception e) {} + try { + out.close(); + } catch(Exception e) {} + } + + return sb.toString(); + + } + + /** + * 发送post 数据 + * @param urls + * @return + */ + public static String sendPost(String urls, String param, String contentType, String method, Map headerOptions) { + StringBuffer sb=new StringBuffer(); + DataOutputStream out = null; + BufferedReader responseReader = null; + InputStream in1 = null; + try { + trustAllHosts(); + // 创建url资源 + URL url = new URL(urls); + // 建立http连接 + HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); + conn.setHostnameVerifier(DO_NOT_VERIFY); + // 设置不用缓存 + conn.setUseCaches(false); + // 设置允许输出 + conn.setDoOutput(true); + // 设置允许输入 + conn.setDoInput(true); + // 设置传递方式 + conn.setRequestMethod(method); + //System.out.println(conn.getRequestMethod()); + // 设置维持长连接 + conn.setRequestProperty("Connection", "Keep-Alive"); + // 设置文件字符集: + conn.setRequestProperty("Charset", "UTF-8"); + // 转换为字节数组 +// byte[] data = (param).getBytes(); +// // 设置文件长度 +// conn.setRequestProperty("Content-Length", String.valueOf(data.length)); + // 设置文件类型: + conn.setRequestProperty("Content-Type", contentType); + if (headerOptions != null && headerOptions.size() > 0) { + for (String key : headerOptions.keySet()) { + conn.setRequestProperty(key, headerOptions.get(key)); + } + } + // 开始连接请求 + conn.connect(); + out = new DataOutputStream(conn.getOutputStream()); + // 写入请求的字符串 + if(StringUtils.isNotBlank(param)) { + out.writeBytes(param); + } + out.flush(); + + //System.out.println(conn.getResponseCode()); + + // 请求返回的状态 + if (HttpURLConnection.HTTP_OK == conn.getResponseCode()) { + System.out.println("连接成功"); + // 请求返回的数据 + in1 = conn.getInputStream(); + String readLine; + responseReader = new BufferedReader(new InputStreamReader(in1)); + while((readLine=responseReader.readLine()) != null){ + sb.append(readLine).append("\n"); + } + } else { + System.out.println("error++"); + } + } catch (Exception e) { + + } finally { + try { + if (null != responseReader) + responseReader.close(); + if (null != in1) + in1.close(); + } catch(Exception e) {} + try { + out.close(); + } catch(Exception e) {} + } + return sb.toString(); + } + + /** + * map转url参数 + */ + public static String map2Url(Map paramToMap) { + if (null == paramToMap || paramToMap.isEmpty()) { + return null; + } + StringBuffer url = new StringBuffer(); + boolean isfist = true; + for (Map.Entry entry : paramToMap.entrySet()) { + if (isfist) { + isfist = false; + } else { + url.append("&"); + } + url.append(entry.getKey()).append("="); + String value = entry.getValue(); + if (!StringUtils.isEmpty(value)) { + url.append(value); + } + } + return url.toString(); + } + + public static void main(String[] args) { +// System.out.println("123"); +// Map params = new HashMap(); +// params.put("client_id", "xx.cn"); +// params.put("client_secret", "UY83SNFJWLU32NJSLJIK"); +// params.put("code", "40ce7f41d6562e47dbdc33593ddce1b46444cdb93514b3aaced7be90eb51a16f"); +// params.put("grant_type", "authorization_code"); +// params.put("redirect_uri", "xxn/index.jsp"); + //要发送的POST请求url?Key=Value&Key2=Value2&Key3=Value3的形式 + //application/json;charset=UTF-8 application/x-www-form-urlencoded;charset=UTF-8 +// String sb = sendPost("https://id.pdedu.sh.cn/connect/token",map2Url(params),"application/json;charset=UTF-8", +// "POST"); + //System.out.println(sb); + String token = "NzdlZGU2MzctMWUxNS00YTg0LWFhZTktNDg0NGM2Yzk1YjhlLDssO3sibWVudXMiOltdLCJwZXJtaXNzaW9uIjp7InJlc291cmNlcyI6WyIxMDAwMDAyIiwiMTAwMDAwMSIsIjEwMDAwMDQiLCIxMDAwMDAzIiwiNzA0MmU3MTAtODYxNS00MjM2LWFkNTMtYWQxMjEwZGJmYzViIl19LCJ1c2VyIjp7InVzZXJJZCI6Ijc3ZWRlNjM3LTFlMTUtNGE4NC1hYWU5LTQ4NDRjNmM5NWI4ZSIsInVzZXJuYW1lIjoiemhqbXhmIiwic3RhdHVzIjoiMDEiLCJpZE51bSI6IjUxMzEyNzE5OTQwMjI1MTAxMyIsIm5pY2tOYW1lIjoi5pm65oWn6KGX6Z2i5beh6Ziy5rK75a6J566h5o6nIiwiaXBBZGRyZXNzIjoiMjIzLjg1LjIwMy4xNDUiLCJ1c2VySW1nIjpbXSwibG9naW5UaW1lIjoiMjAyMi0wOC0xNFQxNTozMzoxMi4yNzMiLCJ1c2VyVHlwZXMiOlt7InVzZXJUeXBlSWQiOiJlNzMyYjIyZC01YWE5LTQyOGYtODY2NS1hYjNkYzAzMDFmYjgiLCJ0eXBlQ29kZSI6IkpNWEYiLCJ0eXBlTmFtZSI6Iuihl+mdouW3oemYsiIsInh0cHp4eGJJZCI6IjAwOGM3MTI0LWU0ZTYtNDI2Zi1hODE3LWE0OTc3MWU1MGQ4MCJ9XSwianVyaXNkaWN0aW9ucyI6W3siY3JlYXRlQnkiOiJmNmIyNTEyMy01ZDk2LTQ0M2YtODU5OC0xMzc1ZDE3MTgxZTciLCJjcmVhdGVUaW1lIjoiMjAyMi0wNy0yNlQxNDo0OTowNyIsImxhc3RNb2RpZmllZEJ5IjoiZjZiMjUxMjMtNWQ5Ni00NDNmLTg1OTgtMTM3NWQxNzE4MWU3IiwibGFzdE1vZGlmaWVkVGltZSI6IjIwMjItMDctMjZUMTQ6NTI6NTYiLCJqdXJpc2RpY3Rpb25JZCI6ImJmOWE2NmE3LWRiYjYtNDljMi1hMGUyLWY2ZmY1NzJjNTBmOSIsImp1cmlzZGljdGlvbkNvZGUiOiIxMTExMTEiLCJqdXJpc2RpY3Rpb25OYW1lIjoi5LuB5a+/5Y6/5YWs5a6J5bGAIiwicGFyZW50Ijp7Imp1cmlzZGljdGlvbklkIjoiMCJ9LCJqdXJpc0Z1bGxDb2RlIjoiMDEwMDAwLjExMTExMS4iLCJqdXJpc1NpbXBsZUNvZGUiOiIxMTExMTEifV19fSw7LDsxNjYxMDExMjAwMDAw.b3770a53935980c9f413724f25541590"; + token = token.replace(" ",""); + token = token.replace("\\s*|\r|\n|\t",""); + Map params = new HashMap(); + params.put("Auth-Token", token); + params.put("System-Id", "XLFK_ZHJMXFZAGK"); + String sb = sendPost("https://82.157.32.48:28080/api/user-auth", null,"application/json;charset=UTF-8", + "POST", params); + System.out.println(sb); + + + } + + + +} \ No newline at end of file diff --git a/common-core-starter/src/main/java/com/mosty/common/core/util/http/MyX509TrustManager.java b/common-core-starter/src/main/java/com/mosty/common/core/util/http/MyX509TrustManager.java new file mode 100644 index 0000000..79dd262 --- /dev/null +++ b/common-core-starter/src/main/java/com/mosty/common/core/util/http/MyX509TrustManager.java @@ -0,0 +1,20 @@ +package com.mosty.common.core.util.http; + +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +import javax.net.ssl.X509TrustManager; +public class MyX509TrustManager implements X509TrustManager { + + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + } + + public X509Certificate[] getAcceptedIssuers() { + return null; + } +} \ No newline at end of file diff --git a/common-core-starter/src/main/resources/META-INF/spring.factories b/common-core-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..0a69e92 --- /dev/null +++ b/common-core-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.core.config.DefaultRoleConfig \ No newline at end of file diff --git a/common-core-starter/src/main/resources/mapper/SysAppHomeconfigMapper.xml b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigMapper.xml new file mode 100644 index 0000000..0c735b1 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateListMapper.xml b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateListMapper.xml new file mode 100644 index 0000000..d5566d1 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateListMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_app_homeconfig_plate_list set xt_zxbz = 1 where plate_id = #{plateId} + + + diff --git a/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateMapper.xml b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateMapper.xml new file mode 100644 index 0000000..dd50971 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysAppHomeconfigPlateMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_app_homeconfig_plate set xt_zxbz = 1 where homeid = #{homeid} + + + diff --git a/common-core-starter/src/main/resources/mapper/SysDeptMapper.xml b/common-core-starter/src/main/resources/mapper/SysDeptMapper.xml new file mode 100644 index 0000000..a591671 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysDeptMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,org_code,org_name,root_path, + org_type,org_level,org_biz_type, + org_no,parent_id,bmpyszm, + org_jc,org_qc,address, + link_tel,link_man,link_man_tel, + web_url,email,xzqh, + bz,xt_zxbz,xt_zxyz, + xt_cjsj,xt_lrsj,xt_lrrxm, + xt_lrrid,xt_lrrbm,xt_lrrbmid, + xt_lrip,xt_zhxgsj,xt_zhxgrxm, + xt_zhxgid,xt_zhxgrbm,xt_zhxgrbmid, + xt_zhxgrip + + + + + + + + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysLogininforMapper.xml b/common-core-starter/src/main/resources/mapper/SysLogininforMapper.xml new file mode 100644 index 0000000..ebc94f2 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysLogininforMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + info_id + ,user_name,ipaddr, + status,msg,access_time,browser,os + + + + truncate table sys_oper_log + + + + delete from sys_logininfor where oper_id in + + #{operId} + + + diff --git a/common-core-starter/src/main/resources/mapper/SysMenuMapper.xml b/common-core-starter/src/main/resources/mapper/SysMenuMapper.xml new file mode 100644 index 0000000..2560380 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysMenuMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysOperLogMapper.xml b/common-core-starter/src/main/resources/mapper/SysOperLogMapper.xml new file mode 100644 index 0000000..769696e --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysOperLogMapper.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select * + from sys_oper_log + + + + insert into sys_oper_log(mkmc, title, business_type, method, request_method, operator_type, oper_name, + ssbm, oper_user_id, oper_sfzh, ssbmid, ssbmdm, + oper_url, oper_ip, oper_param, json_result, status, error_msg, + oper_time) + values (#{mkmc}, #{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, + #{ssbm}, #{operUserId}, #{operSfzh}, #{ssbmid}, #{ssbmdm}, + #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, + #{errorMsg}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + + truncate table sys_oper_log + + + + + + + + + + + + \ No newline at end of file diff --git a/common-core-starter/src/main/resources/mapper/SysOssMapper.xml b/common-core-starter/src/main/resources/mapper/SysOssMapper.xml new file mode 100644 index 0000000..7d31bdf --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysOssMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysPositionMapper.xml b/common-core-starter/src/main/resources/mapper/SysPositionMapper.xml new file mode 100644 index 0000000..ea2efcb --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysPositionMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysRoleDeptMapper.xml b/common-core-starter/src/main/resources/mapper/SysRoleDeptMapper.xml new file mode 100644 index 0000000..fac3104 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysRoleDeptMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,role_id,dept_id + + diff --git a/common-core-starter/src/main/resources/mapper/SysRoleMapper.xml b/common-core-starter/src/main/resources/mapper/SysRoleMapper.xml new file mode 100644 index 0000000..0ce5679 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysRoleMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,role_name,role_code,role_desc, + order_no,bz,xt_cjsj, + xt_lrsj,xt_lrrxm,xt_lrrid, + xt_lrrbm,xt_lrrbmid,xt_lrip, + xt_zhxgsj,xt_zhxgrxm,xt_zhxgrid, + xt_zhxgrbm,xt_zhxgrbmid,xt_zhxgip, + xt_zxbz,xt_zxyy + + diff --git a/common-core-starter/src/main/resources/mapper/SysRoleMenuMapper.xml b/common-core-starter/src/main/resources/mapper/SysRoleMenuMapper.xml new file mode 100644 index 0000000..85c8092 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysRoleMenuMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,role_id,menu_id + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigMapper.xml new file mode 100644 index 0000000..a436c93 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_user_app_homeconfig set xt_scbz = '1' where user_sfzh = #{sfzh} + + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateListMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateListMapper.xml new file mode 100644 index 0000000..9e6e7ca --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateListMapper.xml @@ -0,0 +1,22 @@ + + + + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = 1 + where pz_id = #{pzId} and pz_plate_id = #{pzPlateId} + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = 1 + where pz_id = #{pzId} + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = #{zxbz} + where pz_id = #{pzId} and pz_plate_id = #{pzPlateId} and plate_list_id = #{plateListId} + + + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateMapper.xml new file mode 100644 index 0000000..8366a84 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserAppHomeconfigPlateMapper.xml @@ -0,0 +1,15 @@ + + + + + + + update sys_user_app_homeconfig_plate set xt_zxbz = 1 where pz_id = #{pzId} + + + + + update sys_user_app_homeconfig_plate set xt_zxbz = #{zxbz} where id = #{id} + + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserDeptMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserDeptMapper.xml new file mode 100644 index 0000000..b26947a --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserDeptMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,user_id,dept_id + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserMapper.xml new file mode 100644 index 0000000..4c63b45 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserMapper.xml @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,manager_org_id,manager_org_name, + position_id,position_name,is_virtual_user,login_name, + password,user_name,user_type, + email,mobile,tele_phone, + id_entity_card,in_dust_rial_id,sex, + nation,politic, marital, type, whcd,bz, + birthday,begin_time,end_time, + salt,xt_zxbz,xt_zxyz, + xt_cjsj,xt_lrsj,xt_lrrxm, + xt_lrrid,xt_lrrbm,xt_lrrbmid, + xt_lrip,xt_zhxgsj,xt_zhxgrxm, + xt_zhxgid,xt_zhxgrbm,xt_zhxgrbmid, + xt_zhxgrip + + + + + + + + + + + + + + + + delete from sys_user where id = #{id} + + diff --git a/common-core-starter/src/main/resources/mapper/SysUserRoleMapper.xml b/common-core-starter/src/main/resources/mapper/SysUserRoleMapper.xml new file mode 100644 index 0000000..0479b10 --- /dev/null +++ b/common-core-starter/src/main/resources/mapper/SysUserRoleMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + id,user_id,role_id + + + + + + + diff --git a/common-core-starter/target/classes/META-INF/spring.factories b/common-core-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..0a69e92 --- /dev/null +++ b/common-core-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.core.config.DefaultRoleConfig \ No newline at end of file diff --git a/common-core-starter/target/classes/com/mosty/common/core/CoreAutoConfiguration.class b/common-core-starter/target/classes/com/mosty/common/core/CoreAutoConfiguration.class new file mode 100644 index 0000000..ff7ccf9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/CoreAutoConfiguration.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigController.class new file mode 100644 index 0000000..af4f05b Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.class new file mode 100644 index 0000000..09367e2 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.class new file mode 100644 index 0000000..dd915c3 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysAppHomeconfigPlateListController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysDeptController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysDeptController.class new file mode 100644 index 0000000..d741128 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysDeptController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysLogininforController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysLogininforController.class new file mode 100644 index 0000000..1a1919f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysLogininforController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysMenuController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysMenuController.class new file mode 100644 index 0000000..381a97d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysMenuController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysPositionController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysPositionController.class new file mode 100644 index 0000000..b354c0e Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysPositionController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysRoleController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysRoleController.class new file mode 100644 index 0000000..c33fdf9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysRoleController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.class new file mode 100644 index 0000000..8f09228 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.class new file mode 100644 index 0000000..d6e9101 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.class new file mode 100644 index 0000000..531be83 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserAppHomeconfigPlateListController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserController.class new file mode 100644 index 0000000..fe2d7ea Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/SysUserController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/controller/TokenController.class b/common-core-starter/target/classes/com/mosty/common/core/business/controller/TokenController.class new file mode 100644 index 0000000..9defd56 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/controller/TokenController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfig.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfig.class new file mode 100644 index 0000000..f3f0027 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.class new file mode 100644 index 0000000..5647f1f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlate.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.class new file mode 100644 index 0000000..bf24630 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysAppHomeconfigPlateList.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysDept.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysDept.class new file mode 100644 index 0000000..0e16853 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysDept.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysLogininfor.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysLogininfor.class new file mode 100644 index 0000000..2d08a7a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysLogininfor.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysMenu.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysMenu.class new file mode 100644 index 0000000..1cb522c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysMenu.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysOss.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysOss.class new file mode 100644 index 0000000..3aeba20 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysOss.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysPosition.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysPosition.class new file mode 100644 index 0000000..9822251 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysPosition.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRole.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRole.class new file mode 100644 index 0000000..06100e4 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRole.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleDept.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleDept.class new file mode 100644 index 0000000..b5ce8ac Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleDept.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleMenu.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleMenu.class new file mode 100644 index 0000000..92f2ec5 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysRoleMenu.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUser.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUser.class new file mode 100644 index 0000000..1978000 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUser.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfig.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfig.class new file mode 100644 index 0000000..fbf35f1 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.class new file mode 100644 index 0000000..1ded626 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlate.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.class new file mode 100644 index 0000000..c186b46 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserAppHomeconfigPlateList.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserDept.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserDept.class new file mode 100644 index 0000000..7900970 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserDept.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserRole.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserRole.class new file mode 100644 index 0000000..2e220c5 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/SysUserRole.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/TbJcglXfll.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/TbJcglXfll.class new file mode 100644 index 0000000..65479e3 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/TbJcglXfll.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/Ybmj.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/Ybmj.class new file mode 100644 index 0000000..a7ce066 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/Ybmj.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/LoginLogPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/LoginLogPage.class new file mode 100644 index 0000000..f4ae2ee Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/LoginLogPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.class new file mode 100644 index 0000000..93cd40e Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.class new file mode 100644 index 0000000..fa10f5f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlateListPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.class new file mode 100644 index 0000000..a4ff263 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigPlatePage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.class new file mode 100644 index 0000000..5923d74 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysAppHomeconfigQuery.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.class new file mode 100644 index 0000000..d2c4b75 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.class new file mode 100644 index 0000000..2331b5f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlateListPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.class new file mode 100644 index 0000000..b6ef865 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigPlatePage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.class new file mode 100644 index 0000000..26837cd Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserAppHomeconfigQuery.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.class new file mode 100644 index 0000000..156e96a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/request/SysUserEditPasswordRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddDeptVO.class new file mode 100644 index 0000000..1b0d19d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.class new file mode 100644 index 0000000..93ca1b8 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDataPartitionVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.class new file mode 100644 index 0000000..77415a8 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.class new file mode 100644 index 0000000..a707512 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleMenuVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleVO.class new file mode 100644 index 0000000..78d4056 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddRoleVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysMenuVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysMenuVO.class new file mode 100644 index 0000000..6d691fe Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysMenuVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysUserVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysUserVO.class new file mode 100644 index 0000000..9515e3c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddSysUserVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddUserDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddUserDeptVO.class new file mode 100644 index 0000000..edcc71e Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/AddUserDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/Base64Str.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/Base64Str.class new file mode 100644 index 0000000..a1920bf Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/Base64Str.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DataPermissionVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DataPermissionVO.class new file mode 100644 index 0000000..7add3c9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DataPermissionVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteDeptVO.class new file mode 100644 index 0000000..7ec2fc2 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteListVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteListVO.class new file mode 100644 index 0000000..97b6669 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteListVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.class new file mode 100644 index 0000000..75f7ddc Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteRoleDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.class new file mode 100644 index 0000000..91776d9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeleteUserDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptPage.class new file mode 100644 index 0000000..666c567 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptQuery.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptQuery.class new file mode 100644 index 0000000..fbf0077 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptQuery.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptTreeVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptTreeVO.class new file mode 100644 index 0000000..7c49075 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptTreeVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptVo.class new file mode 100644 index 0000000..52bc613 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/DeptVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/EditSysMenuVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/EditSysMenuVO.class new file mode 100644 index 0000000..ce63f4c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/EditSysMenuVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserPage.class new file mode 100644 index 0000000..58539da Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.class new file mode 100644 index 0000000..5261815 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/GetUserRoleListVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/LoginResponseVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/LoginResponseVO.class new file mode 100644 index 0000000..59c01cb Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/LoginResponseVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuPage.class new file mode 100644 index 0000000..8c8678b Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuQuery.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuQuery.class new file mode 100644 index 0000000..b58ea54 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/MenuQuery.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/PositionPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/PositionPage.class new file mode 100644 index 0000000..3843469 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/PositionPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleByDeptPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleByDeptPage.class new file mode 100644 index 0000000..7e01566 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleByDeptPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleDeptVO.class new file mode 100644 index 0000000..603295c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RolePage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RolePage.class new file mode 100644 index 0000000..400d2b1 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RolePage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserPage.class new file mode 100644 index 0000000..ba8db6f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserVO.class new file mode 100644 index 0000000..c709e63 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/RoleUserVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.class new file mode 100644 index 0000000..6acda51 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigPlateVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.class new file mode 100644 index 0000000..43bd2f1 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigRsVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.class new file mode 100644 index 0000000..63797ed Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysAppHomeconfigVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysDeptVO.class new file mode 100644 index 0000000..f2ea537 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysRoleVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysRoleVO.class new file mode 100644 index 0000000..0f50252 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysRoleVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.class new file mode 100644 index 0000000..0849b96 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigPlateVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.class new file mode 100644 index 0000000..a469f77 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserAppHomeconfigVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserDeptVO.class new file mode 100644 index 0000000..0f366f2 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserEditVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserEditVO.class new file mode 100644 index 0000000..7a43c44 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserEditVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.class new file mode 100644 index 0000000..9139275 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserHomeconfigVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserInfoVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserInfoVO.class new file mode 100644 index 0000000..dd67ebe Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserInfoVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserVO.class new file mode 100644 index 0000000..a09dcbc Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/SysUserVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.class new file mode 100644 index 0000000..2d59971 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UnboundUserRoleVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserByDeptPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserByDeptPage.class new file mode 100644 index 0000000..7cc85b2 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserByDeptPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptPage.class new file mode 100644 index 0000000..ff982ac Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptVO.class new file mode 100644 index 0000000..b3ca160 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserDeptVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserPage.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserPage.class new file mode 100644 index 0000000..06296ab Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserPage.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserRoleVO.class b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserRoleVO.class new file mode 100644 index 0000000..e262bed Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/entity/vo/UserRoleVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.class new file mode 100644 index 0000000..eda37b1 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.class new file mode 100644 index 0000000..20ec1bb Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateListMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.class new file mode 100644 index 0000000..2ecaba5 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysAppHomeconfigPlateMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysDeptMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysDeptMapper.class new file mode 100644 index 0000000..eecb865 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysDeptMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysLogininforMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysLogininforMapper.class new file mode 100644 index 0000000..ed9aefa Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysLogininforMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysMenuMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysMenuMapper.class new file mode 100644 index 0000000..a78dc56 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysMenuMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysOssMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysOssMapper.class new file mode 100644 index 0000000..8c1829e Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysOssMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysPositionMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysPositionMapper.class new file mode 100644 index 0000000..e2de0c9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysPositionMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleDeptMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleDeptMapper.class new file mode 100644 index 0000000..29581d2 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleDeptMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMapper.class new file mode 100644 index 0000000..ae9f542 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMenuMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMenuMapper.class new file mode 100644 index 0000000..c70e5d0 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysRoleMenuMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.class new file mode 100644 index 0000000..be74063 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.class new file mode 100644 index 0000000..9ee3d34 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateListMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.class new file mode 100644 index 0000000..9d9f87d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserAppHomeconfigPlateMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserDeptMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserDeptMapper.class new file mode 100644 index 0000000..620ebd3 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserDeptMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserMapper.class new file mode 100644 index 0000000..cd40a40 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserRoleMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserRoleMapper.class new file mode 100644 index 0000000..4f1101d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/SysUserRoleMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/mapper/YbmjMapper.class b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/YbmjMapper.class new file mode 100644 index 0000000..5b4b06c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/mapper/YbmjMapper.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/LoginService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/LoginService.class new file mode 100644 index 0000000..109dd4f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/LoginService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.class new file mode 100644 index 0000000..78605b7 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateListService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.class new file mode 100644 index 0000000..fe3c092 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigPlateService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigService.class new file mode 100644 index 0000000..5fc3724 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysAppHomeconfigService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysDeptService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysDeptService.class new file mode 100644 index 0000000..a5c4b8b Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysDeptService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysLogininforService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysLogininforService.class new file mode 100644 index 0000000..ecc745f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysLogininforService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysMenuService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysMenuService.class new file mode 100644 index 0000000..32a6382 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysMenuService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysOssService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysOssService.class new file mode 100644 index 0000000..b5fdf04 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysOssService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysPositionService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysPositionService.class new file mode 100644 index 0000000..3dff898 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysPositionService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleDeptService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleDeptService.class new file mode 100644 index 0000000..5a0ff84 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleDeptService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleMenuService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleMenuService.class new file mode 100644 index 0000000..ff82139 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleMenuService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleService.class new file mode 100644 index 0000000..0321154 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysRoleService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.class new file mode 100644 index 0000000..f5dbf6a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateListService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.class new file mode 100644 index 0000000..339a23c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigPlateService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigService.class new file mode 100644 index 0000000..43ba31a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserAppHomeconfigService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserDeptService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserDeptService.class new file mode 100644 index 0000000..578d0ed Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserDeptService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserRoleService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserRoleService.class new file mode 100644 index 0000000..c35ed61 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserRoleService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserService.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserService.class new file mode 100644 index 0000000..342a1fd Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/SysUserService.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/LoginServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/LoginServiceImpl.class new file mode 100644 index 0000000..b7a037a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/LoginServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.class new file mode 100644 index 0000000..0ff3501 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateListServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.class new file mode 100644 index 0000000..fb7ce81 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigPlateServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.class new file mode 100644 index 0000000..02c9fd0 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysAppHomeconfigServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.class new file mode 100644 index 0000000..bb91360 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysDeptServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.class new file mode 100644 index 0000000..f64e62a Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysLogininforServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.class new file mode 100644 index 0000000..e5ec0c5 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysMenuServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysOssServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysOssServiceImpl.class new file mode 100644 index 0000000..68b49c9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysOssServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.class new file mode 100644 index 0000000..b09886d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysPositionServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.class new file mode 100644 index 0000000..726f936 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleDeptServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.class new file mode 100644 index 0000000..f08db2f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleMenuServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.class new file mode 100644 index 0000000..b9de167 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysRoleServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.class new file mode 100644 index 0000000..bd0ade4 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateListServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.class new file mode 100644 index 0000000..39522f0 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigPlateServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.class new file mode 100644 index 0000000..34bf98c Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserAppHomeconfigServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.class new file mode 100644 index 0000000..9684340 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserDeptServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.class new file mode 100644 index 0000000..50f4cb7 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserRoleServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserServiceImpl.class b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserServiceImpl.class new file mode 100644 index 0000000..cb80fd3 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/service/impl/SysUserServiceImpl.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/business/timer/DeptUserSys.class b/common-core-starter/target/classes/com/mosty/common/core/business/timer/DeptUserSys.class new file mode 100644 index 0000000..3df0498 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/business/timer/DeptUserSys.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/config/CaptchaConfig.class b/common-core-starter/target/classes/com/mosty/common/core/config/CaptchaConfig.class new file mode 100644 index 0000000..343f2a4 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/config/CaptchaConfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/config/DefaultRoleConfig.class b/common-core-starter/target/classes/com/mosty/common/core/config/DefaultRoleConfig.class new file mode 100644 index 0000000..dbe7561 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/config/DefaultRoleConfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/config/MinIoClientConfig.class b/common-core-starter/target/classes/com/mosty/common/core/config/MinIoClientConfig.class new file mode 100644 index 0000000..b7321c6 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/config/MinIoClientConfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/constant/DataPermissionConstant.class b/common-core-starter/target/classes/com/mosty/common/core/constant/DataPermissionConstant.class new file mode 100644 index 0000000..de38ca7 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/constant/DataPermissionConstant.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/IdCardLoginRequest.class b/common-core-starter/target/classes/com/mosty/common/core/login/IdCardLoginRequest.class new file mode 100644 index 0000000..54abc58 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/IdCardLoginRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/ImageController.class b/common-core-starter/target/classes/com/mosty/common/core/login/ImageController.class new file mode 100644 index 0000000..ab92e72 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/ImageController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/JwtTokenGenerator.class b/common-core-starter/target/classes/com/mosty/common/core/login/JwtTokenGenerator.class new file mode 100644 index 0000000..2638125 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/JwtTokenGenerator.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/LoginEntity.class b/common-core-starter/target/classes/com/mosty/common/core/login/LoginEntity.class new file mode 100644 index 0000000..77b9f54 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/LoginEntity.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/LoginRequest.class b/common-core-starter/target/classes/com/mosty/common/core/login/LoginRequest.class new file mode 100644 index 0000000..fc1d57f Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/LoginRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/LoginResponseVO.class b/common-core-starter/target/classes/com/mosty/common/core/login/LoginResponseVO.class new file mode 100644 index 0000000..ae9b659 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/LoginResponseVO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/LoginServiceController.class b/common-core-starter/target/classes/com/mosty/common/core/login/LoginServiceController.class new file mode 100644 index 0000000..5ac9ddf Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/LoginServiceController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/TokenRequest.class b/common-core-starter/target/classes/com/mosty/common/core/login/TokenRequest.class new file mode 100644 index 0000000..a05e574 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/TokenRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/UnifiedLoginRequest.class b/common-core-starter/target/classes/com/mosty/common/core/login/UnifiedLoginRequest.class new file mode 100644 index 0000000..40f5fca Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/UnifiedLoginRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/UserPermissionsInfo.class b/common-core-starter/target/classes/com/mosty/common/core/login/UserPermissionsInfo.class new file mode 100644 index 0000000..95f653d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/UserPermissionsInfo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptAllVo.class b/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptAllVo.class new file mode 100644 index 0000000..277d970 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptAllVo.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptDTO.class b/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptDTO.class new file mode 100644 index 0000000..239ceb9 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/dto/DeptDTO.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/login/dto/ImageRequest.class b/common-core-starter/target/classes/com/mosty/common/core/login/dto/ImageRequest.class new file mode 100644 index 0000000..59ec207 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/login/dto/ImageRequest.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/minio/UploadController.class b/common-core-starter/target/classes/com/mosty/common/core/minio/UploadController.class new file mode 100644 index 0000000..01cbbec Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/minio/UploadController.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/BASE64DecodedMultipartFile.class b/common-core-starter/target/classes/com/mosty/common/core/util/BASE64DecodedMultipartFile.class new file mode 100644 index 0000000..9945b45 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/BASE64DecodedMultipartFile.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/Base64Util.class b/common-core-starter/target/classes/com/mosty/common/core/util/Base64Util.class new file mode 100644 index 0000000..67234db Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/Base64Util.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/BeanUtils.class b/common-core-starter/target/classes/com/mosty/common/core/util/BeanUtils.class new file mode 100644 index 0000000..7bb5c74 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/BeanUtils.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/CacheUtils.class b/common-core-starter/target/classes/com/mosty/common/core/util/CacheUtils.class new file mode 100644 index 0000000..a0e88c0 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/CacheUtils.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil$1.class b/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil$1.class new file mode 100644 index 0000000..d5b7c1d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil$1.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil.class b/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil.class new file mode 100644 index 0000000..835e88d Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/HttpClientUtil.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/KafkaProducerConfig.class b/common-core-starter/target/classes/com/mosty/common/core/util/KafkaProducerConfig.class new file mode 100644 index 0000000..ec10e55 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/KafkaProducerConfig.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/RSAUtil.class b/common-core-starter/target/classes/com/mosty/common/core/util/RSAUtil.class new file mode 100644 index 0000000..18b6180 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/RSAUtil.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/ShiroUtils.class b/common-core-starter/target/classes/com/mosty/common/core/util/ShiroUtils.class new file mode 100644 index 0000000..1a939f5 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/ShiroUtils.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpUtils.class b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpUtils.class new file mode 100644 index 0000000..f8e5c43 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpUtils.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$1.class b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$1.class new file mode 100644 index 0000000..d50ff82 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$1.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$2.class b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$2.class new file mode 100644 index 0000000..b0fc8fd Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil$2.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil.class b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil.class new file mode 100644 index 0000000..a617dcb Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/http/HttpsPostUtil.class differ diff --git a/common-core-starter/target/classes/com/mosty/common/core/util/http/MyX509TrustManager.class b/common-core-starter/target/classes/com/mosty/common/core/util/http/MyX509TrustManager.class new file mode 100644 index 0000000..3113fe1 Binary files /dev/null and b/common-core-starter/target/classes/com/mosty/common/core/util/http/MyX509TrustManager.class differ diff --git a/common-core-starter/target/classes/mapper/SysAppHomeconfigMapper.xml b/common-core-starter/target/classes/mapper/SysAppHomeconfigMapper.xml new file mode 100644 index 0000000..0c735b1 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysAppHomeconfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateListMapper.xml b/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateListMapper.xml new file mode 100644 index 0000000..d5566d1 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateListMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_app_homeconfig_plate_list set xt_zxbz = 1 where plate_id = #{plateId} + + + diff --git a/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateMapper.xml b/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateMapper.xml new file mode 100644 index 0000000..dd50971 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysAppHomeconfigPlateMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_app_homeconfig_plate set xt_zxbz = 1 where homeid = #{homeid} + + + diff --git a/common-core-starter/target/classes/mapper/SysDeptMapper.xml b/common-core-starter/target/classes/mapper/SysDeptMapper.xml new file mode 100644 index 0000000..a591671 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysDeptMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,org_code,org_name,root_path, + org_type,org_level,org_biz_type, + org_no,parent_id,bmpyszm, + org_jc,org_qc,address, + link_tel,link_man,link_man_tel, + web_url,email,xzqh, + bz,xt_zxbz,xt_zxyz, + xt_cjsj,xt_lrsj,xt_lrrxm, + xt_lrrid,xt_lrrbm,xt_lrrbmid, + xt_lrip,xt_zhxgsj,xt_zhxgrxm, + xt_zhxgid,xt_zhxgrbm,xt_zhxgrbmid, + xt_zhxgrip + + + + + + + + + + + diff --git a/common-core-starter/target/classes/mapper/SysLogininforMapper.xml b/common-core-starter/target/classes/mapper/SysLogininforMapper.xml new file mode 100644 index 0000000..ebc94f2 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysLogininforMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + info_id + ,user_name,ipaddr, + status,msg,access_time,browser,os + + + + truncate table sys_oper_log + + + + delete from sys_logininfor where oper_id in + + #{operId} + + + diff --git a/common-core-starter/target/classes/mapper/SysMenuMapper.xml b/common-core-starter/target/classes/mapper/SysMenuMapper.xml new file mode 100644 index 0000000..2560380 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysMenuMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/target/classes/mapper/SysOperLogMapper.xml b/common-core-starter/target/classes/mapper/SysOperLogMapper.xml new file mode 100644 index 0000000..769696e --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysOperLogMapper.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select * + from sys_oper_log + + + + insert into sys_oper_log(mkmc, title, business_type, method, request_method, operator_type, oper_name, + ssbm, oper_user_id, oper_sfzh, ssbmid, ssbmdm, + oper_url, oper_ip, oper_param, json_result, status, error_msg, + oper_time) + values (#{mkmc}, #{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, + #{ssbm}, #{operUserId}, #{operSfzh}, #{ssbmid}, #{ssbmdm}, + #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, + #{errorMsg}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + + truncate table sys_oper_log + + + + + + + + + + + + \ No newline at end of file diff --git a/common-core-starter/target/classes/mapper/SysOssMapper.xml b/common-core-starter/target/classes/mapper/SysOssMapper.xml new file mode 100644 index 0000000..7d31bdf --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysOssMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/target/classes/mapper/SysPositionMapper.xml b/common-core-starter/target/classes/mapper/SysPositionMapper.xml new file mode 100644 index 0000000..ea2efcb --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysPositionMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common-core-starter/target/classes/mapper/SysRoleDeptMapper.xml b/common-core-starter/target/classes/mapper/SysRoleDeptMapper.xml new file mode 100644 index 0000000..fac3104 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysRoleDeptMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,role_id,dept_id + + diff --git a/common-core-starter/target/classes/mapper/SysRoleMapper.xml b/common-core-starter/target/classes/mapper/SysRoleMapper.xml new file mode 100644 index 0000000..0ce5679 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysRoleMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,role_name,role_code,role_desc, + order_no,bz,xt_cjsj, + xt_lrsj,xt_lrrxm,xt_lrrid, + xt_lrrbm,xt_lrrbmid,xt_lrip, + xt_zhxgsj,xt_zhxgrxm,xt_zhxgrid, + xt_zhxgrbm,xt_zhxgrbmid,xt_zhxgip, + xt_zxbz,xt_zxyy + + diff --git a/common-core-starter/target/classes/mapper/SysRoleMenuMapper.xml b/common-core-starter/target/classes/mapper/SysRoleMenuMapper.xml new file mode 100644 index 0000000..85c8092 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysRoleMenuMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,role_id,menu_id + + diff --git a/common-core-starter/target/classes/mapper/SysUserAppHomeconfigMapper.xml b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigMapper.xml new file mode 100644 index 0000000..a436c93 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigMapper.xml @@ -0,0 +1,10 @@ + + + + + + + update sys_user_app_homeconfig set xt_scbz = '1' where user_sfzh = #{sfzh} + + + diff --git a/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateListMapper.xml b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateListMapper.xml new file mode 100644 index 0000000..9e6e7ca --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateListMapper.xml @@ -0,0 +1,22 @@ + + + + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = 1 + where pz_id = #{pzId} and pz_plate_id = #{pzPlateId} + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = 1 + where pz_id = #{pzId} + + + + update sys_user_app_homeconfig_plate_list set xt_zxbz = #{zxbz} + where pz_id = #{pzId} and pz_plate_id = #{pzPlateId} and plate_list_id = #{plateListId} + + + + diff --git a/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateMapper.xml b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateMapper.xml new file mode 100644 index 0000000..8366a84 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserAppHomeconfigPlateMapper.xml @@ -0,0 +1,15 @@ + + + + + + + update sys_user_app_homeconfig_plate set xt_zxbz = 1 where pz_id = #{pzId} + + + + + update sys_user_app_homeconfig_plate set xt_zxbz = #{zxbz} where id = #{id} + + + diff --git a/common-core-starter/target/classes/mapper/SysUserDeptMapper.xml b/common-core-starter/target/classes/mapper/SysUserDeptMapper.xml new file mode 100644 index 0000000..b26947a --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserDeptMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,user_id,dept_id + + diff --git a/common-core-starter/target/classes/mapper/SysUserMapper.xml b/common-core-starter/target/classes/mapper/SysUserMapper.xml new file mode 100644 index 0000000..4c63b45 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserMapper.xml @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,manager_org_id,manager_org_name, + position_id,position_name,is_virtual_user,login_name, + password,user_name,user_type, + email,mobile,tele_phone, + id_entity_card,in_dust_rial_id,sex, + nation,politic, marital, type, whcd,bz, + birthday,begin_time,end_time, + salt,xt_zxbz,xt_zxyz, + xt_cjsj,xt_lrsj,xt_lrrxm, + xt_lrrid,xt_lrrbm,xt_lrrbmid, + xt_lrip,xt_zhxgsj,xt_zhxgrxm, + xt_zhxgid,xt_zhxgrbm,xt_zhxgrbmid, + xt_zhxgrip + + + + + + + + + + + + + + + + delete from sys_user where id = #{id} + + diff --git a/common-core-starter/target/classes/mapper/SysUserRoleMapper.xml b/common-core-starter/target/classes/mapper/SysUserRoleMapper.xml new file mode 100644 index 0000000..0479b10 --- /dev/null +++ b/common-core-starter/target/classes/mapper/SysUserRoleMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + id,user_id,role_id + + + + + + + diff --git a/common-core-starter/target/common-core-starter-1.0.0-SNAPSHOT.jar b/common-core-starter/target/common-core-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..c7ab9d4 Binary files /dev/null and b/common-core-starter/target/common-core-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-core-starter/target/maven-archiver/pom.properties b/common-core-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..c30e5b1 --- /dev/null +++ b/common-core-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:21 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-core-starter diff --git a/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..d672e94 --- /dev/null +++ b/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,178 @@ +com\mosty\common\core\business\entity\vo\DeleteDeptVO.class +com\mosty\common\core\config\CaptchaConfig.class +com\mosty\common\core\business\mapper\SysMenuMapper.class +com\mosty\common\core\business\service\SysAppHomeconfigPlateService.class +com\mosty\common\core\business\service\SysRoleDeptService.class +com\mosty\common\core\business\entity\vo\SysAppHomeconfigPlateVo.class +com\mosty\common\core\business\mapper\YbmjMapper.class +com\mosty\common\core\business\mapper\SysUserMapper.class +com\mosty\common\core\business\mapper\SysAppHomeconfigMapper.class +com\mosty\common\core\config\MinIoClientConfig.class +com\mosty\common\core\business\entity\SysOss.class +com\mosty\common\core\CoreAutoConfiguration.class +com\mosty\common\core\business\entity\vo\MenuQuery.class +com\mosty\common\core\business\controller\SysUserAppHomeconfigPlateController.class +com\mosty\common\core\business\mapper\SysRoleMapper.class +com\mosty\common\core\business\controller\SysUserAppHomeconfigController.class +com\mosty\common\core\business\mapper\SysAppHomeconfigPlateMapper.class +com\mosty\common\core\business\entity\vo\SysUserDeptVO.class +com\mosty\common\core\business\entity\vo\DataPermissionVO.class +com\mosty\common\core\business\entity\vo\DeptVo.class +com\mosty\common\core\business\entity\vo\GetUserRoleListVo.class +com\mosty\common\core\business\entity\TbJcglXfll.class +com\mosty\common\core\util\http\MyX509TrustManager.class +com\mosty\common\core\business\controller\SysUserAppHomeconfigPlateListController.class +com\mosty\common\core\business\entity\request\SysAppHomeconfigPage.class +com\mosty\common\core\business\entity\request\SysAppHomeconfigPlateListPage.class +com\mosty\common\core\business\entity\vo\DeleteUserDeptVO.class +com\mosty\common\core\login\LoginRequest.class +com\mosty\common\core\business\service\impl\SysDeptServiceImpl.class +com\mosty\common\core\business\service\SysUserAppHomeconfigService.class +com\mosty\common\core\business\timer\DeptUserSys.class +com\mosty\common\core\business\controller\SysRoleController.class +com\mosty\common\core\business\entity\vo\RoleUserPage.class +com\mosty\common\core\business\controller\SysMenuController.class +com\mosty\common\core\business\entity\SysUser.class +com\mosty\common\core\business\entity\vo\SysUserAppHomeconfigPlateVo.class +com\mosty\common\core\business\mapper\SysOssMapper.class +com\mosty\common\core\business\service\SysMenuService.class +com\mosty\common\core\util\RSAUtil.class +com\mosty\common\core\business\entity\vo\AddUserDeptVO.class +com\mosty\common\core\business\mapper\SysUserAppHomeconfigPlateMapper.class +com\mosty\common\core\business\entity\request\SysUserEditPasswordRequest.class +com\mosty\common\core\business\entity\vo\PositionPage.class +com\mosty\common\core\business\mapper\SysAppHomeconfigPlateListMapper.class +com\mosty\common\core\business\controller\SysPositionController.class +com\mosty\common\core\business\service\impl\SysUserServiceImpl.class +com\mosty\common\core\business\entity\vo\DeptTreeVO.class +com\mosty\common\core\login\ImageController.class +com\mosty\common\core\business\service\SysUserService.class +com\mosty\common\core\util\CacheUtils.class +com\mosty\common\core\business\entity\request\LoginLogPage.class +com\mosty\common\core\business\controller\TokenController.class +com\mosty\common\core\business\service\SysRoleService.class +com\mosty\common\core\business\entity\vo\Base64Str.class +com\mosty\common\core\business\service\SysOssService.class +com\mosty\common\core\login\LoginEntity.class +com\mosty\common\core\login\TokenRequest.class +com\mosty\common\core\business\mapper\SysRoleMenuMapper.class +com\mosty\common\core\login\dto\DeptDTO.class +com\mosty\common\core\business\entity\vo\DeptQuery.class +com\mosty\common\core\business\controller\SysAppHomeconfigPlateController.class +com\mosty\common\core\business\entity\vo\SysUserVO.class +com\mosty\common\core\business\entity\vo\AddDeptVO.class +com\mosty\common\core\business\entity\vo\SysUserEditVO.class +com\mosty\common\core\business\entity\SysAppHomeconfigPlate.class +com\mosty\common\core\business\service\impl\SysLogininforServiceImpl.class +com\mosty\common\core\business\entity\vo\GetUserPage.class +com\mosty\common\core\business\entity\vo\DeleteRoleDeptVO.class +com\mosty\common\core\business\controller\SysDeptController.class +com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPlateListPage.class +com\mosty\common\core\business\entity\vo\UserDeptVO.class +com\mosty\common\core\login\IdCardLoginRequest.class +com\mosty\common\core\business\service\impl\SysOssServiceImpl.class +com\mosty\common\core\util\HttpClientUtil.class +com\mosty\common\core\business\entity\SysUserAppHomeconfigPlate.class +com\mosty\common\core\business\entity\vo\UserDeptPage.class +com\mosty\common\core\business\service\impl\SysUserAppHomeconfigPlateListServiceImpl.class +com\mosty\common\core\business\entity\vo\SysAppHomeconfigVO.class +com\mosty\common\core\business\entity\request\SysAppHomeconfigPlatePage.class +com\mosty\common\core\business\entity\vo\SysUserInfoVO.class +com\mosty\common\core\business\entity\vo\DeleteListVO.class +com\mosty\common\core\util\KafkaProducerConfig.class +com\mosty\common\core\business\entity\SysAppHomeconfig.class +com\mosty\common\core\business\entity\SysAppHomeconfigPlateList.class +com\mosty\common\core\business\service\SysUserRoleService.class +com\mosty\common\core\business\service\SysAppHomeconfigPlateListService.class +com\mosty\common\core\business\entity\vo\UnboundUserRoleVO.class +com\mosty\common\core\util\http\HttpsPostUtil.class +com\mosty\common\core\business\entity\SysLogininfor.class +com\mosty\common\core\business\entity\vo\AddSysMenuVO.class +com\mosty\common\core\business\entity\vo\RoleUserVO.class +com\mosty\common\core\business\service\SysRoleMenuService.class +com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPage.class +com\mosty\common\core\business\entity\SysUserDept.class +com\mosty\common\core\util\HttpClientUtil$1.class +com\mosty\common\core\util\BASE64DecodedMultipartFile.class +com\mosty\common\core\business\entity\vo\LoginResponseVO.class +com\mosty\common\core\business\entity\vo\RolePage.class +com\mosty\common\core\business\entity\vo\AddSysUserVO.class +com\mosty\common\core\business\entity\vo\RoleDeptVO.class +com\mosty\common\core\business\entity\SysDept.class +com\mosty\common\core\business\controller\SysAppHomeconfigController.class +com\mosty\common\core\business\mapper\SysLogininforMapper.class +com\mosty\common\core\business\entity\vo\DeptPage.class +com\mosty\common\core\business\entity\SysPosition.class +com\mosty\common\core\business\service\impl\SysAppHomeconfigPlateServiceImpl.class +com\mosty\common\core\business\entity\vo\SysAppHomeconfigRsVO.class +com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPlatePage.class +com\mosty\common\core\business\entity\vo\UserRoleVO.class +com\mosty\common\core\business\entity\SysMenu.class +com\mosty\common\core\login\LoginResponseVO.class +com\mosty\common\core\business\service\impl\SysUserAppHomeconfigServiceImpl.class +com\mosty\common\core\business\service\SysLogininforService.class +com\mosty\common\core\business\service\impl\SysUserDeptServiceImpl.class +com\mosty\common\core\business\service\impl\SysRoleMenuServiceImpl.class +com\mosty\common\core\business\service\LoginService.class +com\mosty\common\core\business\service\SysUserAppHomeconfigPlateService.class +com\mosty\common\core\config\DefaultRoleConfig.class +com\mosty\common\core\business\service\impl\LoginServiceImpl.class +com\mosty\common\core\business\mapper\SysDeptMapper.class +com\mosty\common\core\login\dto\DeptAllVo.class +com\mosty\common\core\business\mapper\SysUserAppHomeconfigPlateListMapper.class +com\mosty\common\core\util\Base64Util.class +com\mosty\common\core\business\entity\SysRoleMenu.class +com\mosty\common\core\business\service\impl\SysRoleDeptServiceImpl.class +com\mosty\common\core\business\entity\SysUserAppHomeconfigPlateList.class +com\mosty\common\core\business\service\impl\SysMenuServiceImpl.class +com\mosty\common\core\business\service\impl\SysUserAppHomeconfigPlateServiceImpl.class +com\mosty\common\core\util\http\HttpUtils.class +com\mosty\common\core\login\dto\ImageRequest.class +com\mosty\common\core\business\entity\SysUserAppHomeconfig.class +com\mosty\common\core\login\UserPermissionsInfo.class +com\mosty\common\core\minio\UploadController.class +com\mosty\common\core\business\entity\Ybmj.class +com\mosty\common\core\business\controller\SysAppHomeconfigPlateListController.class +com\mosty\common\core\business\entity\SysRole.class +com\mosty\common\core\business\controller\SysLogininforController.class +com\mosty\common\core\business\service\impl\SysUserRoleServiceImpl.class +com\mosty\common\core\login\JwtTokenGenerator.class +com\mosty\common\core\business\service\impl\SysPositionServiceImpl.class +com\mosty\common\core\business\service\SysDeptService.class +com\mosty\common\core\business\entity\vo\AddRoleVO.class +com\mosty\common\core\business\entity\vo\EditSysMenuVO.class +com\mosty\common\core\business\entity\vo\UserByDeptPage.class +com\mosty\common\core\business\entity\vo\SysDeptVO.class +com\mosty\common\core\business\service\SysPositionService.class +com\mosty\common\core\login\LoginServiceController.class +com\mosty\common\core\business\entity\vo\RoleByDeptPage.class +com\mosty\common\core\business\entity\vo\UserPage.class +com\mosty\common\core\business\entity\vo\AddRoleDataPartitionVO.class +com\mosty\common\core\business\service\impl\SysAppHomeconfigServiceImpl.class +com\mosty\common\core\business\entity\request\SysUserAppHomeconfigQuery.class +com\mosty\common\core\business\entity\vo\AddRoleDeptVO.class +com\mosty\common\core\business\entity\vo\MenuPage.class +com\mosty\common\core\business\mapper\SysRoleDeptMapper.class +com\mosty\common\core\business\mapper\SysUserAppHomeconfigMapper.class +com\mosty\common\core\business\entity\vo\SysRoleVO.class +com\mosty\common\core\business\mapper\SysPositionMapper.class +com\mosty\common\core\business\service\SysUserAppHomeconfigPlateListService.class +com\mosty\common\core\business\entity\request\SysAppHomeconfigQuery.class +com\mosty\common\core\business\entity\vo\AddRoleMenuVO.class +com\mosty\common\core\util\http\HttpsPostUtil$2.class +com\mosty\common\core\business\entity\vo\SysUserAppHomeconfigVo.class +com\mosty\common\core\business\service\SysAppHomeconfigService.class +com\mosty\common\core\business\entity\SysRoleDept.class +com\mosty\common\core\business\mapper\SysUserDeptMapper.class +com\mosty\common\core\util\BeanUtils.class +com\mosty\common\core\business\mapper\SysUserRoleMapper.class +com\mosty\common\core\business\controller\SysUserController.class +com\mosty\common\core\business\entity\SysUserRole.class +com\mosty\common\core\business\service\impl\SysRoleServiceImpl.class +com\mosty\common\core\util\ShiroUtils.class +com\mosty\common\core\constant\DataPermissionConstant.class +com\mosty\common\core\util\http\HttpsPostUtil$1.class +com\mosty\common\core\login\UnifiedLoginRequest.class +com\mosty\common\core\business\entity\vo\SysUserHomeconfigVo.class +com\mosty\common\core\business\service\impl\SysAppHomeconfigPlateListServiceImpl.class +com\mosty\common\core\business\service\SysUserDeptService.class diff --git a/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..5c3336a --- /dev/null +++ b/common-core-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,175 @@ +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysAppHomeconfigPlate.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysAppHomeconfigMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserAppHomeconfigPlateService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysLogininfor.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\MenuPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysPositionController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysAppHomeconfigPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\LoginServiceController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\EditSysMenuVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysMenu.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddSysMenuVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysRoleMenu.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysRoleVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysOssServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysAppHomeconfigController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysAppHomeconfigQuery.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UserDeptPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddRoleMenuVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserInfoVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\RoleUserPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysDeptMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysDeptController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\config\DefaultRoleConfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\http\HttpsPostUtil.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\TokenRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysRoleDeptServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\BASE64DecodedMultipartFile.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\Base64Util.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\ShiroUtils.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUser.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysRoleDept.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddUserDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserAppHomeconfigPlateServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysRoleDeptService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysAppHomeconfigPlateController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\MenuQuery.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysPositionServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UserPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUserAppHomeconfigPlate.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\LoginRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysAppHomeconfigPlateServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysDeptService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysLogininforMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysAppHomeconfigPlateVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysRoleMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUserRole.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeptVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\IdCardLoginRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUserAppHomeconfigPlateList.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysUserAppHomeconfigPlateController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeleteListVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysRoleMenuServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysOssService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserRoleServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\Ybmj.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\dto\DeptDTO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\config\CaptchaConfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUserAppHomeconfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\RolePage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\LoginResponseVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\LoginLogPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\UnifiedLoginRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UnboundUserRoleVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\UserPermissionsInfo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\GetUserRoleListVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserDeptMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\HttpClientUtil.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\YbmjMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysLogininforServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysRoleMenuMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserAppHomeconfigService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DataPermissionVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserEditVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysRoleDeptMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\CacheUtils.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysAppHomeconfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\timer\DeptUserSys.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\RSAUtil.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysOssMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysPositionMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeptPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysAppHomeconfigPlateListController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddSysUserVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysDeptServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeptQuery.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\ImageController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\GetUserPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\http\HttpUtils.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\RoleByDeptPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysAppHomeconfigPlateListMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\constant\DataPermissionConstant.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysPosition.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\PositionPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysAppHomeconfigVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserAppHomeconfigPlateMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysAppHomeconfigServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysPositionService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysRoleService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserAppHomeconfigVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysMenuServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysUserAppHomeconfigController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\LoginServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysMenuController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddRoleVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\TokenController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\RoleUserVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysUserDept.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserHomeconfigVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysOss.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysRoleMenuService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysAppHomeconfigPlateListService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\dto\ImageRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysAppHomeconfigPlateListPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysUserEditPasswordRequest.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserRoleService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\KafkaProducerConfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserAppHomeconfigServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\LoginEntity.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserAppHomeconfigMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\LoginResponseVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserAppHomeconfigPlateListMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UserByDeptPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysMenuService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\Base64Str.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\minio\UploadController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeleteDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysAppHomeconfigPlateListServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserDeptService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysAppHomeconfigPlatePage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UserRoleVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\LoginService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\config\MinIoClientConfig.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddRoleDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysRoleController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\UserDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysLogininforController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysUserAppHomeconfigPlateListController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysDept.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserDeptServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\dto\DeptAllVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\http\MyX509TrustManager.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeptTreeVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysLogininforService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysRole.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysUserAppHomeconfigPlateVo.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysUserAppHomeconfigPlateListServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPlateListPage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\SysAppHomeconfigPlateList.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysMenuMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysUserAppHomeconfigQuery.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\request\SysUserAppHomeconfigPlatePage.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\SysAppHomeconfigRsVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\util\BeanUtils.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\RoleDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysAppHomeconfigPlateMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysUserAppHomeconfigPlateListService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeleteUserDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysAppHomeconfigService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\DeleteRoleDeptVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\CoreAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\login\JwtTokenGenerator.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\mapper\SysUserRoleMapper.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\impl\SysRoleServiceImpl.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\vo\AddRoleDataPartitionVO.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\service\SysAppHomeconfigPlateService.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\controller\SysUserController.java +C:\tools\dy外网\mosty-common\common-core-starter\src\main\java\com\mosty\common\core\business\entity\TbJcglXfll.java diff --git a/common-dynamic-datasource-starter/common-dynamic-datasource-starter.iml b/common-dynamic-datasource-starter/common-dynamic-datasource-starter.iml new file mode 100644 index 0000000..13dbd0b --- /dev/null +++ b/common-dynamic-datasource-starter/common-dynamic-datasource-starter.iml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-dynamic-datasource-starter/pom.xml b/common-dynamic-datasource-starter/pom.xml new file mode 100644 index 0000000..98819e6 --- /dev/null +++ b/common-dynamic-datasource-starter/pom.xml @@ -0,0 +1,33 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-dynamic-datasource-starter + + + 8 + 8 + + + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + org.springframework + spring-jdbc + 5.3.6 + compile + + + + \ No newline at end of file diff --git a/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DataSource.java b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DataSource.java new file mode 100644 index 0000000..0ffe6e7 --- /dev/null +++ b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DataSource.java @@ -0,0 +1,19 @@ +package com.common.dynamic.datasource; + +import java.lang.annotation.*; + +/** + * 切换数据注解 可以用于类或者方法级别 方法级别优先级 > 类级别 + * + * @author kevin + * @date 2022/4/29 8:59 上午 + * @since 1.0.0 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER}) +public @interface DataSource { + + String value() default "master"; + +} diff --git a/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceAspect.java b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceAspect.java new file mode 100644 index 0000000..6038c38 --- /dev/null +++ b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceAspect.java @@ -0,0 +1,32 @@ +package com.common.dynamic.datasource; + +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.springframework.stereotype.Component; + +@Slf4j +@Aspect +@Component +public class DynamicDataSourceAspect { + + @Before("@annotation(ds)") + public void changeDataSource(JoinPoint point, DataSource ds) throws Throwable { + String dsId = ds.value(); + if (DynamicDataSourceContextHolder.dataSourceIds.contains(dsId)) { + log.debug("Use DataSource :{} >", dsId, point.getSignature()); + } else { + log.info("数据源[{}]不存在,使用默认数据源 >{}", dsId, point.getSignature()); + DynamicDataSourceContextHolder.setDataSourceRouterKey(dsId); + } + } + + @After("@annotation(ds)") + public void restoreDataSource(JoinPoint point, DataSource ds) { + log.debug("Revert DataSource : " + ds.value() + " > " + point.getSignature()); + DynamicDataSourceContextHolder.removeDataSourceRouterKey(); + + } +} diff --git a/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceContextHolder.java b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceContextHolder.java new file mode 100644 index 0000000..c20b1af --- /dev/null +++ b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceContextHolder.java @@ -0,0 +1,55 @@ +package com.common.dynamic.datasource; + +import com.alibaba.ttl.TransmittableThreadLocal; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; + +/** + * 动态数据源处理器 + * @author kevin + * @date 2022/4/29 9:02 上午 + * @since 1.0.0 + */ +@Slf4j +public class DynamicDataSourceContextHolder { + + /** + * 存储已经注册的数据源的key + */ + public static List dataSourceIds = new ArrayList<>(); + + /** + * 使用{@link TransmittableThreadLocal} 进行存储,使用线程池等后还能获取到 + */ + private static final ThreadLocal HOLDER = TransmittableThreadLocal.withInitial(() -> null); + + public static String getDataSourceRouterKey () { + return HOLDER.get(); + } + + public static void setDataSourceRouterKey (String dataSourceRouterKey) { + log.info("切换至{}数据源", dataSourceRouterKey); + HOLDER.set(dataSourceRouterKey); + } + + /** + * 设置数据源之前一定要先移除 + */ + public static void removeDataSourceRouterKey () { + HOLDER.remove(); + } + + /** + * 判断指定DataSrouce当前是否存在 + * + * @param dataSourceId + * @return + */ + public static boolean containsDataSource(String dataSourceId){ + return dataSourceIds.contains(dataSourceId); + } + +} diff --git a/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceRegister.java b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceRegister.java new file mode 100644 index 0000000..823ae58 --- /dev/null +++ b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicDataSourceRegister.java @@ -0,0 +1,175 @@ +package com.common.dynamic.datasource; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.MutablePropertyValues; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.GenericBeanDefinition; +import org.springframework.boot.context.properties.bind.Bindable; +import org.springframework.boot.context.properties.bind.Binder; +import org.springframework.boot.context.properties.source.ConfigurationPropertyName; +import org.springframework.boot.context.properties.source.ConfigurationPropertyNameAliases; +import org.springframework.boot.context.properties.source.ConfigurationPropertySource; +import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; +import org.springframework.context.EnvironmentAware; +import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; +import org.springframework.core.env.Environment; +import org.springframework.core.type.AnnotationMetadata; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 动态数据源注册 + * 实现 ImportBeanDefinitionRegistrar 实现数据源注册 + * 实现 EnvironmentAware 用于读取application.yml配置 + */ +@Slf4j +public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar, EnvironmentAware { + + /** + * 配置上下文(也可以理解为配置文件的获取工具) + */ + private Environment evn; + + /** + * 别名 + */ + private final static ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); + + /** + * 由于部分数据源配置不同,所以在此处添加别名,避免切换数据源出现某些参数无法注入的情况 + */ + static { + aliases.addAliases("url", new String[]{"jdbc-url"}); + aliases.addAliases("username", new String[]{"user"}); + } + + /** + * 存储我们注册的数据源 + */ + private Map customDataSources = new HashMap(); + + /** + * 参数绑定工具 springboot2.0新推出 + */ + private Binder binder; + + /** + * ImportBeanDefinitionRegistrar接口的实现方法,通过该方法可以按照自己的方式注册bean + * + * @param annotationMetadata + * @param beanDefinitionRegistry + */ + @Override + public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) { + // 获取所有数据源配置 + Map config, defauleDataSourceProperties; + defauleDataSourceProperties = binder.bind("spring.datasource.master", Map.class).get(); + // 获取数据源类型 + String typeStr = evn.getProperty("spring.datasource.master.type"); + // 获取数据源类型 + Class clazz = getDataSourceType(typeStr); + // 绑定默认数据源参数 也就是主数据源 + DataSource consumerDatasource, defaultDatasource = bind(clazz, defauleDataSourceProperties); + DynamicDataSourceContextHolder.dataSourceIds.add("master"); + log.info("注册默认数据源成功"); + // 获取其他数据源配置 + List configs = binder.bind("spring.datasource.cluster", Bindable.listOf(Map.class)).get(); + // 遍历从数据源 + for (int i = 0; i < configs.size(); i++) { + config = configs.get(i); + clazz = getDataSourceType((String) config.get("type")); + defauleDataSourceProperties = config; + // 绑定参数 + consumerDatasource = bind(clazz, defauleDataSourceProperties); + // 获取数据源的key,以便通过该key可以定位到数据源 + String key = config.get("key").toString(); + customDataSources.put(key, consumerDatasource); + // 数据源上下文,用于管理数据源与记录已经注册的数据源key + DynamicDataSourceContextHolder.dataSourceIds.add(key); + log.info("注册数据源{}成功", key); + } + // bean定义类 + GenericBeanDefinition define = new GenericBeanDefinition(); + // 设置bean的类型,此处DynamicRoutingDataSource是继承AbstractRoutingDataSource的实现类 + define.setBeanClass(DynamicRoutingDataSource.class); + // 需要注入的参数 + MutablePropertyValues mpv = define.getPropertyValues(); + // 添加默认数据源,避免key不存在的情况没有数据源可用 + mpv.add("defaultTargetDataSource", defaultDatasource); + // 添加其他数据源 + mpv.add("targetDataSources", customDataSources); + // 将该bean注册为datasource,不使用springboot自动生成的datasource + beanDefinitionRegistry.registerBeanDefinition("datasource", define); + log.info("注册数据源成功,一共注册{}个数据源", customDataSources.keySet().size() + 1); + } + + /** + * 通过字符串获取数据源class对象 + * + * @param typeStr + * @return + */ + private Class getDataSourceType(String typeStr) { + Class type = null; + try { + if (StringUtils.hasLength(typeStr)) { + // 字符串不为空则通过反射获取class对象 + type = (Class) Class.forName(typeStr); + } else { + // 默认为hikariCP数据源,与springboot默认数据源保持一致 +// type = HikariDataSource.class; + } + return type; + } catch (Exception e) { + throw new IllegalArgumentException("can not resolve class with type: " + typeStr); //无法通过反射获取class对象的情况则抛出异常,该情况一般是写错了,所以此次抛出一个runtimeexception + } + } + + /** + * 绑定参数,以下三个方法都是参考DataSourceBuilder的bind方法实现的,目的是尽量保证我们自己添加的数据源构造过程与springboot保持一致 + * + * @param result + * @param properties + */ + private void bind(DataSource result, Map properties) { + ConfigurationPropertySource source = new MapConfigurationPropertySource(properties); + Binder binder = new Binder(new ConfigurationPropertySource[]{source.withAliases(aliases)}); + // 将参数绑定到对象 + binder.bind(ConfigurationPropertyName.EMPTY, Bindable.ofInstance(result)); + } + + private T bind(Class clazz, Map properties) { + ConfigurationPropertySource source = new MapConfigurationPropertySource(properties); + Binder binder = new Binder(new ConfigurationPropertySource[]{source.withAliases(aliases)}); + // 通过类型绑定参数并获得实例对象 + return binder.bind(ConfigurationPropertyName.EMPTY, Bindable.of(clazz)).get(); + } + + /** + * @param clazz + * @param sourcePath 参数路径,对应配置文件中的值,如: spring.datasource + * @param + * @return + */ + private T bind(Class clazz, String sourcePath) { + Map properties = binder.bind(sourcePath, Map.class).get(); + return bind(clazz, properties); + } + + /** + * EnvironmentAware接口的实现方法,通过aware的方式注入,此处是environment对象 + * + * @param environment + */ + @Override + public void setEnvironment(Environment environment) { + log.info("开始注册数据源"); + this.evn = environment; + // 绑定配置器 + binder = Binder.get(evn); + } + +} diff --git a/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicRoutingDataSource.java b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicRoutingDataSource.java new file mode 100644 index 0000000..32f4354 --- /dev/null +++ b/common-dynamic-datasource-starter/src/main/java/com/common/dynamic/datasource/DynamicRoutingDataSource.java @@ -0,0 +1,21 @@ +package com.common.dynamic.datasource; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +/** + * @Auther: yukong + * @Date: 2018/8/15 10:47 + * @Description: 动态数据源路由配置 + */ +@Slf4j +public class DynamicRoutingDataSource extends AbstractRoutingDataSource { + + + @Override + protected Object determineCurrentLookupKey() { + String dataSourceName = DynamicDataSourceContextHolder.getDataSourceRouterKey(); + log.info("当前数据源是:{}", dataSourceName); + return DynamicDataSourceContextHolder.getDataSourceRouterKey(); + } +} diff --git a/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DataSource.class b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DataSource.class new file mode 100644 index 0000000..0b43083 Binary files /dev/null and b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DataSource.class differ diff --git a/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceAspect.class b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceAspect.class new file mode 100644 index 0000000..6ea5c88 Binary files /dev/null and b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceAspect.class differ diff --git a/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceContextHolder.class b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceContextHolder.class new file mode 100644 index 0000000..a84546d Binary files /dev/null and b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceContextHolder.class differ diff --git a/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceRegister.class b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceRegister.class new file mode 100644 index 0000000..e66e89c Binary files /dev/null and b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicDataSourceRegister.class differ diff --git a/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicRoutingDataSource.class b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicRoutingDataSource.class new file mode 100644 index 0000000..f18526e Binary files /dev/null and b/common-dynamic-datasource-starter/target/classes/com/common/dynamic/datasource/DynamicRoutingDataSource.class differ diff --git a/common-dynamic-datasource-starter/target/common-dynamic-datasource-starter-1.0.0-SNAPSHOT.jar b/common-dynamic-datasource-starter/target/common-dynamic-datasource-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..ceaad88 Binary files /dev/null and b/common-dynamic-datasource-starter/target/common-dynamic-datasource-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-dynamic-datasource-starter/target/maven-archiver/pom.properties b/common-dynamic-datasource-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..185bd96 --- /dev/null +++ b/common-dynamic-datasource-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:24 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-dynamic-datasource-starter diff --git a/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..a2d6f6e --- /dev/null +++ b/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,5 @@ +com\common\dynamic\datasource\DataSource.class +com\common\dynamic\datasource\DynamicRoutingDataSource.class +com\common\dynamic\datasource\DynamicDataSourceAspect.class +com\common\dynamic\datasource\DynamicDataSourceContextHolder.class +com\common\dynamic\datasource\DynamicDataSourceRegister.class diff --git a/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..b756e6b --- /dev/null +++ b/common-dynamic-datasource-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,5 @@ +C:\tools\dy外网\mosty-common\common-dynamic-datasource-starter\src\main\java\com\common\dynamic\datasource\DataSource.java +C:\tools\dy外网\mosty-common\common-dynamic-datasource-starter\src\main\java\com\common\dynamic\datasource\DynamicDataSourceAspect.java +C:\tools\dy外网\mosty-common\common-dynamic-datasource-starter\src\main\java\com\common\dynamic\datasource\DynamicDataSourceRegister.java +C:\tools\dy外网\mosty-common\common-dynamic-datasource-starter\src\main\java\com\common\dynamic\datasource\DynamicDataSourceContextHolder.java +C:\tools\dy外网\mosty-common\common-dynamic-datasource-starter\src\main\java\com\common\dynamic\datasource\DynamicRoutingDataSource.java diff --git a/common-generator-starter/common-generator-starter.iml b/common-generator-starter/common-generator-starter.iml new file mode 100644 index 0000000..fae5a59 --- /dev/null +++ b/common-generator-starter/common-generator-starter.iml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-generator-starter/pom.xml b/common-generator-starter/pom.xml new file mode 100644 index 0000000..b92e8ae --- /dev/null +++ b/common-generator-starter/pom.xml @@ -0,0 +1,107 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-generator-starter + + + 8 + 8 + + + + + com.mosty + common-log-base-starter + 1.0.0-SNAPSHOT + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + true + + + org.springframework.boot + spring-boot-starter-aop + ${spring-boot-dependencies.version} + true + + + + com.alibaba + druid-spring-boot-starter + 1.2.8 + + + + + + + + + + org.springframework.boot + spring-boot-starter-validation + ${spring-boot-dependencies.version} + + + + commons-fileupload + commons-fileupload + 1.4 + + + com.alibaba + fastjson + ${fastjson.version} + + + org.apache.commons + commons-lang3 + 3.12.0 + + + com.google.guava + guava + 29.0-jre + + + + + + + mosty-nexus-releases + release version + http://47.108.232.77:8181/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://47.108.232.77:8181/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/GeneratorAutoConfiguration.java b/common-generator-starter/src/main/java/com/mosty/common/generator/GeneratorAutoConfiguration.java new file mode 100644 index 0000000..4418f30 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/GeneratorAutoConfiguration.java @@ -0,0 +1,16 @@ +package com.mosty.common.generator; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Configuration; + +/** + * 代码生成自动装配 + * @author kevin + * @date 2022/2/3 3:34 PM + * @since 1.0.0 + */ +@Configuration +@MapperScan("com.mosty.common.generator.mapper") +public class GeneratorAutoConfiguration { + +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/config/BaseEntity.java b/common-generator-starter/src/main/java/com/mosty/common/generator/config/BaseEntity.java new file mode 100644 index 0000000..b9c2a84 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/config/BaseEntity.java @@ -0,0 +1,113 @@ +package com.mosty.common.generator.config; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Entity基类 + * + * @author ruoyi + */ +public class BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 搜索值 + */ + private String searchValue; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 请求参数 + */ + private Map params; + + public String getSearchValue() { + return searchValue; + } + + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Map getParams() { + if (params == null) { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) { + this.params = params; + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig.java b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig.java new file mode 100644 index 0000000..f989255 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig.java @@ -0,0 +1,65 @@ +package com.mosty.common.generator.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 代码生成相关配置 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "gen") +public class GenConfig { + /** + * 作者 + */ + public static String author; + + /** + * 生成包路径 + */ + public static String packageName; + + /** + * 自动去除表前缀,默认是false + */ + public static boolean autoRemovePre; + + /** + * 表前缀(类名不会包含表前缀) + */ + public static String tablePrefix; + + public static String getAuthor() { + return author; + } + + public void setAuthor(String author) { + GenConfig.author = author; + } + + public static String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + GenConfig.packageName = packageName; + } + + public static boolean getAutoRemovePre() { + return autoRemovePre; + } + + public void setAutoRemovePre(boolean autoRemovePre) { + GenConfig.autoRemovePre = autoRemovePre; + } + + public static String getTablePrefix() { + return tablePrefix; + } + + public void setTablePrefix(String tablePrefix) { + GenConfig.tablePrefix = tablePrefix; + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig_bak.java new file mode 100644 index 0000000..12bb2b4 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConfig_bak.java @@ -0,0 +1,72 @@ +//package com.mosty.common.generator.config; +// +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.boot.context.properties.ConfigurationProperties; +//import org.springframework.context.annotation.PropertySource; +//import org.springframework.stereotype.Component; +// +///** +// * 读取代码生成相关配置 +// * +// * @author ruoyi +// */ +//@Component +//@ConfigurationProperties(prefix = "gen") +//@PropertySource(value = {"classpath:generator.yml"}) +//public class GenConfig { +// /** +// * 作者 +// */ +// public static String author; +//‰ +// /** +// * 生成包路径 +// */ +// public static String packageName; +// +// /** +// * 自动去除表前缀,默认是false +// */ +// public static boolean autoRemovePre; +// +// /** +// * 表前缀(类名不会包含表前缀) +// */ +// public static String tablePrefix; +// +// public static String getAuthor() { +// return author; +// } +// +// @Value("${author}") +// public void setAuthor(String author) { +// GenConfig.author = author; +// } +// +// public static String getPackageName() { +// return packageName; +// } +// +// @Value("${packageName}") +// public void setPackageName(String packageName) { +// GenConfig.packageName = packageName; +// } +// +// public static boolean getAutoRemovePre() { +// return autoRemovePre; +// } +// +// @Value("${autoRemovePre}") +// public void setAutoRemovePre(boolean autoRemovePre) { +// GenConfig.autoRemovePre = autoRemovePre; +// } +// +// public static String getTablePrefix() { +// return tablePrefix; +// } +// +// @Value("${tablePrefix}") +// public void setTablePrefix(String tablePrefix) { +// GenConfig.tablePrefix = tablePrefix; +// } +//} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConstants.java b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConstants.java new file mode 100644 index 0000000..52d637d --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/config/GenConstants.java @@ -0,0 +1,181 @@ +package com.mosty.common.generator.config; + +/** + * 代码生成通用常量 + * + * @author ruoyi + */ +public class GenConstants { + /** + * 单表(增删改查) + */ + public static final String TPL_CRUD = "crud"; + + /** + * 树表(增删改查) + */ + public static final String TPL_TREE = "tree"; + + /** + * 主子表(增删改查) + */ + public static final String TPL_SUB = "sub"; + + /** + * 树编码字段 + */ + public static final String TREE_CODE = "treeCode"; + + /** + * 树父编码字段 + */ + public static final String TREE_PARENT_CODE = "treeParentCode"; + + /** + * 树名称字段 + */ + public static final String TREE_NAME = "treeName"; + + /** + * 上级菜单ID字段 + */ + public static final String PARENT_MENU_ID = "parentMenuId"; + + /** + * 上级菜单名称字段 + */ + public static final String PARENT_MENU_NAME = "parentMenuName"; + + /** + * 数据库字符串类型 + */ + public static final String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"}; + + /** + * 数据库文本类型 + */ + public static final String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"}; + + /** + * 数据库时间类型 + */ + public static final String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"}; + + /** + * 数据库数字类型 + */ + public static final String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", + "bigint", "float", "double", "decimal"}; + + /** + * 页面不需要编辑字段 + */ + public static final String[] COLUMNNAME_NOT_EDIT = {"id", "create_by", "create_time", "del_flag"}; + + /** + * 页面不需要显示的列表字段 + */ + public static final String[] COLUMNNAME_NOT_LIST = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time"}; + + /** + * 页面不需要查询字段 + */ + public static final String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark"}; + + /** + * Entity基类字段 + */ + public static final String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime", "remark"}; + + /** + * Tree基类字段 + */ + public static final String[] TREE_ENTITY = {"parentName", "parentId", "orderNum", "ancestors"}; + + /** + * 文本框 + */ + public static final String HTML_INPUT = "input"; + + /** + * 文本域 + */ + public static final String HTML_TEXTAREA = "textarea"; + + /** + * 下拉框 + */ + public static final String HTML_SELECT = "select"; + + /** + * 单选框 + */ + public static final String HTML_RADIO = "radio"; + + /** + * 复选框 + */ + public static final String HTML_CHECKBOX = "checkbox"; + + /** + * 日期控件 + */ + public static final String HTML_DATETIME = "datetime"; + + /** + * 图片上传控件 + */ + public static final String HTML_IMAGE_UPLOAD = "imageUpload"; + + /** + * 文件上传控件 + */ + public static final String HTML_FILE_UPLOAD = "fileUpload"; + + /** + * 富文本控件 + */ + public static final String HTML_EDITOR = "editor"; + + /** + * 字符串类型 + */ + public static final String TYPE_STRING = "String"; + + /** + * 整型 + */ + public static final String TYPE_INTEGER = "Integer"; + + /** + * 长整型 + */ + public static final String TYPE_LONG = "Long"; + + /** + * 浮点型 + */ + public static final String TYPE_DOUBLE = "Double"; + + /** + * 高精度计算类型 + */ + public static final String TYPE_BIGDECIMAL = "BigDecimal"; + + /** + * 时间类型 + */ + public static final String TYPE_DATE = "Date"; + + /** + * 模糊查询 + */ + public static final String QUERY_LIKE = "LIKE"; + + /** + * 需要 + */ + public static final String REQUIRE = "1"; +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController.java b/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController.java new file mode 100644 index 0000000..e101e1a --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController.java @@ -0,0 +1,194 @@ +package com.mosty.common.generator.controller; + +import com.mosty.common.base.domain.BaseController; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.domain.TableDataInfo; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.generator.domain.GenTable; +import com.mosty.common.generator.domain.GenTableColumn; +import com.mosty.common.generator.service.IGenTableColumnService; +import com.mosty.common.generator.service.IGenTableService; +import com.mosty.common.token.JwtSysUser; +import com.mosty.operation.log.util.Convert; +import io.swagger.annotations.Api; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成 操作处理 + * + * @author ruoyi + */ +@RequestMapping("/gen") +@RestController +@Api(tags = "代码生成") +public class GenController extends BaseController { + @Autowired + private IGenTableService genTableService; + + @Autowired + private IGenTableColumnService genTableColumnService; + + /** + * 查询代码生成列表 + */ +// @RequiresPermissions("tool:gen:list") + @GetMapping("/list") + public ResponseResult genList(GenTable genTable) { + startPage(); + List list = genTableService.selectGenTableList(genTable); + return ResponseResult.success(getDataTable(list)); + } + + /** + * 修改代码生成业务 + */ +// @RequiresPermissions("tool:gen:query") + @GetMapping(value = "/{talbleId}") + public ResponseResult> getInfo(@PathVariable Long tableId) { + GenTable table = genTableService.selectGenTableById(tableId); + List tables = genTableService.selectGenTableAll(); + List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); + Map map = new HashMap(); + map.put("info", table); + map.put("rows", list); + map.put("tables", tables); + return ResponseResult.success(map); + } + + /** + * 查询数据库列表 + */ +// @RequiresPermissions("tool:gen:list") + @GetMapping("/db/list") + public ResponseResult dataList(GenTable genTable) { + startPage(); + List list = genTableService.selectDbTableList(genTable); + return ResponseResult.success(getDataTable(list)); + } + + /** + * 查询数据表字段列表 + */ + @GetMapping(value = "/column/{talbleId}") + public ResponseResult columnList(Long tableId) { + TableDataInfo dataInfo = new TableDataInfo(); + List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); + dataInfo.setRows(list); + dataInfo.setTotal(list.size()); + return ResponseResult.success(dataInfo); + } + + /** + * 导入表结构(保存) + */ +// @RequiresPermissions("tool:gen:import") + @Log(title = "代码生成", businessType = BusinessType.IMPORT) + @PostMapping("/importTable") + @JwtSysUser + public ResponseResult importTableSave(String tables) { + String[] tableNames = Convert.toStrArray(tables); + // 查询表信息 + List tableList = genTableService.selectDbTableListByNames(tableNames); + genTableService.importGenTable(tableList); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 修改保存代码生成业务 + */ +// @RequiresPermissions("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @PutMapping + public ResponseResult editSave(@Validated @RequestBody GenTable genTable) { + genTableService.validateEdit(genTable); + genTableService.updateGenTable(genTable); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 删除代码生成 + */ +// @RequiresPermissions("tool:gen:remove") + @Log(title = "代码生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{tableIds}") + public ResponseResult remove(@PathVariable Long[] tableIds) { + genTableService.deleteGenTableByIds(tableIds); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 预览代码 + */ +// @RequiresPermissions("tool:gen:preview") + @GetMapping("/preview/{tableId}") + public ResponseResult> preview(@PathVariable("tableId") Long tableId) throws IOException { + Map dataMap = genTableService.previewCode(tableId); + return ResponseResult.success(dataMap); + } + + /** + * 生成代码(下载方式) + */ +// @RequiresPermissions("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/download/{tableName}") + public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { + byte[] data = genTableService.downloadCode(tableName); + genCode(response, data); + } + + /** + * 生成代码(自定义路径) + */ +// @RequiresPermissions("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/genCode/{tableName}") + public ResponseResult genCode(@PathVariable("tableName") String tableName) { + genTableService.generatorCode(tableName); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 同步数据库 + */ +// @RequiresPermissions("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @GetMapping("/synchDb/{tableName}") + public ResponseResult synchDb(@PathVariable("tableName") String tableName) { + genTableService.synchDb(tableName); + return ResponseResult.success(); + } + + /** + * 批量生成代码 + */ +// @RequiresPermissions("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/batchGenCode") + public void batchGenCode(HttpServletResponse response, String tables) throws IOException { + String[] tableNames = Convert.toStrArray(tables); + byte[] data = genTableService.downloadCode(tableNames); + genCode(response, data); + } + + /** + * 生成zip文件 + */ + private void genCode(HttpServletResponse response, byte[] data) throws IOException { + response.reset(); + response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IOUtils.write(data, response.getOutputStream()); + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController_bak.java new file mode 100644 index 0000000..2707f0c --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/controller/GenController_bak.java @@ -0,0 +1,281 @@ +//package com.mosty.common.generator.controller; +// +//import cn.hutool.core.convert.Convert; +//import com.alibaba.druid.DbType; +//import com.alibaba.druid.sql.SQLUtils; +//import com.alibaba.druid.sql.ast.SQLStatement; +//import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement; +//import com.alibaba.fastjson.JSON; +//import com.mosty.common.base.domain.BaseController; +//import com.mosty.common.base.domain.CxSelect; +//import com.mosty.common.base.domain.ResponseResult; +//import com.mosty.common.base.domain.TableDataInfo; +//import com.mosty.common.base.domain.page.SqlUtil; +//import com.mosty.common.base.entity.log.BusinessType; +//import com.mosty.common.base.entity.log.Log; +//import com.mosty.common.generator.domain.GenTable; +//import com.mosty.common.generator.domain.GenTableColumn; +//import com.mosty.common.generator.service.GenTableColumnService; +//import com.mosty.common.generator.service.GenTableService; +//import io.swagger.annotations.Api; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.io.IOUtils; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Controller; +//import org.springframework.ui.ModelMap; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +//import javax.servlet.http.HttpServletResponse; +//import java.io.IOException; +//import java.util.ArrayList; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +// +///** +// * 代码生成 操作处理 +// * +// * @author ruoyi +// */ +//@Slf4j +//@Controller +//@RequestMapping("/tool/gen") +//@Api(tags = "代码生成") +//public class GenController extends BaseController { +// +// /** 前缀标识 */ +// private String prefix = "tool/gen"; +// +// @Autowired +// private GenTableService genTableService; +// +// @Autowired +// private GenTableColumnService genTableColumnService; +// +// // @RequiresPermissions("tool:gen:view") +// @GetMapping() +// public String gen() { +// return prefix + "/gen"; +// } +// +// /** +// * 查询代码生成列表 +// */ +//// @RequiresPermissions("tool:gen:list") +// @PostMapping("/list") +// @ResponseBody +// public ResponseResult genList(GenTable genTable) { +// startPage(); +// List list = genTableService.selectGenTableList(genTable); +// TableDataInfo dataTable = getDataTable(list); +// return ResponseResult.success(dataTable); +// } +// +// /** +// * 查询数据库列表 +// */ +//// @RequiresPermissions("tool:gen:list") +// @PostMapping("/db/list") +// @ResponseBody +// public ResponseResult dataList(GenTable genTable) { +// startPage(); +// List list = genTableService.selectDbTableList(genTable); +// TableDataInfo dataTable = getDataTable(list); +// return ResponseResult.success(dataTable); +// } +// +// /** +// * 查询数据表字段列表 +// */ +//// @RequiresPermissions("tool:gen:list") +// @PostMapping("/column/list") +// @ResponseBody +// public ResponseResult columnList(GenTableColumn genTableColumn) { +// TableDataInfo dataInfo = new TableDataInfo(); +// List list = genTableColumnService.selectGenTableColumnListByTableId(genTableColumn); +// dataInfo.setRows(list); +// dataInfo.setTotal(list.size()); +// return ResponseResult.success(dataInfo); +// } +// +// /** +// * 导入表结构 +// */ +//// @RequiresPermissions("tool:gen:list") +// @GetMapping("/importTable") +// public ResponseResult importTable() { +// return ResponseResult.success(prefix + "/importTable"); +// } +// +// /** +// * 创建表结构 +// */ +// @GetMapping("/createTable") +// public ResponseResult createTable() { +// return ResponseResult.success(prefix + "/createTable"); +// } +// +// /** +// * 导入表结构(保存) +// */ +//// @RequiresPermissions("tool:gen:list") +// @Log(title = "代码生成", businessType = BusinessType.IMPORT) +// @PostMapping("/importTable") +// @ResponseBody +// public ResponseResult importTableSave(String tables) { +// String[] tableNames = Convert.toStrArray(tables); +// // 查询表信息 +// List tableList = genTableService.selectDbTableListByNames(tableNames); +//// String operName = Convert.toStr(PermissionUtils.getPrincipalProperty("loginName")); +// String operName = "kevin"; +// genTableService.importGenTable(tableList, operName); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// /** +// * 修改代码生成业务 +// */ +//// @RequiresPermissions("tool:gen:edit") +// @GetMapping("/edit/{tableId}") +// public ResponseResult edit(@PathVariable("tableId") Long tableId, ModelMap mmap) { +// GenTable table = genTableService.selectGenTableById(tableId); +// List genTables = genTableService.selectGenTableAll(); +// List cxSelect = new ArrayList(); +// for (GenTable genTable : genTables) { +// if (!Objects.equals(table.getTableName(), genTable.getTableName())) { +// CxSelect cxTable = new CxSelect(genTable.getTableName(), genTable.getTableName() + ':' + genTable.getTableComment()); +// List cxColumns = new ArrayList(); +// for (GenTableColumn tableColumn : genTable.getColumns()) { +// cxColumns.add(new CxSelect(tableColumn.getColumnName(), tableColumn.getColumnName() + ':' + tableColumn.getColumnComment())); +// } +// cxTable.setS(cxColumns); +// cxSelect.add(cxTable); +// } +// } +// mmap.put("table", table); +// mmap.put("data", JSON.toJSON(cxSelect)); +// return ResponseResult.success(prefix + "/edit"); +// } +// +// /** +// * 修改保存代码生成业务 +// */ +//// @RequiresPermissions("tool:gen:edit") +// @Log(title = "代码生成", businessType = BusinessType.UPDATE) +// @PostMapping("/edit") +// @ResponseBody +// public ResponseResult editSave(@Validated GenTable genTable) { +// genTableService.validateEdit(genTable); +// genTableService.updateGenTable(genTable); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// // @RequiresPermissions("tool:gen:remove") +// @Log(title = "代码生成", businessType = BusinessType.DELETE) +// @PostMapping("/remove") +// @ResponseBody +// public ResponseResult remove(String ids) { +// genTableService.deleteGenTableByIds(ids); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// // @RequiresRoles("admin") +// @Log(title = "创建表", businessType = BusinessType.OTHER) +// @PostMapping("/createTable") +// @ResponseBody +// public ResponseResult create(String sql) { +// try { +// SqlUtil.filterKeyword(sql); +// List sqlStatements = SQLUtils.parseStatements(sql, DbType.mysql); +// List tableNames = new ArrayList<>(); +// for (SQLStatement sqlStatement : sqlStatements) { +// if (sqlStatement instanceof MySqlCreateTableStatement) { +// MySqlCreateTableStatement createTableStatement = (MySqlCreateTableStatement) sqlStatement; +// if (genTableService.createTable(createTableStatement.toString())) { +// String tableName = createTableStatement.getTableName().replaceAll("`", ""); +// tableNames.add(tableName); +// } +// } +// } +// List tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[tableNames.size()])); +//// String operName = Convert.toStr(PermissionUtils.getPrincipalProperty("loginName")); +// String operName = "kevin"; +// genTableService.importGenTable(tableList, operName); +// return ResponseResult.success(Boolean.TRUE); +// } catch (Exception e) { +// log.error(e.getMessage(), e); +// return ResponseResult.fail("创建表结构异常[" + e.getMessage() + "]"); +// } +// } +// +// /** +// * 预览代码 +// */ +//// @RequiresPermissions("tool:gen:preview") +// @GetMapping("/preview/{tableId}") +// @ResponseBody +// public ResponseResult> preview(@PathVariable("tableId") Long tableId) throws IOException { +// Map dataMap = genTableService.previewCode(tableId); +// return ResponseResult.success(dataMap); +// } +// +// /** +// * 生成代码(下载方式) +// */ +//// @RequiresPermissions("tool:gen:code") +// @Log(title = "代码生成", businessType = BusinessType.GENCODE) +// @GetMapping("/download/{tableName}") +// public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { +// byte[] data = genTableService.downloadCode(tableName); +// genCode(response, data); +// } +// +// /** +// * 生成代码(自定义路径) +// */ +//// @RequiresPermissions("tool:gen:code") +// @Log(title = "代码生成", businessType = BusinessType.GENCODE) +// @GetMapping("/genCode/{tableName}") +// @ResponseBody +// public ResponseResult genCode(@PathVariable("tableName") String tableName) { +// genTableService.generatorCode(tableName); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// /** +// * 同步数据库 +// */ +//// @RequiresPermissions("tool:gen:edit") +// @Log(title = "代码生成", businessType = BusinessType.UPDATE) +// @GetMapping("/synchDb/{tableName}") +// @ResponseBody +// public ResponseResult synchDb(@PathVariable("tableName") String tableName) { +// genTableService.synchDb(tableName); +// return ResponseResult.success(Boolean.TRUE); +// } +// +// /** +// * 批量生成代码 +// */ +//// @RequiresPermissions("tool:gen:code") +// @Log(title = "代码生成", businessType = BusinessType.GENCODE) +// @GetMapping("/batchGenCode") +// @ResponseBody +// public void batchGenCode(HttpServletResponse response, String tables) throws IOException { +// String[] tableNames = Convert.toStrArray(tables); +// byte[] data = genTableService.downloadCode(tableNames); +// genCode(response, data); +// } +// +// /** +// * 生成zip文件 +// */ +// private void genCode(HttpServletResponse response, byte[] data) throws IOException { +// response.reset(); +// response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); +// response.addHeader("Content-Length", "" + data.length); +// response.setContentType("application/octet-stream; charset=UTF-8"); +// IOUtils.write(data, response.getOutputStream()); +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable.java b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable.java new file mode 100644 index 0000000..9ff86fe --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable.java @@ -0,0 +1,370 @@ +package com.mosty.common.generator.domain; + +import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; + +import com.mosty.common.base.constant.GenConstants; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.generator.config.BaseEntity; +import org.apache.commons.lang3.ArrayUtils; + +/** + * 业务表 gen_table + * + * @author ruoyi + */ +public class GenTable extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long tableId; + + /** 表名称 */ + @NotBlank(message = "表名称不能为空") + private String tableName; + + /** 表描述 */ + @NotBlank(message = "表描述不能为空") + private String tableComment; + + /** 关联父表的表名 */ + private String subTableName; + + /** 本表关联父表的外键名 */ + private String subTableFkName; + + /** 实体类名称(首字母大写) */ + @NotBlank(message = "实体类名称不能为空") + private String className; + + /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */ + private String tplCategory; + + /** 生成包路径 */ + @NotBlank(message = "生成包路径不能为空") + private String packageName; + + /** 生成模块名 */ + @NotBlank(message = "生成模块名不能为空") + private String moduleName; + + /** 生成业务名 */ + @NotBlank(message = "生成业务名不能为空") + private String businessName; + + /** 生成功能名 */ + @NotBlank(message = "生成功能名不能为空") + private String functionName; + + /** 生成作者 */ + @NotBlank(message = "作者不能为空") + private String functionAuthor; + + /** 生成代码方式(0zip压缩包 1自定义路径) */ + private String genType; + + /** 生成路径(不填默认项目路径) */ + private String genPath; + + /** 主键信息 */ + private GenTableColumn pkColumn; + + /** 子表信息 */ + private GenTable subTable; + + /** 表列信息 */ + @Valid + private List columns; + + /** 其它生成选项 */ + private String options; + + /** 树编码字段 */ + private String treeCode; + + /** 树父编码字段 */ + private String treeParentCode; + + /** 树名称字段 */ + private String treeName; + + /** 上级菜单ID字段 */ + private String parentMenuId; + + /** 上级菜单名称字段 */ + private String parentMenuName; + + public Long getTableId() + { + return tableId; + } + + public void setTableId(Long tableId) + { + this.tableId = tableId; + } + + public String getTableName() + { + return tableName; + } + + public void setTableName(String tableName) + { + this.tableName = tableName; + } + + public String getTableComment() + { + return tableComment; + } + + public void setTableComment(String tableComment) + { + this.tableComment = tableComment; + } + + public String getSubTableName() + { + return subTableName; + } + + public void setSubTableName(String subTableName) + { + this.subTableName = subTableName; + } + + public String getSubTableFkName() + { + return subTableFkName; + } + + public void setSubTableFkName(String subTableFkName) + { + this.subTableFkName = subTableFkName; + } + + public String getClassName() + { + return className; + } + + public void setClassName(String className) + { + this.className = className; + } + + public String getTplCategory() + { + return tplCategory; + } + + public void setTplCategory(String tplCategory) + { + this.tplCategory = tplCategory; + } + + public String getPackageName() + { + return packageName; + } + + public void setPackageName(String packageName) + { + this.packageName = packageName; + } + + public String getModuleName() + { + return moduleName; + } + + public void setModuleName(String moduleName) + { + this.moduleName = moduleName; + } + + public String getBusinessName() + { + return businessName; + } + + public void setBusinessName(String businessName) + { + this.businessName = businessName; + } + + public String getFunctionName() + { + return functionName; + } + + public void setFunctionName(String functionName) + { + this.functionName = functionName; + } + + public String getFunctionAuthor() + { + return functionAuthor; + } + + public void setFunctionAuthor(String functionAuthor) + { + this.functionAuthor = functionAuthor; + } + + public String getGenType() + { + return genType; + } + + public void setGenType(String genType) + { + this.genType = genType; + } + + public String getGenPath() + { + return genPath; + } + + public void setGenPath(String genPath) + { + this.genPath = genPath; + } + + public GenTableColumn getPkColumn() + { + return pkColumn; + } + + public void setPkColumn(GenTableColumn pkColumn) + { + this.pkColumn = pkColumn; + } + + public GenTable getSubTable() + { + return subTable; + } + + public void setSubTable(GenTable subTable) + { + this.subTable = subTable; + } + public List getColumns() + { + return columns; + } + + public void setColumns(List columns) + { + this.columns = columns; + } + + public String getOptions() + { + return options; + } + + public void setOptions(String options) + { + this.options = options; + } + + public String getTreeCode() + { + return treeCode; + } + + public void setTreeCode(String treeCode) + { + this.treeCode = treeCode; + } + + public String getTreeParentCode() + { + return treeParentCode; + } + + public void setTreeParentCode(String treeParentCode) + { + this.treeParentCode = treeParentCode; + } + + public String getTreeName() + { + return treeName; + } + + public void setTreeName(String treeName) + { + this.treeName = treeName; + } + + public String getParentMenuId() + { + return parentMenuId; + } + + public void setParentMenuId(String parentMenuId) + { + this.parentMenuId = parentMenuId; + } + + public String getParentMenuName() + { + return parentMenuName; + } + + public void setParentMenuName(String parentMenuName) + { + this.parentMenuName = parentMenuName; + } + + public boolean isSub() + { + return isSub(this.tplCategory); + } + + public static boolean isSub(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory); + } + public boolean isTree() + { + return isTree(this.tplCategory); + } + + public static boolean isTree(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); + } + + public boolean isCrud() + { + return isCrud(this.tplCategory); + } + + public static boolean isCrud(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); + } + + public boolean isSuperColumn(String javaField) + { + return isSuperColumn(this.tplCategory, javaField); + } + + public static boolean isSuperColumn(String tplCategory, String javaField) + { + if (isTree(tplCategory)) + { + return StringUtils.equalsAnyIgnoreCase(javaField, + ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); + } + return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn.java b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn.java new file mode 100644 index 0000000..32f931b --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn.java @@ -0,0 +1,349 @@ +package com.mosty.common.generator.domain; + + +import com.mosty.common.generator.config.BaseEntity; +import com.mosty.common.generator.util.StringUtils; + +import javax.validation.constraints.NotBlank; + +/** + * 代码生成业务字段表 gen_table_column + * + * @author ruoyi + */ +public class GenTableColumn extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 编号 + */ + private Long columnId; + + /** + * 归属表编号 + */ + private Long tableId; + + /** + * 列名称 + */ + private String columnName; + + /** + * 列描述 + */ + private String columnComment; + + /** + * 列类型 + */ + private String columnType; + + /** + * JAVA类型 + */ + private String javaType; + + /** + * JAVA字段名 + */ + @NotBlank(message = "Java属性不能为空") + private String javaField; + + /** + * 是否主键(1是) + */ + private String isPk; + + /** + * 是否自增(1是) + */ + private String isIncrement; + + /** + * 是否必填(1是) + */ + private String isRequired; + + /** + * 是否为插入字段(1是) + */ + private String isInsert; + + /** + * 是否编辑字段(1是) + */ + private String isEdit; + + /** + * 是否列表字段(1是) + */ + private String isList; + + /** + * 是否查询字段(1是) + */ + private String isQuery; + + /** + * 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) + */ + private String queryType; + + /** + * 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) + */ + private String htmlType; + + /** + * 字典类型 + */ + private String dictType; + + /** + * 排序 + */ + private Integer sort; + + public void setColumnId(Long columnId) { + this.columnId = columnId; + } + + public Long getColumnId() { + return columnId; + } + + public void setTableId(Long tableId) { + this.tableId = tableId; + } + + public Long getTableId() { + return tableId; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnComment(String columnComment) { + this.columnComment = columnComment; + } + + public String getColumnComment() { + return columnComment; + } + + public void setColumnType(String columnType) { + this.columnType = columnType; + } + + public String getColumnType() { + return columnType; + } + + public void setJavaType(String javaType) { + this.javaType = javaType; + } + + public String getJavaType() { + return javaType; + } + + public void setJavaField(String javaField) { + this.javaField = javaField; + } + + public String getJavaField() { + return javaField; + } + + public String getCapJavaField() { + return StringUtils.capitalize(javaField); + } + + public void setIsPk(String isPk) { + this.isPk = isPk; + } + + public String getIsPk() { + return isPk; + } + + public boolean isPk() { + return isPk(this.isPk); + } + + public boolean isPk(String isPk) { + return isPk != null && StringUtils.equals("1", isPk); + } + + public String getIsIncrement() { + return isIncrement; + } + + public void setIsIncrement(String isIncrement) { + this.isIncrement = isIncrement; + } + + public boolean isIncrement() { + return isIncrement(this.isIncrement); + } + + public boolean isIncrement(String isIncrement) { + return isIncrement != null && StringUtils.equals("1", isIncrement); + } + + public void setIsRequired(String isRequired) { + this.isRequired = isRequired; + } + + public String getIsRequired() { + return isRequired; + } + + public boolean isRequired() { + return isRequired(this.isRequired); + } + + public boolean isRequired(String isRequired) { + return isRequired != null && StringUtils.equals("1", isRequired); + } + + public void setIsInsert(String isInsert) { + this.isInsert = isInsert; + } + + public String getIsInsert() { + return isInsert; + } + + public boolean isInsert() { + return isInsert(this.isInsert); + } + + public boolean isInsert(String isInsert) { + return isInsert != null && StringUtils.equals("1", isInsert); + } + + public void setIsEdit(String isEdit) { + this.isEdit = isEdit; + } + + public String getIsEdit() { + return isEdit; + } + + public boolean isEdit() { + return isInsert(this.isEdit); + } + + public boolean isEdit(String isEdit) { + return isEdit != null && StringUtils.equals("1", isEdit); + } + + public void setIsList(String isList) { + this.isList = isList; + } + + public String getIsList() { + return isList; + } + + public boolean isList() { + return isList(this.isList); + } + + public boolean isList(String isList) { + return isList != null && StringUtils.equals("1", isList); + } + + public void setIsQuery(String isQuery) { + this.isQuery = isQuery; + } + + public String getIsQuery() { + return isQuery; + } + + public boolean isQuery() { + return isQuery(this.isQuery); + } + + public boolean isQuery(String isQuery) { + return isQuery != null && StringUtils.equals("1", isQuery); + } + + public void setQueryType(String queryType) { + this.queryType = queryType; + } + + public String getQueryType() { + return queryType; + } + + public String getHtmlType() { + return htmlType; + } + + public void setHtmlType(String htmlType) { + this.htmlType = htmlType; + } + + public void setDictType(String dictType) { + this.dictType = dictType; + } + + public String getDictType() { + return dictType; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Integer getSort() { + return sort; + } + + public boolean isSuperColumn() { + return isSuperColumn(this.javaField); + } + + public static boolean isSuperColumn(String javaField) { + return StringUtils.equalsAnyIgnoreCase(javaField, + // BaseEntity + "createBy", "createTime", "updateBy", "updateTime", "remark", + // TreeEntity + "parentName", "parentId", "orderNum", "ancestors"); + } + + public boolean isUsableColumn() { + return isUsableColumn(javaField); + } + + public static boolean isUsableColumn(String javaField) { + // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 + return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); + } + + public String readConverterExp() { + String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); + StringBuffer sb = new StringBuffer(); + if (StringUtils.isNotEmpty(remarks)) { + for (String value : remarks.split(" ")) { + if (StringUtils.isNotEmpty(value)) { + Object startStr = value.subSequence(0, 1); + String endStr = value.substring(1); + sb.append("").append(startStr).append("=").append(endStr).append(","); + } + } + return sb.deleteCharAt(sb.length() - 1).toString(); + } else { + return this.columnComment; + } + } +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn_bak.java new file mode 100644 index 0000000..b296b2a --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTableColumn_bak.java @@ -0,0 +1,349 @@ +//package com.mosty.common.generator.domain; +// +// +//import com.mosty.common.base.entity.log.BaseEntity; +//import com.mosty.common.base.util.StringUtils; +// +////import javax.validation.constraints.NotBlank; +// +///** +// * 代码生成业务字段表 gen_table_column +// * +// * @author ruoyi +// */ +//public class GenTableColumn extends BaseEntity { +// private static final long serialVersionUID = 1L; +// +// /** +// * 编号 +// */ +// private Long columnId; +// +// /** +// * 归属表编号 +// */ +// private Long tableId; +// +// /** +// * 列名称 +// */ +// private String columnName; +// +// /** +// * 列描述 +// */ +// private String columnComment; +// +// /** +// * 列类型 +// */ +// private String columnType; +// +// /** +// * JAVA类型 +// */ +// private String javaType; +// +// /** +// * JAVA字段名 +// */ +//// @NotBlank(message = "Java属性不能为空") +// private String javaField; +// +// /** +// * 是否主键(1是) +// */ +// private String isPk; +// +// /** +// * 是否自增(1是) +// */ +// private String isIncrement; +// +// /** +// * 是否必填(1是) +// */ +// private String isRequired; +// +// /** +// * 是否为插入字段(1是) +// */ +// private String isInsert; +// +// /** +// * 是否编辑字段(1是) +// */ +// private String isEdit; +// +// /** +// * 是否列表字段(1是) +// */ +// private String isList; +// +// /** +// * 是否查询字段(1是) +// */ +// private String isQuery; +// +// /** +// * 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) +// */ +// private String queryType; +// +// /** +// * 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、upload上传控件、summernote富文本控件) +// */ +// private String htmlType; +// +// /** +// * 字典类型 +// */ +// private String dictType; +// +// /** +// * 排序 +// */ +// private Integer sort; +// +// public void setColumnId(Long columnId) { +// this.columnId = columnId; +// } +// +// public Long getColumnId() { +// return columnId; +// } +// +// public void setTableId(Long tableId) { +// this.tableId = tableId; +// } +// +// public Long getTableId() { +// return tableId; +// } +// +// public void setColumnName(String columnName) { +// this.columnName = columnName; +// } +// +// public String getColumnName() { +// return columnName; +// } +// +// public void setColumnComment(String columnComment) { +// this.columnComment = columnComment; +// } +// +// public String getColumnComment() { +// return columnComment; +// } +// +// public void setColumnType(String columnType) { +// this.columnType = columnType; +// } +// +// public String getColumnType() { +// return columnType; +// } +// +// public void setJavaType(String javaType) { +// this.javaType = javaType; +// } +// +// public String getJavaType() { +// return javaType; +// } +// +// public void setJavaField(String javaField) { +// this.javaField = javaField; +// } +// +// public String getJavaField() { +// return javaField; +// } +// +// public String getCapJavaField() { +// return StringUtils.capitalize(javaField); +// } +// +// public void setIsPk(String isPk) { +// this.isPk = isPk; +// } +// +// public String getIsPk() { +// return isPk; +// } +// +// public boolean isPk() { +// return isPk(this.isPk); +// } +// +// public boolean isPk(String isPk) { +// return isPk != null && StringUtils.equals("1", isPk); +// } +// +// public String getIsIncrement() { +// return isIncrement; +// } +// +// public void setIsIncrement(String isIncrement) { +// this.isIncrement = isIncrement; +// } +// +// public boolean isIncrement() { +// return isIncrement(this.isIncrement); +// } +// +// public boolean isIncrement(String isIncrement) { +// return isIncrement != null && StringUtils.equals("1", isIncrement); +// } +// +// public void setIsRequired(String isRequired) { +// this.isRequired = isRequired; +// } +// +// public String getIsRequired() { +// return isRequired; +// } +// +// public boolean isRequired() { +// return isRequired(this.isRequired); +// } +// +// public boolean isRequired(String isRequired) { +// return isRequired != null && StringUtils.equals("1", isRequired); +// } +// +// public void setIsInsert(String isInsert) { +// this.isInsert = isInsert; +// } +// +// public String getIsInsert() { +// return isInsert; +// } +// +// public boolean isInsert() { +// return isInsert(this.isInsert); +// } +// +// public boolean isInsert(String isInsert) { +// return isInsert != null && StringUtils.equals("1", isInsert); +// } +// +// public void setIsEdit(String isEdit) { +// this.isEdit = isEdit; +// } +// +// public String getIsEdit() { +// return isEdit; +// } +// +// public boolean isEdit() { +// return isInsert(this.isEdit); +// } +// +// public boolean isEdit(String isEdit) { +// return isEdit != null && StringUtils.equals("1", isEdit); +// } +// +// public void setIsList(String isList) { +// this.isList = isList; +// } +// +// public String getIsList() { +// return isList; +// } +// +// public boolean isList() { +// return isList(this.isList); +// } +// +// public boolean isList(String isList) { +// return isList != null && StringUtils.equals("1", isList); +// } +// +// public void setIsQuery(String isQuery) { +// this.isQuery = isQuery; +// } +// +// public String getIsQuery() { +// return isQuery; +// } +// +// public boolean isQuery() { +// return isQuery(this.isQuery); +// } +// +// public boolean isQuery(String isQuery) { +// return isQuery != null && StringUtils.equals("1", isQuery); +// } +// +// public void setQueryType(String queryType) { +// this.queryType = queryType; +// } +// +// public String getQueryType() { +// return queryType; +// } +// +// public String getHtmlType() { +// return htmlType; +// } +// +// public void setHtmlType(String htmlType) { +// this.htmlType = htmlType; +// } +// +// public void setDictType(String dictType) { +// this.dictType = dictType; +// } +// +// public String getDictType() { +// return dictType; +// } +// +// public void setSort(Integer sort) { +// this.sort = sort; +// } +// +// public Integer getSort() { +// return sort; +// } +// +// public boolean isSuperColumn() { +// return isSuperColumn(this.javaField); +// } +// +// public static boolean isSuperColumn(String javaField) { +// return StringUtils.equalsAnyIgnoreCase(javaField, +// // BaseEntity +// "createBy", "createTime", "updateBy", "updateTime", "remark", +// // TreeEntity +// "parentName", "parentId", "orderNum", "ancestors"); +// } +// +// public boolean isUsableColumn() { +// return isUsableColumn(javaField); +// } +// +// public static boolean isUsableColumn(String javaField) { +// // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 +// return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); +// } +// +// public String readConverterExp() { +// String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); +// StringBuffer sb = new StringBuffer(); +// if (StringUtils.isNotEmpty(remarks)) { +// for (String value : remarks.split(" ")) { +// if (StringUtils.isNotEmpty(value)) { +// Object startStr = value.subSequence(0, 1); +// String endStr = value.substring(1); +// sb.append("").append(startStr).append("=").append(endStr).append(","); +// } +// } +// return sb.deleteCharAt(sb.length() - 1).toString(); +// } else { +// return this.columnComment; +// } +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable_bak.java new file mode 100644 index 0000000..f1ad2ab --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/domain/GenTable_bak.java @@ -0,0 +1,365 @@ +//package com.mosty.common.generator.domain; +// +//import com.mosty.common.base.constant.GenConstants; +//import com.mosty.common.base.entity.log.BaseEntity; +//import org.apache.commons.lang3.ArrayUtils; +//import org.apache.commons.lang3.StringUtils; +// +//import javax.validation.Valid; +//import javax.validation.constraints.NotBlank; +//import java.util.List; +//import java.util.Objects; +// +///** +// * 业务表 gen_table +// * +// * @author ruoyi +// */ +//public class GenTable extends BaseEntity { +// +// private static final long serialVersionUID = 1L; +// +// /** +// * 编号 +// */ +// private Long tableId; +// +// /** +// * 表名称 +// */ +// @NotBlank(message = "表名称不能为空") +// private String tableName; +// +// /** +// * 表描述 +// */ +// @NotBlank(message = "表描述不能为空") +// private String tableComment; +// +// /** +// * 关联父表的表名 +// */ +// private String subTableName; +// +// /** +// * 本表关联父表的外键名 +// */ +// private String subTableFkName; +// +// /** +// * 实体类名称(首字母大写) +// */ +// @NotBlank(message = "实体类名称不能为空") +// private String className; +// +// /** +// * 使用的模板(crud单表操作 tree树表操作 sub主子表操作) +// */ +// private String tplCategory; +// +// /** +// * 生成包路径 +// */ +// @NotBlank(message = "生成包路径不能为空") +// private String packageName; +// +// /** +// * 生成模块名 +// */ +// @NotBlank(message = "生成模块名不能为空") +// private String moduleName; +// +// /** +// * 生成业务名 +// */ +// @NotBlank(message = "生成业务名不能为空") +// private String businessName; +// +// /** +// * 生成功能名 +// */ +// @NotBlank(message = "生成功能名不能为空") +// private String functionName; +// +// /** +// * 生成作者 +// */ +// @NotBlank(message = "作者不能为空") +// private String functionAuthor; +// +// /** +// * 生成代码方式(0zip压缩包 1自定义路径) +// */ +// private String genType; +// +// /** +// * 生成路径(不填默认项目路径) +// */ +// private String genPath; +// +// /** +// * 主键信息 +// */ +// private GenTableColumn pkColumn; +// +// /** +// * 子表信息 +// */ +// private GenTable subTable; +// +// /** +// * 表列信息 +// */ +// @Valid +// private List columns; +// +// /** +// * 其它生成选项 +// */ +// private String options; +// +// /** +// * 树编码字段 +// */ +// private String treeCode; +// +// /** +// * 树父编码字段 +// */ +// private String treeParentCode; +// +// /** +// * 树名称字段 +// */ +// private String treeName; +// +// /** +// * 上级菜单ID字段 +// */ +// private String parentMenuId; +// +// /** +// * 上级菜单名称字段 +// */ +// private String parentMenuName; +// +// public Long getTableId() { +// return tableId; +// } +// +// public void setTableId(Long tableId) { +// this.tableId = tableId; +// } +// +// public String getTableName() { +// return tableName; +// } +// +// public void setTableName(String tableName) { +// this.tableName = tableName; +// } +// +// public String getTableComment() { +// return tableComment; +// } +// +// public void setTableComment(String tableComment) { +// this.tableComment = tableComment; +// } +// +// public String getSubTableName() { +// return subTableName; +// } +// +// public void setSubTableName(String subTableName) { +// this.subTableName = subTableName; +// } +// +// public String getSubTableFkName() { +// return subTableFkName; +// } +// +// public void setSubTableFkName(String subTableFkName) { +// this.subTableFkName = subTableFkName; +// } +// +// public String getClassName() { +// return className; +// } +// +// public void setClassName(String className) { +// this.className = className; +// } +// +// public String getTplCategory() { +// return tplCategory; +// } +// +// public void setTplCategory(String tplCategory) { +// this.tplCategory = tplCategory; +// } +// +// public String getPackageName() { +// return packageName; +// } +// +// public void setPackageName(String packageName) { +// this.packageName = packageName; +// } +// +// public String getModuleName() { +// return moduleName; +// } +// +// public void setModuleName(String moduleName) { +// this.moduleName = moduleName; +// } +// +// public String getBusinessName() { +// return businessName; +// } +// +// public void setBusinessName(String businessName) { +// this.businessName = businessName; +// } +// +// public String getFunctionName() { +// return functionName; +// } +// +// public void setFunctionName(String functionName) { +// this.functionName = functionName; +// } +// +// public String getFunctionAuthor() { +// return functionAuthor; +// } +// +// public void setFunctionAuthor(String functionAuthor) { +// this.functionAuthor = functionAuthor; +// } +// +// public String getGenType() { +// return genType; +// } +// +// public void setGenType(String genType) { +// this.genType = genType; +// } +// +// public String getGenPath() { +// return genPath; +// } +// +// public void setGenPath(String genPath) { +// this.genPath = genPath; +// } +// +// public GenTableColumn getPkColumn() { +// return pkColumn; +// } +// +// public void setPkColumn(GenTableColumn pkColumn) { +// this.pkColumn = pkColumn; +// } +// +// public GenTable getSubTable() { +// return subTable; +// } +// +// public void setSubTable(GenTable subTable) { +// this.subTable = subTable; +// } +// +// public List getColumns() { +// return columns; +// } +// +// public void setColumns(List columns) { +// this.columns = columns; +// } +// +// public String getOptions() { +// return options; +// } +// +// public void setOptions(String options) { +// this.options = options; +// } +// +// public String getTreeCode() { +// return treeCode; +// } +// +// public void setTreeCode(String treeCode) { +// this.treeCode = treeCode; +// } +// +// public String getTreeParentCode() { +// return treeParentCode; +// } +// +// public void setTreeParentCode(String treeParentCode) { +// this.treeParentCode = treeParentCode; +// } +// +// public String getTreeName() { +// return treeName; +// } +// +// public void setTreeName(String treeName) { +// this.treeName = treeName; +// } +// +// public String getParentMenuId() { +// return parentMenuId; +// } +// +// public void setParentMenuId(String parentMenuId) { +// this.parentMenuId = parentMenuId; +// } +// +// public String getParentMenuName() { +// return parentMenuName; +// } +// +// public void setParentMenuName(String parentMenuName) { +// this.parentMenuName = parentMenuName; +// } +// +// public boolean isSub() { +// return isSub(this.tplCategory); +// } +// +// public static boolean isSub(String tplCategory) { +// return tplCategory != null && Objects.equals(GenConstants.TPL_SUB, tplCategory); +// } +// +// public boolean isTree() { +// return isTree(this.tplCategory); +// } +// +// public static boolean isTree(String tplCategory) { +// return tplCategory != null && Objects.equals(GenConstants.TPL_TREE, tplCategory); +// } +// +// public boolean isCrud() { +// return isCrud(this.tplCategory); +// } +// +// public static boolean isCrud(String tplCategory) { +// return tplCategory != null && Objects.equals(GenConstants.TPL_CRUD, tplCategory); +// } +// +// public boolean isSuperColumn(String javaField) { +// return isSuperColumn(this.tplCategory, javaField); +// } +// +// public static boolean isSuperColumn(String tplCategory, String javaField) { +// if (isTree(tplCategory)) { +// return StringUtils.equalsAnyIgnoreCase(javaField, +// ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); +// } +// return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper.java b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper.java new file mode 100644 index 0000000..991c275 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper.java @@ -0,0 +1,61 @@ +package com.mosty.common.generator.mapper; + + +import com.mosty.common.generator.domain.GenTableColumn; + +import java.util.List; + +/** + * 业务字段 数据层 + * + * @author ruoyi + */ +public interface GenTableColumnMapper { + /** + * 根据表名称查询列信息 + * + * @param tableName 表名称 + * @return 列信息 + */ + public List selectDbTableColumnsByName(String tableName); + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 删除业务字段 + * + * @param genTableColumns 列数据 + * @return 结果 + */ + public int deleteGenTableColumns(List genTableColumns); + + /** + * 批量删除业务字段 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(Long[] ids); +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper_bak.java new file mode 100644 index 0000000..c5aa647 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableColumnMapper_bak.java @@ -0,0 +1,60 @@ +//package com.mosty.common.generator.mapper; +// +//import com.mosty.common.generator.domain.GenTableColumn; +// +//import java.util.List; +// +///** +// * 业务字段 数据层 +// * +// * @author ruoyi +// */ +//public interface GenTableColumnMapper { +// /** +// * 根据表名称查询列信息 +// * +// * @param tableName 表名称 +// * @return 列信息 +// */ +// List selectDbTableColumnsByName(String tableName); +// +// /** +// * 查询业务字段列表 +// * +// * @param genTableColumn 业务字段信息 +// * @return 业务字段集合 +// */ +// List selectGenTableColumnListByTableId(GenTableColumn genTableColumn); +// +// /** +// * 新增业务字段 +// * +// * @param genTableColumn 业务字段信息 +// * @return 结果 +// */ +// int insertGenTableColumn(GenTableColumn genTableColumn); +// +// /** +// * 修改业务字段 +// * +// * @param genTableColumn 业务字段信息 +// * @return 结果 +// */ +// int updateGenTableColumn(GenTableColumn genTableColumn); +// +// /** +// * 删除业务字段 +// * +// * @param genTableColumns 列数据 +// * @return 结果 +// */ +// int deleteGenTableColumns(List genTableColumns); +// +// /** +// * 批量删除业务字段 +// * +// * @param ids 需要删除的数据ID +// * @return 结果 +// */ +// int deleteGenTableColumnByIds(Long[] ids); +//} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper.java b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper.java new file mode 100644 index 0000000..0106115 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper.java @@ -0,0 +1,84 @@ +package com.mosty.common.generator.mapper; + + +import com.mosty.common.generator.domain.GenTable; + +import java.util.List; + +/** + * 业务 数据层 + * + * @author ruoyi + */ +public interface GenTableMapper { + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + public List selectGenTableAll(); + + /** + * 查询表ID业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 查询表名称业务信息 + * + * @param tableName 表名称 + * @return 业务信息 + */ + public GenTable selectGenTableByName(String tableName); + + /** + * 新增业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int insertGenTable(GenTable genTable); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int updateGenTable(GenTable genTable); + + /** + * 批量删除业务 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableByIds(Long[] ids); +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper_bak.java new file mode 100644 index 0000000..f485ff4 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/mapper/GenTableMapper_bak.java @@ -0,0 +1,91 @@ +//package com.mosty.common.generator.mapper; +// +//import com.mosty.common.generator.domain.GenTable; +// +//import java.util.List; +// +///** +// * 业务 数据层 +// * +// * @author ruoyi +// */ +//public interface GenTableMapper { +// /** +// * 查询业务列表 +// * +// * @param genTable 业务信息 +// * @return 业务集合 +// */ +// List selectGenTableList(GenTable genTable); +// +// /** +// * 查询据库列表 +// * +// * @param genTable 业务信息 +// * @return 数据库表集合 +// */ +// List selectDbTableList(GenTable genTable); +// +// /** +// * 查询据库列表 +// * +// * @param tableNames 表名称组 +// * @return 数据库表集合 +// */ +// List selectDbTableListByNames(String[] tableNames); +// +// /** +// * 查询所有表信息 +// * +// * @return 表信息集合 +// */ +// List selectGenTableAll(); +// +// /** +// * 查询表ID业务信息 +// * +// * @param id 业务ID +// * @return 业务信息 +// */ +// GenTable selectGenTableById(Long id); +// +// /** +// * 查询表名称业务信息 +// * +// * @param tableName 表名称 +// * @return 业务信息 +// */ +// GenTable selectGenTableByName(String tableName); +// +// /** +// * 新增业务 +// * +// * @param genTable 业务信息 +// * @return 结果 +// */ +// int insertGenTable(GenTable genTable); +// +// /** +// * 修改业务 +// * +// * @param genTable 业务信息 +// * @return 结果 +// */ +// int updateGenTable(GenTable genTable); +// +// /** +// * 批量删除业务 +// * +// * @param ids 需要删除的数据ID +// * @return 结果 +// */ +// int deleteGenTableByIds(Long[] ids); +// +// /** +// * 创建表 +// * +// * @param sql +// * @return 结果 +// */ +// int createTable(String sql); +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnServiceImpl.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnServiceImpl.java new file mode 100644 index 0000000..2edafc5 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnServiceImpl.java @@ -0,0 +1,64 @@ +package com.mosty.common.generator.service; + +import com.mosty.common.generator.domain.GenTableColumn; +import com.mosty.common.generator.mapper.GenTableColumnMapper; +import com.mosty.common.generator.util.Convert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 业务字段 服务层实现 + * + * @author ruoyi + */ +@Service +public class GenTableColumnServiceImpl implements IGenTableColumnService { + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + @Override + public List selectGenTableColumnListByTableId(Long tableId) { + return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); + } + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int insertGenTableColumn(GenTableColumn genTableColumn) { + return genTableColumnMapper.insertGenTableColumn(genTableColumn); + } + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int updateGenTableColumn(GenTableColumn genTableColumn) { + return genTableColumnMapper.updateGenTableColumn(genTableColumn); + } + + /** + * 删除业务字段对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteGenTableColumnByIds(String ids) { + return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); + } +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnService_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnService_bak.java new file mode 100644 index 0000000..c5d16d0 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableColumnService_bak.java @@ -0,0 +1,63 @@ +//package com.mosty.common.generator.service; +// +//import cn.hutool.core.convert.Convert; +//import com.mosty.common.generator.mapper.GenTableColumnMapper; +//import com.mosty.common.generator.domain.GenTableColumn; +//import lombok.AllArgsConstructor; +//import org.springframework.stereotype.Service; +// +//import java.util.List; +// +///** +// * 业务字段 服务层实现 +// * +// * @author ruoyi +// */ +//@Service +// +//@AllArgsConstructor +//public class GenTableColumnService { +// +// private final GenTableColumnMapper genTableColumnMapper; +// +// /** +// * 查询业务字段列表 +// * +// * @param genTableColumn 业务字段信息 +// * @return 业务字段集合 +// */ +// public List selectGenTableColumnListByTableId(GenTableColumn genTableColumn) { +// return genTableColumnMapper.selectGenTableColumnListByTableId(genTableColumn); +// } +// +// /** +// * 新增业务字段 +// * +// * @param genTableColumn 业务字段信息 +// * @return 结果 +// */ +// public int insertGenTableColumn(GenTableColumn genTableColumn) { +// return genTableColumnMapper.insertGenTableColumn(genTableColumn); +// } +// +// /** +// * 修改业务字段 +// * +// * @param genTableColumn 业务字段信息 +// * @return 结果 +// */ +// public int updateGenTableColumn(GenTableColumn genTableColumn) { +// return genTableColumnMapper.updateGenTableColumn(genTableColumn); +// } +// +// /** +// * 删除业务字段对象 +// * +// * @param ids 需要删除的数据ID +// * @return 结果 +// */ +// public int deleteGenTableColumnByIds(String ids) { +// return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); +// } +// +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableServiceImpl.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableServiceImpl.java new file mode 100644 index 0000000..dee4bbc --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableServiceImpl.java @@ -0,0 +1,443 @@ +package com.mosty.common.generator.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.mosty.common.base.constant.Constants; +import com.mosty.common.base.exception.BusinessException; +import com.mosty.common.generator.config.GenConstants; +import com.mosty.common.generator.domain.GenTable; +import com.mosty.common.generator.domain.GenTableColumn; +import com.mosty.common.generator.mapper.GenTableColumnMapper; +import com.mosty.common.generator.mapper.GenTableMapper; +import com.mosty.common.generator.util.*; +import com.mosty.common.token.UserInfoManager; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * 业务 服务层实现 + * + * @author ruoyi + */ +@Service +public class GenTableServiceImpl implements IGenTableService { + private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class); + + @Autowired + private GenTableMapper genTableMapper; + + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + @Override + public GenTable selectGenTableById(Long id) { + GenTable genTable = genTableMapper.selectGenTableById(id); + setTableFromOptions(genTable); + return genTable; + } + + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + @Override + public List selectGenTableList(GenTable genTable) { + return genTableMapper.selectGenTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + @Override + public List selectDbTableList(GenTable genTable) { + return genTableMapper.selectDbTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + @Override + public List selectDbTableListByNames(String[] tableNames) { + return genTableMapper.selectDbTableListByNames(tableNames); + } + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + @Override + public List selectGenTableAll() { + return genTableMapper.selectGenTableAll(); + } + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + @Override + @Transactional + public void updateGenTable(GenTable genTable) { + String options = JSON.toJSONString(genTable.getParams()); + genTable.setOptions(options); + int row = genTableMapper.updateGenTable(genTable); + if (row > 0) { + for (GenTableColumn cenTableColumn : genTable.getColumns()) { + genTableColumnMapper.updateGenTableColumn(cenTableColumn); + } + } + } + + /** + * 删除业务对象 + * + * @param tableIds 需要删除的数据ID + * @return 结果 + */ + @Override + @Transactional + public void deleteGenTableByIds(Long[] tableIds) { + genTableMapper.deleteGenTableByIds(tableIds); + genTableColumnMapper.deleteGenTableColumnByIds(tableIds); + } + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + @Override + @Transactional + public void importGenTable(List tableList) { + String operName = /*SecurityUtils.getUsername()*/UserInfoManager.get().userName; + try { + for (GenTable table : tableList) { + String tableName = table.getTableName(); + GenUtils.initTable(table, operName); + int row = genTableMapper.insertGenTable(table); + if (row > 0) { + // 保存列信息 + List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + for (GenTableColumn column : genTableColumns) { + GenUtils.initColumnField(column, table); + genTableColumnMapper.insertGenTableColumn(column); + } + } + } + } catch (Exception e) { + throw new BusinessException("导入失败:" + e.getMessage()); + } + } + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + @Override + public Map previewCode(Long tableId) { + Map dataMap = new LinkedHashMap<>(); + // 查询表信息 + GenTable table = genTableMapper.selectGenTableById(tableId); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + dataMap.put(template, sw.toString()); + } + return dataMap; + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + @Override + public byte[] downloadCode(String tableName) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + generatorCode(tableName, zip); + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + */ + @Override + public void generatorCode(String tableName) { + // 查询表信息 + GenTable table = genTableMapper.selectGenTableByName(tableName); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + String path = getGenPath(table, template); + FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8); + } catch (IOException e) { + throw new BusinessException("渲染模板失败,表名:" + table.getTableName()); + } + } + } + } + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + @Override + @Transactional + public void synchDb(String tableName) { + GenTable table = genTableMapper.selectGenTableByName(tableName); + List tableColumns = table.getColumns(); + Map tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity())); + + List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + if (StringUtils.isEmpty(dbTableColumns)) { + throw new BusinessException("同步数据失败,原表结构不存在"); + } + List dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList()); + + dbTableColumns.forEach(column -> { + GenUtils.initColumnField(column, table); + if (tableColumnMap.containsKey(column.getColumnName())) { + GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName()); + column.setColumnId(prevColumn.getColumnId()); + if (column.isList()) { + // 如果是列表,继续保留字典类型 + column.setDictType(prevColumn.getDictType()); + } + genTableColumnMapper.updateGenTableColumn(column); + } else { + genTableColumnMapper.insertGenTableColumn(column); + } + }); + + List delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList()); + if (StringUtils.isNotEmpty(delColumns)) { + genTableColumnMapper.deleteGenTableColumns(delColumns); + } + } + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + @Override + public byte[] downloadCode(String[] tableNames) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + for (String tableName : tableNames) { + generatorCode(tableName, zip); + } + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 查询表信息并生成代码 + */ + private void generatorCode(String tableName, ZipOutputStream zip) { + // 查询表信息 + GenTable table = genTableMapper.selectGenTableByName(tableName); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + // 添加到zip + zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); + IOUtils.write(sw.toString(), zip, Constants.UTF8); + IOUtils.closeQuietly(sw); + zip.flush(); + zip.closeEntry(); + } catch (IOException e) { + log.error("渲染模板失败,表名:" + table.getTableName(), e); + } + } + } + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + @Override + public void validateEdit(GenTable genTable) { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { + String options = JSON.toJSONString(genTable.getParams()); + JSONObject paramsObj = JSONObject.parseObject(options); + if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) { + throw new BusinessException("树编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) { + throw new BusinessException("树父编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) { + throw new BusinessException("树名称字段不能为空"); + } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) { + if (StringUtils.isEmpty(genTable.getSubTableName())) { + throw new BusinessException("关联子表的表名不能为空"); + } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) { + throw new BusinessException("子表关联的外键名不能为空"); + } + } + } + } + + /** + * 设置主键列信息 + * + * @param table 业务表信息 + */ + public void setPkColumn(GenTable table) { + for (GenTableColumn column : table.getColumns()) { + if (column.isPk()) { + table.setPkColumn(column); + break; + } + } + if (StringUtils.isNull(table.getPkColumn())) { + table.setPkColumn(table.getColumns().get(0)); + } + if (GenConstants.TPL_SUB.equals(table.getTplCategory())) { + for (GenTableColumn column : table.getSubTable().getColumns()) { + if (column.isPk()) { + table.getSubTable().setPkColumn(column); + break; + } + } + if (StringUtils.isNull(table.getSubTable().getPkColumn())) { + table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0)); + } + } + } + + /** + * 设置主子表信息 + * + * @param table 业务表信息 + */ + public void setSubTable(GenTable table) { + String subTableName = table.getSubTableName(); + if (StringUtils.isNotEmpty(subTableName)) { + table.setSubTable(genTableMapper.selectGenTableByName(subTableName)); + } + } + + /** + * 设置代码生成其他选项值 + * + * @param genTable 设置后的生成对象 + */ + public void setTableFromOptions(GenTable genTable) { + JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); + if (StringUtils.isNotNull(paramsObj)) { + String treeCode = paramsObj.getString(GenConstants.TREE_CODE); + String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID); + String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME); + + genTable.setTreeCode(treeCode); + genTable.setTreeParentCode(treeParentCode); + genTable.setTreeName(treeName); + genTable.setParentMenuId(parentMenuId); + genTable.setParentMenuName(parentMenuName); + } + } + + /** + * 获取代码生成地址 + * + * @param table 业务表信息 + * @param template 模板文件路径 + * @return 生成地址 + */ + public static String getGenPath(GenTable table, String template) { + String genPath = table.getGenPath(); + if (StringUtils.equals(genPath, "/")) { + return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); + } + return genPath + File.separator + VelocityUtils.getFileName(template, table); + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableService_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableService_bak.java new file mode 100644 index 0000000..de51f4c --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/GenTableService_bak.java @@ -0,0 +1,439 @@ +//package com.mosty.common.generator.service; +// +//import cn.hutool.core.collection.CollectionUtil; +//import cn.hutool.core.convert.Convert; +//import com.alibaba.fastjson.JSON; +//import com.alibaba.fastjson.JSONObject; +//import com.mosty.common.base.constant.Constants; +//import com.mosty.common.base.constant.GenConstants; +//import com.mosty.common.base.exception.BusinessException; +//import com.mosty.common.generator.domain.GenTable; +//import com.mosty.common.generator.domain.GenTableColumn; +//import com.mosty.common.generator.mapper.GenTableColumnMapper; +//import com.mosty.common.generator.mapper.GenTableMapper; +//import com.mosty.common.generator.util.GenUtils; +//import com.mosty.common.generator.util.VelocityInitializer; +//import com.mosty.common.generator.util.VelocityUtils; +//import lombok.AllArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.commons.io.FileUtils; +//import org.apache.commons.io.IOUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.velocity.Template; +//import org.apache.velocity.VelocityContext; +//import org.apache.velocity.app.Velocity; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +// +//import java.io.ByteArrayOutputStream; +//import java.io.File; +//import java.io.IOException; +//import java.io.StringWriter; +//import java.util.LinkedHashMap; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.function.Function; +//import java.util.stream.Collectors; +//import java.util.zip.ZipEntry; +//import java.util.zip.ZipOutputStream; +// +///** +// * 业务 服务层实现 +// * +// * @author ruoyi +// */ +//@Slf4j +//@Service +//@AllArgsConstructor +//public class GenTableService { +// +// private final GenTableMapper genTableMapper; +// private final GenTableColumnMapper genTableColumnMapper; +// +// /** +// * 查询业务信息 +// * +// * @param id 业务ID +// * @return 业务信息 +// */ +// public GenTable selectGenTableById(Long id) { +// GenTable genTable = genTableMapper.selectGenTableById(id); +// setTableFromOptions(genTable); +// return genTable; +// } +// +// /** +// * 查询业务列表 +// * +// * @param genTable 业务信息 +// * @return 业务集合 +// */ +// public List selectGenTableList(GenTable genTable) { +// return genTableMapper.selectGenTableList(genTable); +// } +// +// /** +// * 查询据库列表 +// * +// * @param genTable 业务信息 +// * @return 数据库表集合 +// */ +// public List selectDbTableList(GenTable genTable) { +// return genTableMapper.selectDbTableList(genTable); +// } +// +// /** +// * 查询据库列表 +// * +// * @param tableNames 表名称组 +// * @return 数据库表集合 +// */ +// public List selectDbTableListByNames(String[] tableNames) { +// return genTableMapper.selectDbTableListByNames(tableNames); +// } +// +// /** +// * 查询所有表信息 +// * +// * @return 表信息集合 +// */ +// public List selectGenTableAll() { +// return genTableMapper.selectGenTableAll(); +// } +// +// /** +// * 修改业务 +// * +// * @param genTable 业务信息 +// */ +// @Transactional +// public void updateGenTable(GenTable genTable) { +// String options = JSON.toJSONString(genTable.getParams()); +// genTable.setOptions(options); +// int row = genTableMapper.updateGenTable(genTable); +// if (row > 0) { +// for (GenTableColumn cenTableColumn : genTable.getColumns()) { +// genTableColumnMapper.updateGenTableColumn(cenTableColumn); +// } +// } +// } +// +// /** +// * 删除业务对象 +// * +// * @param ids 需要删除的数据ID +// */ +// @Transactional +// public void deleteGenTableByIds(String ids) { +// genTableMapper.deleteGenTableByIds(Convert.toLongArray(ids)); +// genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); +// } +// +// /** +// * 创建表 +// * +// * @param sql 创建表语句 +// * @return 结果 +// */ +// public boolean createTable(String sql) { +// return genTableMapper.createTable(sql) == 0; +// } +// +// /** +// * 导入表结构 +// * +// * @param tableList 导入表列表 +// * @param operName 操作人员 +// */ +// @Transactional +// public void importGenTable(List tableList, String operName) { +// try { +// for (GenTable table : tableList) { +// String tableName = table.getTableName(); +// GenUtils.initTable(table, operName); +// int row = genTableMapper.insertGenTable(table); +// if (row > 0) { +// // 保存列信息 +// List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); +// for (GenTableColumn column : genTableColumns) { +// GenUtils.initColumnField(column, table); +// genTableColumnMapper.insertGenTableColumn(column); +// } +// } +// } +// } catch (Exception e) { +// throw new BusinessException("导入失败:" + e.getMessage()); +// } +// } +// +// /** +// * 预览代码 +// * +// * @param tableId 表编号 +// * @return 预览数据列表 +// */ +// public Map previewCode(Long tableId) { +// Map dataMap = new LinkedHashMap<>(); +// // 查询表信息 +// GenTable table = genTableMapper.selectGenTableById(tableId); +// // 设置主子表信息 +// setSubTable(table); +// // 设置主键列信息 +// setPkColumn(table); +// VelocityInitializer.initVelocity(); +// +// VelocityContext context = VelocityUtils.prepareContext(table); +// +// // 获取模板列表 +// List templates = VelocityUtils.getTemplateList(table.getTplCategory()); +// for (String template : templates) { +// // 渲染模板 +// StringWriter sw = new StringWriter(); +// Template tpl = Velocity.getTemplate(template, Constants.UTF8); +// tpl.merge(context, sw); +// dataMap.put(template, sw.toString()); +// } +// return dataMap; +// } +// +// /** +// * 生成代码(下载方式) +// * +// * @param tableName 表名称 +// * @return 数据 +// */ +// public byte[] downloadCode(String tableName) { +// ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); +// ZipOutputStream zip = new ZipOutputStream(outputStream); +// generatorCode(tableName, zip); +// IOUtils.closeQuietly(zip); +// return outputStream.toByteArray(); +// } +// +// /** +// * 生成代码(自定义路径) +// * +// * @param tableName 表名称 +// */ +// public void generatorCode(String tableName) { +// // 查询表信息 +// GenTable table = genTableMapper.selectGenTableByName(tableName); +// // 设置主子表信息 +// setSubTable(table); +// // 设置主键列信息 +// setPkColumn(table); +// +// VelocityInitializer.initVelocity(); +// +// VelocityContext context = VelocityUtils.prepareContext(table); +// +// // 获取模板列表 +// List templates = VelocityUtils.getTemplateList(table.getTplCategory()); +// for (String template : templates) { +// if (!StringUtils.contains(template, "sql.vm")) { +// // 渲染模板 +// StringWriter sw = new StringWriter(); +// Template tpl = Velocity.getTemplate(template, Constants.UTF8); +// tpl.merge(context, sw); +// try { +// String path = getGenPath(table, template); +// FileUtils.writeStringToFile(new File(path), sw.toString(), Constants.UTF8); +// } catch (IOException e) { +// throw new BusinessException("渲染模板失败,表名:" + table.getTableName()); +// } +// } +// } +// } +// +// /** +// * 同步数据库 +// * +// * @param tableName 表名称 +// */ +// @Transactional +// public void synchDb(String tableName) { +// GenTable table = genTableMapper.selectGenTableByName(tableName); +// List tableColumns = table.getColumns(); +// Map tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity())); +// +// List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); +// if (CollectionUtil.isEmpty(dbTableColumns)) { +// throw new BusinessException("同步数据失败,原表结构不存在"); +// } +// List dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList()); +// +// dbTableColumns.forEach(column -> { +// GenUtils.initColumnField(column, table); +// if (tableColumnMap.containsKey(column.getColumnName())) { +// GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName()); +// column.setColumnId(prevColumn.getColumnId()); +// if (column.isList()) { +// // 如果是列表,继续保留字典类型 +// column.setDictType(prevColumn.getDictType()); +// } +// genTableColumnMapper.updateGenTableColumn(column); +// } else { +// genTableColumnMapper.insertGenTableColumn(column); +// } +// }); +// +// List delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(delColumns)) { +// genTableColumnMapper.deleteGenTableColumns(delColumns); +// } +// } +// +// /** +// * 批量生成代码(下载方式) +// * +// * @param tableNames 表数组 +// * @return 数据 +// */ +// public byte[] downloadCode(String[] tableNames) { +// ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); +// ZipOutputStream zip = new ZipOutputStream(outputStream); +// for (String tableName : tableNames) { +// generatorCode(tableName, zip); +// } +// IOUtils.closeQuietly(zip); +// return outputStream.toByteArray(); +// } +// +// /** +// * 查询表信息并生成代码 +// */ +// private void generatorCode(String tableName, ZipOutputStream zip) { +// // 查询表信息 +// GenTable table = genTableMapper.selectGenTableByName(tableName); +// // 设置主子表信息 +// setSubTable(table); +// // 设置主键列信息 +// setPkColumn(table); +// +// VelocityInitializer.initVelocity(); +// +// VelocityContext context = VelocityUtils.prepareContext(table); +// +// // 获取模板列表 +// List templates = VelocityUtils.getTemplateList(table.getTplCategory()); +// for (String template : templates) { +// // 渲染模板 +// StringWriter sw = new StringWriter(); +// Template tpl = Velocity.getTemplate(template, Constants.UTF8); +// tpl.merge(context, sw); +// try { +// // 添加到zip +// zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); +// IOUtils.write(sw.toString(), zip, Constants.UTF8); +// IOUtils.closeQuietly(sw); +// zip.flush(); +// zip.closeEntry(); +// } catch (IOException e) { +// log.error("渲染模板失败,表名:" + table.getTableName(), e); +// } +// } +// } +// +// /** +// * 修改保存参数校验 +// * +// * @param genTable 业务信息 +// */ +// public void validateEdit(GenTable genTable) { +// if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { +// String options = JSON.toJSONString(genTable.getParams()); +// JSONObject paramsObj = JSONObject.parseObject(options); +// if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) { +// throw new BusinessException("树编码字段不能为空"); +// } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) { +// throw new BusinessException("树父编码字段不能为空"); +// } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) { +// throw new BusinessException("树名称字段不能为空"); +// } +// } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) { +// if (StringUtils.isEmpty(genTable.getSubTableName())) { +// throw new BusinessException("关联子表的表名不能为空"); +// } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) { +// throw new BusinessException("子表关联的外键名不能为空"); +// } +// } +// } +// +// /** +// * 设置主键列信息 +// * +// * @param table 业务表信息 +// */ +// public void setPkColumn(GenTable table) { +// for (GenTableColumn column : table.getColumns()) { +// if (column.isPk()) { +// table.setPkColumn(column); +// break; +// } +// } +// if (Objects.isNull(table.getPkColumn())) { +// table.setPkColumn(table.getColumns().get(0)); +// } +// if (GenConstants.TPL_SUB.equals(table.getTplCategory())) { +// for (GenTableColumn column : table.getSubTable().getColumns()) { +// if (column.isPk()) { +// table.getSubTable().setPkColumn(column); +// break; +// } +// } +// if (Objects.isNull(table.getSubTable().getPkColumn())) { +// table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0)); +// } +// } +// } +// +// /** +// * 设置主子表信息 +// * +// * @param table 业务表信息 +// */ +// public void setSubTable(GenTable table) { +// String subTableName = table.getSubTableName(); +// if (StringUtils.isNotEmpty(subTableName)) { +// table.setSubTable(genTableMapper.selectGenTableByName(subTableName)); +// } +// } +// +// /** +// * 设置代码生成其他选项值 +// * +// * @param genTable 设置后的生成对象 +// */ +// public void setTableFromOptions(GenTable genTable) { +// JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); +// if (!Objects.isNull(paramsObj)) { +// String treeCode = paramsObj.getString(GenConstants.TREE_CODE); +// String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE); +// String treeName = paramsObj.getString(GenConstants.TREE_NAME); +// String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID); +// String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME); +// +// genTable.setTreeCode(treeCode); +// genTable.setTreeParentCode(treeParentCode); +// genTable.setTreeName(treeName); +// genTable.setParentMenuId(parentMenuId); +// genTable.setParentMenuName(parentMenuName); +// } +// } +// +// /** +// * 获取代码生成地址 +// * +// * @param table 业务表信息 +// * @param template 模板文件路径 +// * @return 生成地址 +// */ +// public static String getGenPath(GenTable table, String template) { +// String genPath = table.getGenPath(); +// if (StringUtils.equals(genPath, "/")) { +// return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); +// } +// return genPath + File.separator + VelocityUtils.getFileName(template, table); +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableColumnService.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableColumnService.java new file mode 100644 index 0000000..7ab46a1 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableColumnService.java @@ -0,0 +1,45 @@ +package com.mosty.common.generator.service; + + +import com.mosty.common.generator.domain.GenTableColumn; + +import java.util.List; + +/** + * 业务字段 服务层 + * + * @author ruoyi + */ +public interface IGenTableColumnService { + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 删除业务字段信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(String ids); +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableService.java b/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableService.java new file mode 100644 index 0000000..fd9b3ad --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/service/IGenTableService.java @@ -0,0 +1,122 @@ +package com.mosty.common.generator.service; + + +import com.mosty.common.generator.domain.GenTable; + +import java.util.List; +import java.util.Map; + +/** + * 业务 服务层 + * + * @author ruoyi + */ +public interface IGenTableService { + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + public List selectGenTableAll(); + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public void updateGenTable(GenTable genTable); + + /** + * 删除业务信息 + * + * @param tableIds 需要删除的表数据ID + * @return 结果 + */ + public void deleteGenTableByIds(Long[] tableIds); + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + public void importGenTable(List tableList); + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + public Map previewCode(Long tableId); + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + public byte[] downloadCode(String tableName); + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + * @return 数据 + */ + public void generatorCode(String tableName); + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + public void synchDb(String tableName); + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + public byte[] downloadCode(String[] tableNames); + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + public void validateEdit(GenTable genTable); +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/CharsetKit.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/CharsetKit.java new file mode 100644 index 0000000..f4a6cdd --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/CharsetKit.java @@ -0,0 +1,89 @@ +package com.mosty.common.generator.util; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * 字符集工具类 + * + * @author ruoyi + */ +public class CharsetKit { + /** + * ISO-8859-1 + */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** + * UTF-8 + */ + public static final String UTF_8 = "UTF-8"; + /** + * GBK + */ + public static final String GBK = "GBK"; + + /** + * ISO-8859-1 + */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** + * UTF-8 + */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** + * GBK + */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) { + if (null == srcCharset) { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) { + destCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() { + return Charset.defaultCharset().name(); + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/Convert.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/Convert.java new file mode 100644 index 0000000..8841384 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/Convert.java @@ -0,0 +1,854 @@ +package com.mosty.common.generator.util; + +import org.apache.commons.lang3.ArrayUtils; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; + +/** + * 类型转换器 + * + * @author ruoyi + */ +public class Convert { + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) { + if (null == value) { + return defaultValue; + } + if (value instanceof String) { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) { + if (null == value) { + return defaultValue; + } + if (value instanceof Character) { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Byte) { + return (Byte) value; + } + if (value instanceof Number) { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Byte.parseByte(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Short) { + return (Short) value; + } + if (value instanceof Number) { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Short.parseShort(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Number) { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return NumberFormat.getInstance().parse(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Integer) { + return (Integer) value; + } + if (value instanceof Number) { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Integer.parseInt(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Integer[]{}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Long[]{}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Long) { + return (Long) value; + } + if (value instanceof Number) { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Double) { + return (Double) value; + } + if (value instanceof Number) { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Float) { + return (Float) value; + } + if (value instanceof Number) { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Float.parseFloat(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Boolean) { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) { + case "true": + return true; + case "false": + return false; + case "yes": + return true; + case "ok": + return true; + case "no": + return false; + case "1": + return true; + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) { + if (value == null) { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Enum.valueOf(clazz, valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof BigInteger) { + return (BigInteger) value; + } + if (value instanceof Long) { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return new BigInteger(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof BigDecimal) { + return (BigDecimal) value; + } + if (value instanceof Long) { + return new BigDecimal((Long) value); + } + if (value instanceof Double) { + return new BigDecimal((Double) value); + } + if (value instanceof Integer) { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return new BigDecimal(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ +// public static String utf8Str(Object obj) +// { +// return str(obj, CharsetKit.CHARSET_UTF_8); +// } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) { + if (null == obj) { + return null; + } + + if (obj instanceof String) { + return (String) obj; + } else if (obj instanceof byte[]) { + return str((byte[]) obj, charset); + } else if (obj instanceof Byte[]) { + byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); + return str(bytes, charset); + } else if (obj instanceof ByteBuffer) { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) { + if (data == null) { + return null; + } + + if (null == charset) { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) { + if (data == null) { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) { + if (null == charset) { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) { + char c[] = input.toCharArray(); + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') { + c[i] = '\u3000'; + } else if (c[i] < '\177') { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) { + char c[] = text.toCharArray(); + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') { + c[i] = ' '; + } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) { + String[] fraction = {"角", "分"}; + String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; + String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}}; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils.java new file mode 100644 index 0000000..a5fae12 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils.java @@ -0,0 +1,221 @@ +package com.mosty.common.generator.util; + +import com.mosty.common.generator.config.GenConfig; +import com.mosty.common.generator.config.GenConstants; +import com.mosty.common.generator.domain.GenTable; +import com.mosty.common.generator.domain.GenTableColumn; +import org.apache.commons.lang3.RegExUtils; + +import java.util.Arrays; + +/** + * 代码生成器 工具类 + * + * @author ruoyi + */ +public class GenUtils { + /** + * 初始化表信息 + */ + public static void initTable(GenTable genTable, String operName) { + genTable.setClassName(convertClassName(genTable.getTableName())); + genTable.setPackageName(GenConfig.getPackageName()); + genTable.setModuleName(getModuleName(GenConfig.getPackageName())); + genTable.setBusinessName(getBusinessName(genTable.getTableName())); + genTable.setFunctionName(replaceText(genTable.getTableComment())); + genTable.setFunctionAuthor(GenConfig.getAuthor()); + genTable.setCreateBy(operName); + } + + /** + * 初始化列属性字段 + */ + public static void initColumnField(GenTableColumn column, GenTable table) { + String dataType = getDbType(column.getColumnType()); + String columnName = column.getColumnName(); + column.setTableId(table.getTableId()); + column.setCreateBy(table.getCreateBy()); + // 设置java字段名 + column.setJavaField(StringUtils.toCamelCase(columnName)); + // 设置默认类型 + column.setJavaType(GenConstants.TYPE_STRING); + + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { + // 字符串长度超过500设置为文本域 + Integer columnLength = getColumnLength(column.getColumnType()); + String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; + column.setHtmlType(htmlType); + } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { + column.setJavaType(GenConstants.TYPE_DATE); + column.setHtmlType(GenConstants.HTML_DATETIME); + } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { + column.setHtmlType(GenConstants.HTML_INPUT); + + // 如果是浮点型 统一用BigDecimal + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { + column.setJavaType(GenConstants.TYPE_BIGDECIMAL); + } + // 如果是整形 + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { + column.setJavaType(GenConstants.TYPE_INTEGER); + } + // 长整形 + else { + column.setJavaType(GenConstants.TYPE_LONG); + } + } + + // 插入字段(默认所有字段都需要插入) + column.setIsInsert(GenConstants.REQUIRE); + + // 编辑字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) { + column.setIsEdit(GenConstants.REQUIRE); + } + // 列表字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) { + column.setIsList(GenConstants.REQUIRE); + } + // 查询字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) { + column.setIsQuery(GenConstants.REQUIRE); + } + + // 查询字段类型 + if (StringUtils.endsWithIgnoreCase(columnName, "name")) { + column.setQueryType(GenConstants.QUERY_LIKE); + } + // 状态字段设置单选框 + if (StringUtils.endsWithIgnoreCase(columnName, "status")) { + column.setHtmlType(GenConstants.HTML_RADIO); + } + // 类型&性别字段设置下拉框 + else if (StringUtils.endsWithIgnoreCase(columnName, "type") + || StringUtils.endsWithIgnoreCase(columnName, "sex")) { + column.setHtmlType(GenConstants.HTML_SELECT); + } + // 图片字段设置图片上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) { + column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); + } + // 文件字段设置文件上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { + column.setHtmlType(GenConstants.HTML_FILE_UPLOAD); + } + // 内容字段设置富文本控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { + column.setHtmlType(GenConstants.HTML_EDITOR); + } + } + + /** + * 校验数组是否包含指定值 + * + * @param arr 数组 + * @param targetValue 值 + * @return 是否包含 + */ + public static boolean arraysContains(String[] arr, String targetValue) { + return Arrays.asList(arr).contains(targetValue); + } + + /** + * 获取模块名 + * + * @param packageName 包名 + * @return 模块名 + */ + public static String getModuleName(String packageName) { + int lastIndex = packageName.lastIndexOf("."); + int nameLength = packageName.length(); + String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); + return moduleName; + } + + /** + * 获取业务名 + * + * @param tableName 表名 + * @return 业务名 + */ + public static String getBusinessName(String tableName) { + int lastIndex = tableName.lastIndexOf("_"); + int nameLength = tableName.length(); + String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength); + return businessName; + } + + /** + * 表名转换成Java类名 + * + * @param tableName 表名称 + * @return 类名 + */ + public static String convertClassName(String tableName) { + boolean autoRemovePre = GenConfig.getAutoRemovePre(); + String tablePrefix = GenConfig.getTablePrefix(); + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { + String[] searchList = StringUtils.split(tablePrefix, ","); + tableName = replaceFirst(tableName, searchList); + } + return StringUtils.convertToCamelCase(tableName); + } + + /** + * 批量替换前缀 + * + * @param replacementm 替换值 + * @param searchList 替换列表 + * @return + */ + public static String replaceFirst(String replacementm, String[] searchList) { + String text = replacementm; + for (String searchString : searchList) { + if (replacementm.startsWith(searchString)) { + text = replacementm.replaceFirst(searchString, ""); + break; + } + } + return text; + } + + /** + * 关键字替换 + * + * @param text 需要被替换的名字 + * @return 替换后的名字 + */ + public static String replaceText(String text) { + return RegExUtils.replaceAll(text, "(?:表|若依)", ""); + } + + /** + * 获取数据库类型字段 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static String getDbType(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { + return StringUtils.substringBefore(columnType, "("); + } else { + return columnType; + } + } + + /** + * 获取字段长度 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static Integer getColumnLength(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { + String length = StringUtils.substringBetween(columnType, "(", ")"); + return Integer.valueOf(length); + } else { + return 0; + } + } +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils_bak.java new file mode 100644 index 0000000..5e1286a --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/GenUtils_bak.java @@ -0,0 +1,219 @@ +//package com.mosty.common.generator.util; +// +//import com.mosty.common.base.constant.GenConstants; +//import com.mosty.common.base.util.StringUtils; +//import com.mosty.common.generator.config.GenConfig; +//import com.mosty.common.generator.domain.GenTable; +//import com.mosty.common.generator.domain.GenTableColumn; +//import org.apache.commons.lang3.RegExUtils; +// +//import java.util.Arrays; +// +///** +// * 代码生成器 工具类 +// * +// * @author ruoyi +// */ +//public class GenUtils { +// +// /** +// * 初始化表信息 +// */ +// public static void initTable(GenTable genTable, String operName) { +// genTable.setClassName(convertClassName(genTable.getTableName())); +// genTable.setPackageName(GenConfig.getPackageName()); +// genTable.setModuleName(getModuleName(GenConfig.getPackageName())); +// genTable.setBusinessName(getBusinessName(genTable.getTableName())); +// genTable.setFunctionName(replaceText(genTable.getTableComment())); +// genTable.setFunctionAuthor(GenConfig.getAuthor()); +// genTable.setCreateName(operName); +// } +// +// /** +// * 初始化列属性字段 +// */ +// public static void initColumnField(GenTableColumn column, GenTable table) { +// String dataType = getDbType(column.getColumnType()); +// String columnName = column.getColumnName(); +// column.setTableId(table.getTableId()); +// column.setCreateBy(table.getCreateBy()); +// // 设置java字段名 +// column.setJavaField(StringUtils.toCamelCase(columnName)); +// // 设置默认类型 +// column.setJavaType(GenConstants.TYPE_STRING); +// +// if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { +// // 字符串长度超过500设置为文本域 +// Integer columnLength = getColumnLength(column.getColumnType()); +// String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; +// column.setHtmlType(htmlType); +// } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { +// column.setJavaType(GenConstants.TYPE_DATE); +// column.setHtmlType(GenConstants.HTML_DATETIME); +// } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { +// column.setHtmlType(GenConstants.HTML_INPUT); +// +// // 如果是浮点型 统一用BigDecimal +// String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); +// if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { +// column.setJavaType(GenConstants.TYPE_BIGDECIMAL); +// } +// // 如果是整形 +// else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { +// column.setJavaType(GenConstants.TYPE_INTEGER); +// } +// // 长整形 +// else { +// column.setJavaType(GenConstants.TYPE_LONG); +// } +// } +// +// // 插入字段(默认所有字段都需要插入) +// column.setIsInsert(GenConstants.REQUIRE); +// +// // 编辑字段 +// if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) { +// column.setIsEdit(GenConstants.REQUIRE); +// } +// // 列表字段 +// if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) { +// column.setIsList(GenConstants.REQUIRE); +// } +// // 查询字段 +// if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) { +// column.setIsQuery(GenConstants.REQUIRE); +// } +// +// // 查询字段类型 +// if (StringUtils.endsWithIgnoreCase(columnName, "name")) { +// column.setQueryType(GenConstants.QUERY_LIKE); +// } +// // 状态字段设置单选框 +// if (StringUtils.endsWithIgnoreCase(columnName, "status")) { +// column.setHtmlType(GenConstants.HTML_RADIO); +// } +// // 类型&性别字段设置下拉框 +// else if (StringUtils.endsWithIgnoreCase(columnName, "type") +// || StringUtils.endsWithIgnoreCase(columnName, "sex")) { +// column.setHtmlType(GenConstants.HTML_SELECT); +// } +// // 文件字段设置上传控件 +// else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { +// column.setHtmlType(GenConstants.HTML_UPLOAD); +// } +// // 内容字段设置富文本控件 +// else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { +// column.setHtmlType(GenConstants.HTML_SUMMERNOTE); +// } +// } +// +// /** +// * 校验数组是否包含指定值 +// * +// * @param arr 数组 +// * @param targetValue 值 +// * @return 是否包含 +// */ +// public static boolean arraysContains(String[] arr, String targetValue) { +// return Arrays.asList(arr).contains(targetValue); +// } +// +// /** +// * 获取模块名 +// * +// * @param packageName 包名 +// * @return 模块名 +// */ +// public static String getModuleName(String packageName) { +// int lastIndex = packageName.lastIndexOf("."); +// int nameLength = packageName.length(); +// String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); +// return moduleName; +// } +// +// /** +// * 获取业务名 +// * +// * @param tableName 表名 +// * @return 业务名 +// */ +// public static String getBusinessName(String tableName) { +// int lastIndex = tableName.lastIndexOf("_"); +// int nameLength = tableName.length(); +// String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength); +// return businessName; +// } +// +// /** +// * 表名转换成Java类名 +// * +// * @param tableName 表名称 +// * @return 类名 +// */ +// public static String convertClassName(String tableName) { +// boolean autoRemovePre = GenConfig.getAutoRemovePre(); +// String tablePrefix = GenConfig.getTablePrefix(); +// if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { +// String[] searchList = StringUtils.split(tablePrefix, ","); +// tableName = replaceFirst(tableName, searchList); +// } +// return StringUtils.convertToCamelCase(tableName); +// } +// +// /** +// * 批量替换前缀 +// * +// * @param replacementm 替换值 +// * @param searchList 替换列表 +// * @return +// */ +// public static String replaceFirst(String replacementm, String[] searchList) { +// String text = replacementm; +// for (String searchString : searchList) { +// if (replacementm.startsWith(searchString)) { +// text = replacementm.replaceFirst(searchString, ""); +// break; +// } +// } +// return text; +// } +// +// /** +// * 关键字替换 +// * +// * @param text 需要被替换的名字 +// * @return 替换后的名字 +// */ +// public static String replaceText(String text) { +// return RegExUtils.replaceAll(text, "(?:表|若依)", ""); +// } +// +// /** +// * 获取数据库类型字段 +// * +// * @param columnType 列类型 +// * @return 截取后的列类型 +// */ +// public static String getDbType(String columnType) { +// if (StringUtils.indexOf(columnType, "(") > 0) { +// return StringUtils.substringBefore(columnType, "("); +// } else { +// return columnType; +// } +// } +// +// /** +// * 获取字段长度 +// * +// * @param columnType 列类型 +// * @return 截取后的列类型 +// */ +// public static Integer getColumnLength(String columnType) { +// if (StringUtils.indexOf(columnType, "(") > 0) { +// String length = StringUtils.substringBetween(columnType, "(", ")"); +// return Integer.valueOf(length); +// } else { +// return 0; +// } +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/StringUtils.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/StringUtils.java new file mode 100644 index 0000000..f8ba6ad --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/StringUtils.java @@ -0,0 +1,418 @@ +package com.mosty.common.generator.util; + +import cn.hutool.core.text.StrFormatter; +import com.mosty.common.base.constant.Constants; +import org.springframework.util.AntPathMatcher; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 字符串工具类 + * + * @author ruoyi + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils { + /** + * 空字符串 + */ + private static final String NULLSTR = ""; + + /** + * 下划线 + */ + private static final char SEPARATOR = '_'; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + * * @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) { + if (str == null) { + return NULLSTR; + } + + if (start < 0) { + start = str.length() + start; + } + + if (start < 0) { + start = 0; + } + if (start > str.length()) { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) { + if (str == null) { + return NULLSTR; + } + + if (end < 0) { + end = str.length() + end; + } + if (start < 0) { + start = str.length() + start; + } + + if (end > str.length()) { + end = str.length(); + } + + if (start > end) { + return NULLSTR; + } + + if (start < 0) { + start = 0; + } + if (end < 0) { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 判断是否为空,并且不是空白字符 + * + * @param str 要判断的value + * @return 结果 + */ + public static boolean hasText(String str) { + return (str != null && !str.isEmpty() && containsText(str)); + } + + private static boolean containsText(CharSequence str) { + int strLen = str.length(); + for (int i = 0; i < strLen; i++) { + if (!Character.isWhitespace(str.charAt(i))) { + return true; + } + } + return false; + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) { + if (isEmpty(params) || isEmpty(template)) { + return template; + } + return StrFormatter.format(template, params); + } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ + public static boolean ishttp(String link) { + return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) { + if (str == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + if (i > 0) { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } else { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { + sb.append(SEPARATOR); + } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + if (str != null && strs != null) { + for (String s : strs) { + if (str.equalsIgnoreCase(trim(s))) { + return true; + } + } + } + return false; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) { + // 没必要转换 + return ""; + } else if (!name.contains("_")) { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 例如:user_name->userName + */ + public static String toCamelCase(String s) { + if (s == null) { + return null; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + + if (c == SEPARATOR) { + upperCase = true; + } else if (upperCase) { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } else { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) { + return (T) obj; + } +} \ No newline at end of file diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer.java new file mode 100644 index 0000000..3936ae8 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer.java @@ -0,0 +1,30 @@ +package com.mosty.common.generator.util; + +import com.mosty.common.base.constant.Constants; +import org.apache.velocity.app.Velocity; + +import java.util.Properties; + +/** + * VelocityEngine工厂 + * + * @author ruoyi + */ +public class VelocityInitializer { + /** + * 初始化vm方法 + */ + public static void initVelocity() { + Properties p = new Properties(); + try { + // 加载classpath目录下的vm文件 + p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + // 定义字符集 + p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); + // 初始化Velocity引擎,指定配置Properties + Velocity.init(p); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer_bak.java new file mode 100644 index 0000000..957d5ee --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityInitializer_bak.java @@ -0,0 +1,30 @@ +//package com.mosty.common.generator.util; +// +//import com.mosty.common.base.constant.Constants; +//import org.apache.velocity.app.Velocity; +// +//import java.util.Properties; +// +///** +// * VelocityEngine工厂 +// * +// * @author ruoyi +// */ +//public class VelocityInitializer { +// /** +// * 初始化vm方法 +// */ +// public static void initVelocity() { +// Properties p = new Properties(); +// try { +// // 加载classpath目录下的vm文件 +// p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); +// ‰ // 定义字符集 +// p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); +// // 初始化Velocity引擎,指定配置Properties +// Velocity.init(p); +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// } +//} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils.java new file mode 100644 index 0000000..365ba9f --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils.java @@ -0,0 +1,333 @@ +package com.mosty.common.generator.util; + +import com.alibaba.fastjson.JSONObject; +import com.mosty.common.base.constant.GenConstants; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.generator.domain.GenTable; +import com.mosty.common.generator.domain.GenTableColumn; +import org.apache.velocity.VelocityContext; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 模板工具类 + * + * @author ruoyi + */ +public class VelocityUtils { + /** + * 项目空间路径 + */ + private static final String PROJECT_PATH = "main/java"; + + /** + * mybatis空间路径 + */ + private static final String MYBATIS_PATH = "main/resources/mapper"; + + /** + * 默认上级菜单,系统工具 + */ + private static final String DEFAULT_PARENT_MENU_ID = "3"; + + /** + * 设置模板变量信息 + * + * @return 模板列表 + */ + public static VelocityContext prepareContext(GenTable genTable) { + String moduleName = genTable.getModuleName(); + String businessName = genTable.getBusinessName(); + String packageName = genTable.getPackageName(); + String tplCategory = genTable.getTplCategory(); + String functionName = genTable.getFunctionName(); + + VelocityContext velocityContext = new VelocityContext(); + velocityContext.put("tplCategory", genTable.getTplCategory()); + velocityContext.put("tableName", genTable.getTableName()); + velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); + velocityContext.put("ClassName", genTable.getClassName()); + velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); + velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); + velocityContext.put("businessName", genTable.getBusinessName()); + velocityContext.put("basePackage", getPackagePrefix(packageName)); + velocityContext.put("packageName", packageName); + velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("datetime", DateUtils.getDate()); + velocityContext.put("pkColumn", genTable.getPkColumn()); + velocityContext.put("importList", getImportList(genTable)); + velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); + velocityContext.put("columns", genTable.getColumns()); + velocityContext.put("table", genTable); + velocityContext.put("dicts", getDicts(genTable)); + setMenuVelocityContext(velocityContext, genTable); + if (GenConstants.TPL_TREE.equals(tplCategory)) { + setTreeVelocityContext(velocityContext, genTable); + } + if (GenConstants.TPL_SUB.equals(tplCategory)) { + setSubVelocityContext(velocityContext, genTable); + } + return velocityContext; + } + + public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { + String options = genTable.getOptions(); + JSONObject paramsObj = JSONObject.parseObject(options); + String parentMenuId = getParentMenuId(paramsObj); + context.put("parentMenuId", parentMenuId); + } + + public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) { + String options = genTable.getOptions(); + JSONObject paramsObj = JSONObject.parseObject(options); + String treeCode = getTreecode(paramsObj); + String treeParentCode = getTreeParentCode(paramsObj); + String treeName = getTreeName(paramsObj); + + context.put("treeCode", treeCode); + context.put("treeParentCode", treeParentCode); + context.put("treeName", treeName); + context.put("expandColumn", getExpandColumn(genTable)); + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { + context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + if (paramsObj.containsKey(GenConstants.TREE_NAME)) { + context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); + } + } + + public static void setSubVelocityContext(VelocityContext context, GenTable genTable) { + GenTable subTable = genTable.getSubTable(); + String subTableName = genTable.getSubTableName(); + String subTableFkName = genTable.getSubTableFkName(); + String subClassName = genTable.getSubTable().getClassName(); + String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName); + + context.put("subTable", subTable); + context.put("subTableName", subTableName); + context.put("subTableFkName", subTableFkName); + context.put("subTableFkClassName", subTableFkClassName); + context.put("subTableFkclassName", StringUtils.uncapitalize(subTableFkClassName)); + context.put("subClassName", subClassName); + context.put("subclassName", StringUtils.uncapitalize(subClassName)); + context.put("subImportList", getImportList(genTable.getSubTable())); + } + + /** + * 获取模板信息 + * + * @return 模板列表 + */ + public static List getTemplateList(String tplCategory) { + List templates = new ArrayList(); + templates.add("vm/java/domain.java.vm"); + templates.add("vm/java/mapper.java.vm"); + templates.add("vm/java/service.java.vm"); + templates.add("vm/java/serviceImpl.java.vm"); + templates.add("vm/java/controller.java.vm"); + templates.add("vm/xml/mapper.xml.vm"); + templates.add("vm/sql/sql.vm"); + templates.add("vm/js/api.js.vm"); + if (GenConstants.TPL_CRUD.equals(tplCategory)) { + templates.add("vm/vue/index.vue.vm"); + } else if (GenConstants.TPL_TREE.equals(tplCategory)) { + templates.add("vm/vue/index-tree.vue.vm"); + } else if (GenConstants.TPL_SUB.equals(tplCategory)) { + templates.add("vm/vue/index.vue.vm"); + templates.add("vm/java/sub-domain.java.vm"); + } + return templates; + } + + /** + * 获取文件名 + */ + public static String getFileName(String template, GenTable genTable) { + // 文件名称 + String fileName = ""; + // 包路径 + String packageName = genTable.getPackageName(); + // 模块名 + String moduleName = genTable.getModuleName(); + // 大写类名 + String className = genTable.getClassName(); + // 业务名称 + String businessName = genTable.getBusinessName(); + + String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); + String mybatisPath = MYBATIS_PATH + "/" + moduleName; + String vuePath = "vue"; + + if (template.contains("domain.java.vm")) { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); + } + if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); + } else if (template.contains("mapper.java.vm")) { + fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); + } else if (template.contains("service.java.vm")) { + fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); + } else if (template.contains("serviceImpl.java.vm")) { + fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); + } else if (template.contains("controller.java.vm")) { + fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); + } else if (template.contains("mapper.xml.vm")) { + fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); + } else if (template.contains("sql.vm")) { + fileName = businessName + "Menu.sql"; + } else if (template.contains("api.js.vm")) { + fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); + } else if (template.contains("index.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } else if (template.contains("index-tree.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + return fileName; + } + + /** + * 获取包前缀 + * + * @param packageName 包名称 + * @return 包前缀名称 + */ + public static String getPackagePrefix(String packageName) { + int lastIndex = packageName.lastIndexOf("."); + String basePackage = StringUtils.substring(packageName, 0, lastIndex); + return basePackage; + } + + /** + * 根据列类型获取导入包 + * + * @param genTable 业务表对象 + * @return 返回需要导入的包列表 + */ + public static HashSet getImportList(GenTable genTable) { + List columns = genTable.getColumns(); + GenTable subGenTable = genTable.getSubTable(); + HashSet importList = new HashSet(); + if (StringUtils.isNotNull(subGenTable)) { + importList.add("java.util.List"); + } + for (GenTableColumn column : columns) { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { + importList.add("java.util.Date"); + importList.add("com.fasterxml.jackson.annotation.JsonFormat"); + } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { + importList.add("java.math.BigDecimal"); + } + } + return importList; + } + + /** + * 根据列类型获取字典组 + * + * @param genTable 业务表对象 + * @return 返回字典组 + */ + public static String getDicts(GenTable genTable) { + List columns = genTable.getColumns(); + Set dicts = new HashSet(); + for (GenTableColumn column : columns) { + if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( + column.getHtmlType(), + new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX})) { + dicts.add("'" + column.getDictType() + "'"); + } + } + return StringUtils.join(dicts, ", "); + } + + /** + * 获取权限前缀 + * + * @param moduleName 模块名称 + * @param businessName 业务名称 + * @return 返回权限前缀 + */ + public static String getPermissionPrefix(String moduleName, String businessName) { + return StringUtils.format("{}:{}", moduleName, businessName); + } + + /** + * 获取上级菜单ID字段 + * + * @param paramsObj 生成其他选项 + * @return 上级菜单ID字段 + */ + public static String getParentMenuId(JSONObject paramsObj) { + if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) + && StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) { + return paramsObj.getString(GenConstants.PARENT_MENU_ID); + } + return DEFAULT_PARENT_MENU_ID; + } + + /** + * 获取树编码 + * + * @param paramsObj 生成其他选项 + * @return 树编码 + */ + public static String getTreecode(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_CODE)) { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); + } + return StringUtils.EMPTY; + } + + /** + * 获取树父编码 + * + * @param paramsObj 生成其他选项 + * @return 树父编码 + */ + public static String getTreeParentCode(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + return StringUtils.EMPTY; + } + + /** + * 获取树名称 + * + * @param paramsObj 生成其他选项 + * @return 树名称 + */ + public static String getTreeName(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_NAME)) { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); + } + return StringUtils.EMPTY; + } + + /** + * 获取需要在哪一列上面显示展开按钮 + * + * @param genTable 业务表对象 + * @return 展开按钮列序号 + */ + public static int getExpandColumn(GenTable genTable) { + String options = genTable.getOptions(); + JSONObject paramsObj = JSONObject.parseObject(options); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + int num = 0; + for (GenTableColumn column : genTable.getColumns()) { + if (column.isList()) { + num++; + String columnName = column.getColumnName(); + if (columnName.equals(treeName)) { + break; + } + } + } + return num; + } +} diff --git a/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils_bak.java b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils_bak.java new file mode 100644 index 0000000..209c402 --- /dev/null +++ b/common-generator-starter/src/main/java/com/mosty/common/generator/util/VelocityUtils_bak.java @@ -0,0 +1,333 @@ +//package com.mosty.common.generator.util; +// +//import com.alibaba.fastjson.JSONObject; +//import com.mosty.common.base.constant.GenConstants; +//import com.mosty.common.base.util.DateUtils; +//import com.mosty.common.base.util.StringUtils; +//import com.mosty.common.generator.config.GenConfig; +//import com.mosty.common.generator.domain.GenTable; +//import com.mosty.common.generator.domain.GenTableColumn; +//import org.apache.velocity.VelocityContext; +// +//import java.util.ArrayList; +//import java.util.HashSet; +//import java.util.List; +// +//public class VelocityUtils { +// /** +// * 项目空间路径 +// */ +// private static final String PROJECT_PATH = "main/java"; +// +// /** +// * mybatis空间路径 +// */ +// private static final String MYBATIS_PATH = "main/resources/mapper"; +// +// /** +// * html空间路径 +// */ +// private static final String TEMPLATES_PATH = "main/resources/templates"; +// +// /** +// * 默认上级菜单,系统工具 +// */ +// private static final String DEFAULT_PARENT_MENU_ID = "3"; +// +// /** +// * 设置模板变量信息 +// * +// * @return 模板列表 +// */ +// public static VelocityContext prepareContext(GenTable genTable) { +// String moduleName = genTable.getModuleName(); +// String businessName = genTable.getBusinessName(); +// String packageName = genTable.getPackageName(); +// String tplCategory = genTable.getTplCategory(); +// String functionName = genTable.getFunctionName(); +// +// VelocityContext velocityContext = new VelocityContext(); +// velocityContext.put("tplCategory", genTable.getTplCategory()); +// velocityContext.put("tableName", genTable.getTableName()); +// velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); +// velocityContext.put("ClassName", genTable.getClassName()); +// velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); +// velocityContext.put("moduleName", genTable.getModuleName()); +// velocityContext.put("businessName", genTable.getBusinessName()); +// velocityContext.put("basePackage", getPackagePrefix(packageName)); +// velocityContext.put("packageName", packageName); +// velocityContext.put("author", genTable.getFunctionAuthor()); +// velocityContext.put("datetime", DateUtils.getDate()); +// velocityContext.put("pkColumn", genTable.getPkColumn()); +// velocityContext.put("importList", getImportList(genTable)); +// velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); +// velocityContext.put("columns", genTable.getColumns()); +// velocityContext.put("table", genTable); +// setMenuVelocityContext(velocityContext, genTable); +// if (GenConstants.TPL_TREE.equals(tplCategory)) { +// setTreeVelocityContext(velocityContext, genTable); +// } +// if (GenConstants.TPL_SUB.equals(tplCategory)) { +// setSubVelocityContext(velocityContext, genTable); +// } +// return velocityContext; +// } +// +// public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { +// String options = genTable.getOptions(); +// JSONObject paramsObj = JSONObject.parseObject(options); +// String parentMenuId = getParentMenuId(paramsObj); +// context.put("parentMenuId", parentMenuId); +// } +// +// public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) { +// String options = genTable.getOptions(); +// JSONObject paramsObj = JSONObject.parseObject(options); +// String treeCode = getTreecode(paramsObj); +// String treeParentCode = getTreeParentCode(paramsObj); +// String treeName = getTreeName(paramsObj); +// +// context.put("treeCode", treeCode); +// context.put("treeParentCode", treeParentCode); +// context.put("treeName", treeName); +// context.put("expandColumn", getExpandColumn(genTable)); +// if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { +// context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); +// } +// if (paramsObj.containsKey(GenConstants.TREE_NAME)) { +// context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); +// } +// } +// +// public static void setSubVelocityContext(VelocityContext context, GenTable genTable) { +// GenTable subTable = genTable.getSubTable(); +// String subTableName = genTable.getSubTableName(); +// String subTableFkName = genTable.getSubTableFkName(); +// String subClassName = genTable.getSubTable().getClassName(); +// String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName); +// +// context.put("subTable", subTable); +// context.put("subTableName", subTableName); +// context.put("subTableFkName", subTableFkName); +// context.put("subTableFkClassName", subTableFkClassName); +// context.put("subTableFkclassName", StringUtils.uncapitalize(subTableFkClassName)); +// context.put("subClassName", subClassName); +// context.put("subclassName", StringUtils.uncapitalize(subClassName)); +// context.put("subImportList", getImportList(genTable.getSubTable())); +// } +// +// /** +// * 获取模板信息 +// * +// * @return 模板列表 +// */ +// public static List getTemplateList(String tplCategory) { +// List templates = new ArrayList(); +// templates.add("vm/java/domain.java.vm"); +// templates.add("vm/java/mapper.java.vm"); +// templates.add("vm/java/service.java.vm"); +// templates.add("vm/java/serviceImpl.java.vm"); +// templates.add("vm/java/controller.java.vm"); +// templates.add("vm/xml/mapper.xml.vm"); +// if (GenConstants.TPL_CRUD.equals(tplCategory)) { +// templates.add("vm/html/list.html.vm"); +// } else if (GenConstants.TPL_TREE.equals(tplCategory)) { +// templates.add("vm/html/tree.html.vm"); +// templates.add("vm/html/list-tree.html.vm"); +// } else if (GenConstants.TPL_SUB.equals(tplCategory)) { +// templates.add("vm/html/list.html.vm"); +// templates.add("vm/java/sub-domain.java.vm"); +// } +// templates.add("vm/html/add.html.vm"); +// templates.add("vm/html/edit.html.vm"); +// templates.add("vm/sql/sql.vm"); +// return templates; +// } +// +// /** +// * 获取文件名 +// */ +// public static String getFileName(String template, GenTable genTable) { +// // 文件名称 +// String fileName = ""; +// // 包路径 +// String packageName = genTable.getPackageName(); +// // 模块名 +// String moduleName = genTable.getModuleName(); +// // 大写类名 +// String className = genTable.getClassName(); +// // 业务名称 +// String businessName = genTable.getBusinessName(); +// +// String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); +// String mybatisPath = MYBATIS_PATH + "/" + moduleName; +// String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + businessName; +// +// if (template.contains("domain.java.vm")) { +// fileName = String.format("%s/domain/%s.java", javaPath, className); +// } +// if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) { +// fileName = String.format("%s/domain/%s.java", javaPath, genTable.getSubTable().getClassName()); +// } else if (template.contains("mapper.java.vm")) { +// fileName = String.format("%s/mapper/%sMapper.java", javaPath, className); +// } else if (template.contains("service.java.vm")) { +// fileName = String.format("%s/service/I%sService.java", javaPath, className); +// } else if (template.contains("serviceImpl.java.vm")) { +// fileName = String.format("%s/service/impl/%sServiceImpl.java", javaPath, className); +// } else if (template.contains("controller.java.vm")) { +// fileName = String.format("%s/controller/%sController.java", javaPath, className); +// } else if (template.contains("mapper.xml.vm")) { +// fileName = String.format("%s/%sMapper.xml", mybatisPath, className); +// } else if (template.contains("list.html.vm")) { +// fileName = String.format("%s/%s.html", htmlPath, businessName); +// } else if (template.contains("list-tree.html.vm")) { +// fileName = String.format("%s/%s.html", htmlPath, businessName); +// } else if (template.contains("tree.html.vm")) { +// fileName = String.format("%s/tree.html", htmlPath); +// } else if (template.contains("add.html.vm")) { +// fileName = String.format("%s/add.html", htmlPath); +// } else if (template.contains("edit.html.vm")) { +// fileName = String.format("%s/edit.html", htmlPath); +// } else if (template.contains("sql.vm")) { +// fileName = businessName + "Menu.sql"; +// } +// return fileName; +// } +// +// /** +// * 获取项目文件路径 +// * +// * @return 路径 +// */ +// public static String getProjectPath() { +// String packageName = GenConfig.getPackageName(); +// StringBuffer projectPath = new StringBuffer(); +// projectPath.append("main/java/"); +// projectPath.append(packageName.replace(".", "/")); +// projectPath.append("/"); +// return projectPath.toString(); +// } +// +// /** +// * 获取包前缀 +// * +// * @param packageName 包名称 +// * @return 包前缀名称 +// */ +// public static String getPackagePrefix(String packageName) { +// int lastIndex = packageName.lastIndexOf("."); +// String basePackage = StringUtils.substring(packageName, 0, lastIndex); +// return basePackage; +// } +// +// /** +// * 根据列类型获取导入包 +// * +// * @param genTable 业务表对象 +// * @return 返回需要导入的包列表 +// */ +// public static HashSet getImportList(GenTable genTable) { +// List columns = genTable.getColumns(); +// GenTable subGenTable = genTable.getSubTable(); +// HashSet importList = new HashSet(); +// if (StringUtils.isNotNull(subGenTable)) { +// importList.add("java.util.List"); +// } +// for (GenTableColumn column : columns) { +// if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { +// importList.add("java.util.Date"); +// importList.add("com.fasterxml.jackson.annotation.JsonFormat"); +// } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { +// importList.add("java.math.BigDecimal"); +// } +// } +// return importList; +// } +// +// /** +// * 获取权限前缀 +// * +// * @param moduleName 模块名称 +// * @param businessName 业务名称 +// * @return 返回权限前缀 +// */ +// public static String getPermissionPrefix(String moduleName, String businessName) { +// return String.format("%s:%s", moduleName, businessName); +// } +// +// /** +// * 获取上级菜单ID字段 +// * +// * @param paramsObj 生成其他选项 +// * @return 上级菜单ID字段 +// */ +// public static String getParentMenuId(JSONObject paramsObj) { +// if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) +// && StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) { +// return paramsObj.getString(GenConstants.PARENT_MENU_ID); +// } +// return DEFAULT_PARENT_MENU_ID; +// } +// +// /** +// * 获取树编码 +// * +// * @param paramsObj 生成其他选项 +// * @return 树编码 +// */ +// public static String getTreecode(JSONObject paramsObj) { +// if (paramsObj.containsKey(GenConstants.TREE_CODE)) { +// return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); +// } +// return StringUtils.EMPTY; +// } +// +// /** +// * 获取树父编码 +// * +// * @param paramsObj 生成其他选项 +// * @return 树父编码 +// */ +// public static String getTreeParentCode(JSONObject paramsObj) { +// if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { +// return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); +// } +// return StringUtils.EMPTY; +// } +// +// /** +// * 获取树名称 +// * +// * @param paramsObj 生成其他选项 +// * @return 树名称 +// */ +// public static String getTreeName(JSONObject paramsObj) { +// if (paramsObj.containsKey(GenConstants.TREE_NAME)) { +// return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); +// } +// return StringUtils.EMPTY; +// } +// +// /** +// * 获取需要在哪一列上面显示展开按钮 +// * +// * @param genTable 业务表对象 +// * @return 展开按钮列序号 +// */ +// public static int getExpandColumn(GenTable genTable) { +// String options = genTable.getOptions(); +// JSONObject paramsObj = JSONObject.parseObject(options); +// String treeName = paramsObj.getString(GenConstants.TREE_NAME); +// int num = 0; +// for (GenTableColumn column : genTable.getColumns()) { +// if (column.isList()) { +// num++; +// String columnName = column.getColumnName(); +// if (columnName.equals(treeName)) { +// break; +// } +// } +// } +// return num; +// } +//} \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/META-INF/spring.factories b/common-generator-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..7fab0be --- /dev/null +++ b/common-generator-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.generator.GeneratorAutoConfiguration \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/generator.yml b/common-generator-starter/src/main/resources/generator.yml new file mode 100644 index 0000000..f70a072 --- /dev/null +++ b/common-generator-starter/src/main/resources/generator.yml @@ -0,0 +1,11 @@ + +# 代码生成 +gen: + # 作者 + author: kevin + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.mosty.base + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/mapper/GenTableColumnMapper.xml_bak b/common-generator-starter/src/main/resources/mapper/GenTableColumnMapper.xml_bak new file mode 100644 index 0000000..1b3c411 --- /dev/null +++ b/common-generator-starter/src/main/resources/mapper/GenTableColumnMapper.xml_bak @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/mapper/GenTableMapper.xml_bak b/common-generator-starter/src/main/resources/mapper/GenTableMapper.xml_bak new file mode 100644 index 0000000..b53664d --- /dev/null +++ b/common-generator-starter/src/main/resources/mapper/GenTableMapper.xml_bak @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + ${sql} + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/common-generator-starter/src/main/resources/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..7b2c6cc --- /dev/null +++ b/common-generator-starter/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/mapper/generator/GenTableMapper.xml b/common-generator-starter/src/main/resources/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..167a8c3 --- /dev/null +++ b/common-generator-starter/src/main/resources/mapper/generator/GenTableMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/templates/tool/gen/createTable.html b/common-generator-starter/src/main/resources/templates/tool/gen/createTable.html new file mode 100644 index 0000000..c9b9dcf --- /dev/null +++ b/common-generator-starter/src/main/resources/templates/tool/gen/createTable.html @@ -0,0 +1,30 @@ + + + + + + +

+ +
+ +
+
+ + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/templates/tool/gen/edit.html b/common-generator-starter/src/main/resources/templates/tool/gen/edit.html new file mode 100644 index 0000000..56ededc --- /dev/null +++ b/common-generator-starter/src/main/resources/templates/tool/gen/edit.html @@ -0,0 +1,607 @@ + + + + + + + + +
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/common-generator-starter/src/main/resources/templates/tool/gen/gen.html b/common-generator-starter/src/main/resources/templates/tool/gen/gen.html new file mode 100644 index 0000000..a0150f1 --- /dev/null +++ b/common-generator-starter/src/main/resources/templates/tool/gen/gen.html @@ -0,0 +1,218 @@ + + + + + + +
+
+
+
+
+
    +
  • + 表名称: +
  • +
  • + 表描述: +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + + +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/templates/tool/gen/importTable.html b/common-generator-starter/src/main/resources/templates/tool/gen/importTable.html new file mode 100644 index 0000000..91562e7 --- /dev/null +++ b/common-generator-starter/src/main/resources/templates/tool/gen/importTable.html @@ -0,0 +1,95 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/html/add.html.vm b/common-generator-starter/src/main/resources/vm/html/add.html.vm new file mode 100644 index 0000000..b7f1781 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/html/add.html.vm @@ -0,0 +1,381 @@ + + + + +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + +
+
+#if($table.sub) +

${functionName}信息

+#end +#foreach($column in $columns) +#set($field=$column.javaField) +#if($column.insert && !$column.pk) +#if(($column.usableColumn) || (!$column.superColumn)) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#set($dictType=$column.dictType) +#if("" != $treeParentCode && $column.javaField == $treeParentCode) +
+ +
+
+#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) +#set($treeId = "${className}?.${treeCode}") + + + +
+
+
+#elseif($column.htmlType == "input") +
+ +
+ +
+
+#elseif($column.htmlType == "upload") +
+ +
+ +
+ +
+
+
+#elseif($column.htmlType == "summernote") +
+ +
+ +
+
+
+#elseif($column.htmlType == "select" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "select" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "checkbox" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "checkbox" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "radio" && "" != $dictType) +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "radio" && $dictType) +
+ +
+
+ + +
+ 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "datetime") +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "textarea") +
+ +
+ +
+
+#end +#end +#end +#end +#if($table.sub) +

${subTable.functionName}信息

+
+
+ + +
+
+
+
+
+#end +
+
+ +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/html/edit.html.vm b/common-generator-starter/src/main/resources/vm/html/edit.html.vm new file mode 100644 index 0000000..53e0451 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/html/edit.html.vm @@ -0,0 +1,392 @@ + + + + +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + +
+
+#if($table.sub) +

${functionName}信息

+#end + +#foreach($column in $columns) +#if($column.edit && !$column.pk) +#if(($column.usableColumn) || (!$column.superColumn)) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#set($field=$column.javaField) +#set($dictType=$column.dictType) +#if("" != $treeParentCode && $column.javaField == $treeParentCode) +
+ +
+
+#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) + + + +
+
+
+#elseif($column.htmlType == "input") +
+ +
+ +
+
+#elseif($column.htmlType == "upload") +
+ +
+ +
+ +
+
+
+#elseif($column.htmlType == "summernote") +
+ +
+ +
+
+
+#elseif($column.htmlType == "select" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "select" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "checkbox" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "checkbox" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "radio" && "" != $dictType) +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "radio" && $dictType) +
+ +
+
+ + +
+ 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "datetime") +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "textarea") +
+ +
+ +
+
+#end +#end +#end +#end +#if($table.sub) +

${subTable.functionName}信息

+
+
+ + +
+
+
+
+
+#end +
+
+ +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/html/list-tree.html.vm b/common-generator-starter/src/main/resources/vm/html/list-tree.html.vm new file mode 100644 index 0000000..f7f797d --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/html/list-tree.html.vm @@ -0,0 +1,156 @@ + + + + + + +
+
+
+
+
+
    +#foreach($column in $columns) +#if($column.query) +#set($dictType=$column.dictType) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($column.htmlType == "input") +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +
  • + + + - + +
  • +#end +#end +#end +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/html/list.html.vm b/common-generator-starter/src/main/resources/vm/html/list.html.vm new file mode 100644 index 0000000..f2e9c5a --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/html/list.html.vm @@ -0,0 +1,154 @@ + + + + + + +
+
+
+
+
+
    +#foreach($column in $columns) +#if($column.query) +#set($dictType=$column.dictType) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($column.htmlType == "input") +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +
  • + + + - + +
  • +#end +#end +#end +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/html/tree.html.vm b/common-generator-starter/src/main/resources/vm/html/tree.html.vm new file mode 100644 index 0000000..80364ad --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/html/tree.html.vm @@ -0,0 +1,51 @@ + + + + + + + + +#set($treeId = "${className}?." + $treeCode) +#set($treeName = "${className}?." + $treeName) + + +
+ + +
+ +
+ 展开 / + 折叠 +
+
+
+ + + + + \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/java/controller.java.vm b/common-generator-starter/src/main/resources/vm/java/controller.java.vm new file mode 100644 index 0000000..e826fd4 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/controller.java.vm @@ -0,0 +1,202 @@ +package ${packageName}.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.page.TableDataInfo; +#elseif($table.tree) +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.core.domain.Ztree; +#end + +/** + * ${functionName}Controller + * + * @author ${author} + * @date ${datetime} + */ +@Controller +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController +{ + private String prefix = "${moduleName}/${businessName}"; + + @Autowired + private I${ClassName}Service ${className}Service; + + @RequiresPermissions("${permissionPrefix}:view") + @GetMapping() + public String ${businessName}() + { + return prefix + "/${businessName}"; + } + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + @RequiresPermissions("${permissionPrefix}:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(${ClassName} ${className}) + { + startPage(); + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return getDataTable(list); + } +#elseif($table.tree) + /** + * 查询${functionName}树列表 + */ + @RequiresPermissions("${permissionPrefix}:list") + @PostMapping("/list") + @ResponseBody + public List<${ClassName}> list(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return list; + } +#end + + /** + * 导出${functionName}列表 + */ + @RequiresPermissions("${permissionPrefix}:export") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + return util.exportExcel(list, "${functionName}数据"); + } + +#if($table.crud || $table.sub) + /** + * 新增${functionName} + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } +#elseif($table.tree) + /** + * 新增${functionName} + */ + @GetMapping(value = { "/add/{${pkColumn.javaField}}", "/add/" }) + public String add(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) + { + if (StringUtils.isNotNull(${pkColumn.javaField})) + { + mmap.put("${className}", ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } + return prefix + "/add"; + } +#end + + /** + * 新增保存${functionName} + */ + @RequiresPermissions("${permissionPrefix}:add") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(${ClassName} ${className}) + { + return toAjax(${className}Service.insert${ClassName}(${className})); + } + + /** + * 修改${functionName} + */ + @RequiresPermissions("${permissionPrefix}:edit") + @GetMapping("/edit/{${pkColumn.javaField}}") + public String edit(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}, ModelMap mmap) + { + ${ClassName} ${className} = ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + mmap.put("${className}", ${className}); + return prefix + "/edit"; + } + + /** + * 修改保存${functionName} + */ + @RequiresPermissions("${permissionPrefix}:edit") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(${ClassName} ${className}) + { + return toAjax(${className}Service.update${ClassName}(${className})); + } + +#if($table.crud || $table.sub) + /** + * 删除${functionName} + */ + @RequiresPermissions("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(ids)); + } +#elseif($table.tree) + /** + * 删除 + */ + @RequiresPermissions("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @GetMapping("/remove/{${pkColumn.javaField}}") + @ResponseBody + public AjaxResult remove(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) + { + return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } +#end +#if($table.tree) + + /** + * 选择${functionName}树 + */ +#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) + @GetMapping(value = { "/select${BusinessName}Tree/{${pkColumn.javaField}}", "/select${BusinessName}Tree/" }) + public String select${BusinessName}Tree(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) + { + if (StringUtils.isNotNull(${pkColumn.javaField})) + { + mmap.put("${className}", ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } + return prefix + "/tree"; + } + + /** + * 加载${functionName}树列表 + */ + @GetMapping("/treeData") + @ResponseBody + public List treeData() + { + List ztrees = ${className}Service.select${ClassName}Tree(); + return ztrees; + } +#end +} diff --git a/common-generator-starter/src/main/resources/vm/java/domain.java.vm b/common-generator-starter/src/main/resources/vm/java/domain.java.vm new file mode 100644 index 0000000..bd51c17 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/domain.java.vm @@ -0,0 +1,105 @@ +package ${packageName}.domain; + +#foreach ($import in $importList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.domain.BaseEntity; +#elseif($table.tree) +import com.ruoyi.common.core.domain.TreeEntity; +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity") +#end +public class ${ClassName} extends ${Entity} +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#if($table.sub) + /** $table.subTable.functionName信息 */ + private List<${subClassName}> ${subclassName}List; + +#end +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + +#if($table.sub) + public List<${subClassName}> get${subClassName}List() + { + return ${subclassName}List; + } + + public void set${subClassName}List(List<${subClassName}> ${subclassName}List) + { + this.${subclassName}List = ${subclassName}List; + } + +#end + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end +#if($table.sub) + .append("${subclassName}List", get${subClassName}List()) +#end + .toString(); + } +} diff --git a/common-generator-starter/src/main/resources/vm/java/mapper.java.vm b/common-generator-starter/src/main/resources/vm/java/mapper.java.vm new file mode 100644 index 0000000..ebee538 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/mapper.java.vm @@ -0,0 +1,91 @@ +package ${packageName}.mapper; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +#if($table.sub) +import ${packageName}.domain.${subClassName}; +#end + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(String[] ${pkColumn.javaField}s); +#if($table.sub) + + /** + * 批量删除${subTable.functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}s(String[] ${pkColumn.javaField}s); + + /** + * 批量新增${subTable.functionName} + * + * @param ${subclassName}List ${subTable.functionName}列表 + * @return 结果 + */ + public int batch${subClassName}(List<${subClassName}> ${subclassName}List); + + + /** + * 通过${functionName}主键删除${subTable.functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); +#end +} diff --git a/common-generator-starter/src/main/resources/vm/java/service.java.vm b/common-generator-starter/src/main/resources/vm/java/service.java.vm new file mode 100644 index 0000000..765c9d6 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/service.java.vm @@ -0,0 +1,73 @@ +package ${packageName}.service; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +#if($table.tree) +import com.ruoyi.common.core.domain.Ztree; +#end + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(String ${pkColumn.javaField}s); + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); +#if($table.tree) + + /** + * 查询${functionName}树列表 + * + * @return 所有${functionName}信息 + */ + public List select${ClassName}Tree(); +#end +} diff --git a/common-generator-starter/src/main/resources/vm/java/serviceImpl.java.vm b/common-generator-starter/src/main/resources/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..242b1c7 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/serviceImpl.java.vm @@ -0,0 +1,213 @@ +package ${packageName}.service.impl; + +import java.util.List; +#if($table.tree) +import java.util.ArrayList; +import com.ruoyi.common.core.domain.Ztree; +#end +#foreach ($column in $columns) +#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') +import com.ruoyi.common.utils.DateUtils; +#break +#end +#end +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +#if($table.sub) +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import ${packageName}.domain.${subClassName}; +#end +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.core.text.Convert; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service +{ + @Autowired + private ${ClassName}Mapper ${className}Mapper; + + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + @Override + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { + return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName} + */ + @Override + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) + { + return ${className}Mapper.select${ClassName}List(${className}); + } + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int insert${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'createTime') + ${className}.setCreateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + int rows = ${className}Mapper.insert${ClassName}(${className}); + insert${subClassName}(${className}); + return rows; +#else + return ${className}Mapper.insert${ClassName}(${className}); +#end + } + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int update${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'updateTime') + ${className}.setUpdateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); + insert${subClassName}(${className}); +#end + return ${className}Mapper.update${ClassName}(${className}); + } + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}s(String ${pkColumn.javaField}s) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(Convert.toStrArray(${pkColumn.javaField}s)); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(Convert.toStrArray(${pkColumn.javaField}s)); + } + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } +#if($table.tree) + + /** + * 查询${functionName}树列表 + * + * @return 所有${functionName}信息 + */ + @Override + public List select${ClassName}Tree() + { + List<${ClassName}> ${className}List = ${className}Mapper.select${ClassName}List(new ${ClassName}()); + List ztrees = new ArrayList(); + for (${ClassName} ${className} : ${className}List) + { + Ztree ztree = new Ztree(); +#if($treeCode.length() > 2 && $treeCode.substring(1,2).matches("[A-Z]")) +#set($TreeCode=$treeCode) +#else +#set($TreeCode=$treeCode.substring(0,1).toUpperCase() + ${treeCode.substring(1)}) +#end +#if($treeParentCode.length() > 2 && $treeParentCode.substring(1,2).matches("[A-Z]")) +#set($TreeParentCode=$treeParentCode) +#else +#set($TreeParentCode=$treeParentCode.substring(0,1).toUpperCase() + ${treeParentCode.substring(1)}) +#end +#if($treeName.length() > 2 && $treeName.substring(1,2).matches("[A-Z]")) +#set($TreeName=$treeName) +#else +#set($TreeName=$treeName.substring(0,1).toUpperCase() + ${treeName.substring(1)}) +#end + ztree.setId(${className}.get${TreeCode}()); + ztree.setpId(${className}.get${TreeParentCode}()); + ztree.setName(${className}.get${TreeName}()); + ztree.setTitle(${className}.get${TreeName}()); + ztrees.add(ztree); + } + return ztrees; + } +#end +#if($table.sub) + + /** + * 新增${subTable.functionName}信息 + * + * @param ${className} ${functionName}对象 + */ + public void insert${subClassName}(${ClassName} ${className}) + { + List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); + ${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); + if (StringUtils.isNotNull(${subclassName}List)) + { + List<${subClassName}> list = new ArrayList<${subClassName}>(); + for (${subClassName} ${subclassName} : ${subclassName}List) + { + ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); + list.add(${subclassName}); + } + if (list.size() > 0) + { + ${className}Mapper.batch${subClassName}(list); + } + } + } +#end +} diff --git a/common-generator-starter/src/main/resources/vm/java/sub-domain.java.vm b/common-generator-starter/src/main/resources/vm/java/sub-domain.java.vm new file mode 100644 index 0000000..a3f53eb --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/java/sub-domain.java.vm @@ -0,0 +1,76 @@ +package ${packageName}.domain; + +#foreach ($import in $subImportList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * ${subTable.functionName}对象 ${subTableName} + * + * @author ${author} + * @date ${datetime} + */ +public class ${subClassName} extends BaseEntity +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $subTable.columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end + .toString(); + } +} diff --git a/common-generator-starter/src/main/resources/vm/js/api.js.vm b/common-generator-starter/src/main/resources/vm/js/api.js.vm new file mode 100644 index 0000000..9295524 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/js/api.js.vm @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} diff --git a/common-generator-starter/src/main/resources/vm/sql/sql.vm b/common-generator-starter/src/main/resources/vm/sql/sql.vm new file mode 100644 index 0000000..d5121af --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/sql/sql.vm @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}', '${parentMenuId}', '1', '/${moduleName}/${businessName}', 'C', '0', '${permissionPrefix}:view', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}查询', @parentId, '1', '#', 'F', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}新增', @parentId, '2', '#', 'F', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}修改', @parentId, '3', '#', 'F', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}删除', @parentId, '4', '#', 'F', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}导出', @parentId, '5', '#', 'F', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); diff --git a/common-generator-starter/src/main/resources/vm/vue/index-tree.vue.vm b/common-generator-starter/src/main/resources/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..bfb61b5 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/vue/index-tree.vue.vm @@ -0,0 +1,482 @@ + + + diff --git a/common-generator-starter/src/main/resources/vm/vue/index.vue.vm b/common-generator-starter/src/main/resources/vm/vue/index.vue.vm new file mode 100644 index 0000000..65620b4 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/vue/index.vue.vm @@ -0,0 +1,573 @@ + + + diff --git a/common-generator-starter/src/main/resources/vm/vue/v3/index-tree.vue.vm b/common-generator-starter/src/main/resources/vm/vue/v3/index-tree.vue.vm new file mode 100644 index 0000000..5342e91 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -0,0 +1,464 @@ + + + diff --git a/common-generator-starter/src/main/resources/vm/vue/v3/index.vue.vm b/common-generator-starter/src/main/resources/vm/vue/v3/index.vue.vm new file mode 100644 index 0000000..08bb071 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/vue/v3/index.vue.vm @@ -0,0 +1,564 @@ + + + diff --git a/common-generator-starter/src/main/resources/vm/vue/v3/readme.txt b/common-generator-starter/src/main/resources/vm/vue/v3/readme.txt new file mode 100644 index 0000000..10362d6 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/vue/v3/readme.txt @@ -0,0 +1 @@ +ʹõRuoYi-Cloud-Vue3ǰˣôҪһ´Ŀ¼ģindex.vue.vmindex-tree.vue.vmļϼvueĿ¼ \ No newline at end of file diff --git a/common-generator-starter/src/main/resources/vm/xml/mapper.xml.vm b/common-generator-starter/src/main/resources/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..9de59b5 --- /dev/null +++ b/common-generator-starter/src/main/resources/vm/xml/mapper.xml.vm @@ -0,0 +1,147 @@ + + + + + +#foreach ($column in $columns) + +#end +#if($table.tree) + +#end + +#if($table.sub) + + + + + + +#foreach ($column in $subTable.columns) + +#end + +#end + + + select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName} + + + + + + + + insert into ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, +#end +#end + + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, +#end +#end + + + + + update ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName) + $column.columnName = #{$column.javaField}, +#end +#end + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} in + + #{${pkColumn.javaField}} + + +#if($table.sub) + + + delete from ${subTableName} where ${subTableFkName} in + + #{${subTableFkclassName}} + + + + + delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} + + + + insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values + + (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end) + + +#end + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/META-INF/spring.factories b/common-generator-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..7fab0be --- /dev/null +++ b/common-generator-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.generator.GeneratorAutoConfiguration \ No newline at end of file diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/GeneratorAutoConfiguration.class b/common-generator-starter/target/classes/com/mosty/common/generator/GeneratorAutoConfiguration.class new file mode 100644 index 0000000..9aeedbd Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/GeneratorAutoConfiguration.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/config/BaseEntity.class b/common-generator-starter/target/classes/com/mosty/common/generator/config/BaseEntity.class new file mode 100644 index 0000000..f0f092d Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/config/BaseEntity.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConfig.class b/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConfig.class new file mode 100644 index 0000000..2644676 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConfig.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConstants.class b/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConstants.class new file mode 100644 index 0000000..94a4a4a Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/config/GenConstants.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/controller/GenController.class b/common-generator-starter/target/classes/com/mosty/common/generator/controller/GenController.class new file mode 100644 index 0000000..591fa90 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/controller/GenController.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTable.class b/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTable.class new file mode 100644 index 0000000..30335d2 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTable.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTableColumn.class b/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTableColumn.class new file mode 100644 index 0000000..1de2836 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/domain/GenTableColumn.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableColumnMapper.class b/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableColumnMapper.class new file mode 100644 index 0000000..093c53b Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableColumnMapper.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableMapper.class b/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableMapper.class new file mode 100644 index 0000000..b483262 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/mapper/GenTableMapper.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableColumnServiceImpl.class b/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableColumnServiceImpl.class new file mode 100644 index 0000000..fc94008 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableColumnServiceImpl.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableServiceImpl.class b/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableServiceImpl.class new file mode 100644 index 0000000..3aa6d66 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/service/GenTableServiceImpl.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableColumnService.class b/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableColumnService.class new file mode 100644 index 0000000..37fed65 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableColumnService.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableService.class b/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableService.class new file mode 100644 index 0000000..32e577e Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/service/IGenTableService.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/CharsetKit.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/CharsetKit.class new file mode 100644 index 0000000..098febf Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/CharsetKit.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/Convert.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/Convert.class new file mode 100644 index 0000000..200f8a9 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/Convert.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/GenUtils.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/GenUtils.class new file mode 100644 index 0000000..48c4904 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/GenUtils.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/StringUtils.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/StringUtils.class new file mode 100644 index 0000000..86096e0 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/StringUtils.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityInitializer.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityInitializer.class new file mode 100644 index 0000000..2c84064 Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityInitializer.class differ diff --git a/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityUtils.class b/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityUtils.class new file mode 100644 index 0000000..7186eae Binary files /dev/null and b/common-generator-starter/target/classes/com/mosty/common/generator/util/VelocityUtils.class differ diff --git a/common-generator-starter/target/classes/generator.yml b/common-generator-starter/target/classes/generator.yml new file mode 100644 index 0000000..f70a072 --- /dev/null +++ b/common-generator-starter/target/classes/generator.yml @@ -0,0 +1,11 @@ + +# 代码生成 +gen: + # 作者 + author: kevin + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.mosty.base + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/common-generator-starter/target/classes/mapper/GenTableColumnMapper.xml_bak b/common-generator-starter/target/classes/mapper/GenTableColumnMapper.xml_bak new file mode 100644 index 0000000..1b3c411 --- /dev/null +++ b/common-generator-starter/target/classes/mapper/GenTableColumnMapper.xml_bak @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/mapper/GenTableMapper.xml_bak b/common-generator-starter/target/classes/mapper/GenTableMapper.xml_bak new file mode 100644 index 0000000..b53664d --- /dev/null +++ b/common-generator-starter/target/classes/mapper/GenTableMapper.xml_bak @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + ${sql} + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/mapper/generator/GenTableColumnMapper.xml b/common-generator-starter/target/classes/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..7b2c6cc --- /dev/null +++ b/common-generator-starter/target/classes/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/mapper/generator/GenTableMapper.xml b/common-generator-starter/target/classes/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..167a8c3 --- /dev/null +++ b/common-generator-starter/target/classes/mapper/generator/GenTableMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/templates/tool/gen/createTable.html b/common-generator-starter/target/classes/templates/tool/gen/createTable.html new file mode 100644 index 0000000..c9b9dcf --- /dev/null +++ b/common-generator-starter/target/classes/templates/tool/gen/createTable.html @@ -0,0 +1,30 @@ + + + + + + +
+ +
+ +
+
+ + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/templates/tool/gen/edit.html b/common-generator-starter/target/classes/templates/tool/gen/edit.html new file mode 100644 index 0000000..56ededc --- /dev/null +++ b/common-generator-starter/target/classes/templates/tool/gen/edit.html @@ -0,0 +1,607 @@ + + + + + + + + +
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/common-generator-starter/target/classes/templates/tool/gen/gen.html b/common-generator-starter/target/classes/templates/tool/gen/gen.html new file mode 100644 index 0000000..a0150f1 --- /dev/null +++ b/common-generator-starter/target/classes/templates/tool/gen/gen.html @@ -0,0 +1,218 @@ + + + + + + +
+
+
+
+
+
    +
  • + 表名称: +
  • +
  • + 表描述: +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + + +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/templates/tool/gen/importTable.html b/common-generator-starter/target/classes/templates/tool/gen/importTable.html new file mode 100644 index 0000000..91562e7 --- /dev/null +++ b/common-generator-starter/target/classes/templates/tool/gen/importTable.html @@ -0,0 +1,95 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/html/add.html.vm b/common-generator-starter/target/classes/vm/html/add.html.vm new file mode 100644 index 0000000..b7f1781 --- /dev/null +++ b/common-generator-starter/target/classes/vm/html/add.html.vm @@ -0,0 +1,381 @@ + + + + +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + +
+
+#if($table.sub) +

${functionName}信息

+#end +#foreach($column in $columns) +#set($field=$column.javaField) +#if($column.insert && !$column.pk) +#if(($column.usableColumn) || (!$column.superColumn)) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#set($dictType=$column.dictType) +#if("" != $treeParentCode && $column.javaField == $treeParentCode) +
+ +
+
+#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) +#set($treeId = "${className}?.${treeCode}") + + + +
+
+
+#elseif($column.htmlType == "input") +
+ +
+ +
+
+#elseif($column.htmlType == "upload") +
+ +
+ +
+ +
+
+
+#elseif($column.htmlType == "summernote") +
+ +
+ +
+
+
+#elseif($column.htmlType == "select" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "select" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "checkbox" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "checkbox" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "radio" && "" != $dictType) +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "radio" && $dictType) +
+ +
+
+ + +
+ 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "datetime") +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "textarea") +
+ +
+ +
+
+#end +#end +#end +#end +#if($table.sub) +

${subTable.functionName}信息

+
+
+ + +
+
+
+
+
+#end +
+
+ +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/html/edit.html.vm b/common-generator-starter/target/classes/vm/html/edit.html.vm new file mode 100644 index 0000000..53e0451 --- /dev/null +++ b/common-generator-starter/target/classes/vm/html/edit.html.vm @@ -0,0 +1,392 @@ + + + + +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + +
+
+#if($table.sub) +

${functionName}信息

+#end + +#foreach($column in $columns) +#if($column.edit && !$column.pk) +#if(($column.usableColumn) || (!$column.superColumn)) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#set($field=$column.javaField) +#set($dictType=$column.dictType) +#if("" != $treeParentCode && $column.javaField == $treeParentCode) +
+ +
+
+#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) + + + +
+
+
+#elseif($column.htmlType == "input") +
+ +
+ +
+
+#elseif($column.htmlType == "upload") +
+ +
+ +
+ +
+
+
+#elseif($column.htmlType == "summernote") +
+ +
+ +
+
+
+#elseif($column.htmlType == "select" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "select" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "checkbox" && "" != $dictType) +
+ +
+ +
+
+#elseif($column.htmlType == "checkbox" && $dictType) +
+ +
+ + 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "radio" && "" != $dictType) +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "radio" && $dictType) +
+ +
+
+ + +
+ 代码生成请选择字典属性 +
+
+#elseif($column.htmlType == "datetime") +
+ +
+
+ + +
+
+
+#elseif($column.htmlType == "textarea") +
+ +
+ +
+
+#end +#end +#end +#end +#if($table.sub) +

${subTable.functionName}信息

+
+
+ + +
+
+
+
+
+#end +
+
+ +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "upload") + +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") + +#break +#end +#end + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/html/list-tree.html.vm b/common-generator-starter/target/classes/vm/html/list-tree.html.vm new file mode 100644 index 0000000..f7f797d --- /dev/null +++ b/common-generator-starter/target/classes/vm/html/list-tree.html.vm @@ -0,0 +1,156 @@ + + + + + + +
+
+
+
+
+
    +#foreach($column in $columns) +#if($column.query) +#set($dictType=$column.dictType) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($column.htmlType == "input") +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +
  • + + + - + +
  • +#end +#end +#end +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/html/list.html.vm b/common-generator-starter/target/classes/vm/html/list.html.vm new file mode 100644 index 0000000..f2e9c5a --- /dev/null +++ b/common-generator-starter/target/classes/vm/html/list.html.vm @@ -0,0 +1,154 @@ + + + + + + +
+
+
+
+
+
    +#foreach($column in $columns) +#if($column.query) +#set($dictType=$column.dictType) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($column.htmlType == "input") +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) +
  • + + +
  • +#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") +
  • + + +
  • +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +
  • + + + - + +
  • +#end +#end +#end +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/html/tree.html.vm b/common-generator-starter/target/classes/vm/html/tree.html.vm new file mode 100644 index 0000000..80364ad --- /dev/null +++ b/common-generator-starter/target/classes/vm/html/tree.html.vm @@ -0,0 +1,51 @@ + + + + + + + + +#set($treeId = "${className}?." + $treeCode) +#set($treeName = "${className}?." + $treeName) + + +
+ + +
+ +
+ 展开 / + 折叠 +
+
+
+ + + + + \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/java/controller.java.vm b/common-generator-starter/target/classes/vm/java/controller.java.vm new file mode 100644 index 0000000..e826fd4 --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/controller.java.vm @@ -0,0 +1,202 @@ +package ${packageName}.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.page.TableDataInfo; +#elseif($table.tree) +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.core.domain.Ztree; +#end + +/** + * ${functionName}Controller + * + * @author ${author} + * @date ${datetime} + */ +@Controller +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController +{ + private String prefix = "${moduleName}/${businessName}"; + + @Autowired + private I${ClassName}Service ${className}Service; + + @RequiresPermissions("${permissionPrefix}:view") + @GetMapping() + public String ${businessName}() + { + return prefix + "/${businessName}"; + } + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + @RequiresPermissions("${permissionPrefix}:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(${ClassName} ${className}) + { + startPage(); + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return getDataTable(list); + } +#elseif($table.tree) + /** + * 查询${functionName}树列表 + */ + @RequiresPermissions("${permissionPrefix}:list") + @PostMapping("/list") + @ResponseBody + public List<${ClassName}> list(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return list; + } +#end + + /** + * 导出${functionName}列表 + */ + @RequiresPermissions("${permissionPrefix}:export") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + return util.exportExcel(list, "${functionName}数据"); + } + +#if($table.crud || $table.sub) + /** + * 新增${functionName} + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } +#elseif($table.tree) + /** + * 新增${functionName} + */ + @GetMapping(value = { "/add/{${pkColumn.javaField}}", "/add/" }) + public String add(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) + { + if (StringUtils.isNotNull(${pkColumn.javaField})) + { + mmap.put("${className}", ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } + return prefix + "/add"; + } +#end + + /** + * 新增保存${functionName} + */ + @RequiresPermissions("${permissionPrefix}:add") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(${ClassName} ${className}) + { + return toAjax(${className}Service.insert${ClassName}(${className})); + } + + /** + * 修改${functionName} + */ + @RequiresPermissions("${permissionPrefix}:edit") + @GetMapping("/edit/{${pkColumn.javaField}}") + public String edit(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}, ModelMap mmap) + { + ${ClassName} ${className} = ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + mmap.put("${className}", ${className}); + return prefix + "/edit"; + } + + /** + * 修改保存${functionName} + */ + @RequiresPermissions("${permissionPrefix}:edit") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(${ClassName} ${className}) + { + return toAjax(${className}Service.update${ClassName}(${className})); + } + +#if($table.crud || $table.sub) + /** + * 删除${functionName} + */ + @RequiresPermissions("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(ids)); + } +#elseif($table.tree) + /** + * 删除 + */ + @RequiresPermissions("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @GetMapping("/remove/{${pkColumn.javaField}}") + @ResponseBody + public AjaxResult remove(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) + { + return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } +#end +#if($table.tree) + + /** + * 选择${functionName}树 + */ +#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) + @GetMapping(value = { "/select${BusinessName}Tree/{${pkColumn.javaField}}", "/select${BusinessName}Tree/" }) + public String select${BusinessName}Tree(@PathVariable(value = "${pkColumn.javaField}", required = false) Long ${pkColumn.javaField}, ModelMap mmap) + { + if (StringUtils.isNotNull(${pkColumn.javaField})) + { + mmap.put("${className}", ${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } + return prefix + "/tree"; + } + + /** + * 加载${functionName}树列表 + */ + @GetMapping("/treeData") + @ResponseBody + public List treeData() + { + List ztrees = ${className}Service.select${ClassName}Tree(); + return ztrees; + } +#end +} diff --git a/common-generator-starter/target/classes/vm/java/domain.java.vm b/common-generator-starter/target/classes/vm/java/domain.java.vm new file mode 100644 index 0000000..bd51c17 --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/domain.java.vm @@ -0,0 +1,105 @@ +package ${packageName}.domain; + +#foreach ($import in $importList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.domain.BaseEntity; +#elseif($table.tree) +import com.ruoyi.common.core.domain.TreeEntity; +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity") +#end +public class ${ClassName} extends ${Entity} +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#if($table.sub) + /** $table.subTable.functionName信息 */ + private List<${subClassName}> ${subclassName}List; + +#end +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + +#if($table.sub) + public List<${subClassName}> get${subClassName}List() + { + return ${subclassName}List; + } + + public void set${subClassName}List(List<${subClassName}> ${subclassName}List) + { + this.${subclassName}List = ${subclassName}List; + } + +#end + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end +#if($table.sub) + .append("${subclassName}List", get${subClassName}List()) +#end + .toString(); + } +} diff --git a/common-generator-starter/target/classes/vm/java/mapper.java.vm b/common-generator-starter/target/classes/vm/java/mapper.java.vm new file mode 100644 index 0000000..ebee538 --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/mapper.java.vm @@ -0,0 +1,91 @@ +package ${packageName}.mapper; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +#if($table.sub) +import ${packageName}.domain.${subClassName}; +#end + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(String[] ${pkColumn.javaField}s); +#if($table.sub) + + /** + * 批量删除${subTable.functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}s(String[] ${pkColumn.javaField}s); + + /** + * 批量新增${subTable.functionName} + * + * @param ${subclassName}List ${subTable.functionName}列表 + * @return 结果 + */ + public int batch${subClassName}(List<${subClassName}> ${subclassName}List); + + + /** + * 通过${functionName}主键删除${subTable.functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); +#end +} diff --git a/common-generator-starter/target/classes/vm/java/service.java.vm b/common-generator-starter/target/classes/vm/java/service.java.vm new file mode 100644 index 0000000..765c9d6 --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/service.java.vm @@ -0,0 +1,73 @@ +package ${packageName}.service; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +#if($table.tree) +import com.ruoyi.common.core.domain.Ztree; +#end + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(String ${pkColumn.javaField}s); + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); +#if($table.tree) + + /** + * 查询${functionName}树列表 + * + * @return 所有${functionName}信息 + */ + public List select${ClassName}Tree(); +#end +} diff --git a/common-generator-starter/target/classes/vm/java/serviceImpl.java.vm b/common-generator-starter/target/classes/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..242b1c7 --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/serviceImpl.java.vm @@ -0,0 +1,213 @@ +package ${packageName}.service.impl; + +import java.util.List; +#if($table.tree) +import java.util.ArrayList; +import com.ruoyi.common.core.domain.Ztree; +#end +#foreach ($column in $columns) +#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') +import com.ruoyi.common.utils.DateUtils; +#break +#end +#end +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +#if($table.sub) +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import ${packageName}.domain.${subClassName}; +#end +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.core.text.Convert; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service +{ + @Autowired + private ${ClassName}Mapper ${className}Mapper; + + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + @Override + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { + return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName} + */ + @Override + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) + { + return ${className}Mapper.select${ClassName}List(${className}); + } + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int insert${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'createTime') + ${className}.setCreateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + int rows = ${className}Mapper.insert${ClassName}(${className}); + insert${subClassName}(${className}); + return rows; +#else + return ${className}Mapper.insert${ClassName}(${className}); +#end + } + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int update${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'updateTime') + ${className}.setUpdateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); + insert${subClassName}(${className}); +#end + return ${className}Mapper.update${ClassName}(${className}); + } + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}s(String ${pkColumn.javaField}s) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(Convert.toStrArray(${pkColumn.javaField}s)); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(Convert.toStrArray(${pkColumn.javaField}s)); + } + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } +#if($table.tree) + + /** + * 查询${functionName}树列表 + * + * @return 所有${functionName}信息 + */ + @Override + public List select${ClassName}Tree() + { + List<${ClassName}> ${className}List = ${className}Mapper.select${ClassName}List(new ${ClassName}()); + List ztrees = new ArrayList(); + for (${ClassName} ${className} : ${className}List) + { + Ztree ztree = new Ztree(); +#if($treeCode.length() > 2 && $treeCode.substring(1,2).matches("[A-Z]")) +#set($TreeCode=$treeCode) +#else +#set($TreeCode=$treeCode.substring(0,1).toUpperCase() + ${treeCode.substring(1)}) +#end +#if($treeParentCode.length() > 2 && $treeParentCode.substring(1,2).matches("[A-Z]")) +#set($TreeParentCode=$treeParentCode) +#else +#set($TreeParentCode=$treeParentCode.substring(0,1).toUpperCase() + ${treeParentCode.substring(1)}) +#end +#if($treeName.length() > 2 && $treeName.substring(1,2).matches("[A-Z]")) +#set($TreeName=$treeName) +#else +#set($TreeName=$treeName.substring(0,1).toUpperCase() + ${treeName.substring(1)}) +#end + ztree.setId(${className}.get${TreeCode}()); + ztree.setpId(${className}.get${TreeParentCode}()); + ztree.setName(${className}.get${TreeName}()); + ztree.setTitle(${className}.get${TreeName}()); + ztrees.add(ztree); + } + return ztrees; + } +#end +#if($table.sub) + + /** + * 新增${subTable.functionName}信息 + * + * @param ${className} ${functionName}对象 + */ + public void insert${subClassName}(${ClassName} ${className}) + { + List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); + ${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); + if (StringUtils.isNotNull(${subclassName}List)) + { + List<${subClassName}> list = new ArrayList<${subClassName}>(); + for (${subClassName} ${subclassName} : ${subclassName}List) + { + ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); + list.add(${subclassName}); + } + if (list.size() > 0) + { + ${className}Mapper.batch${subClassName}(list); + } + } + } +#end +} diff --git a/common-generator-starter/target/classes/vm/java/sub-domain.java.vm b/common-generator-starter/target/classes/vm/java/sub-domain.java.vm new file mode 100644 index 0000000..a3f53eb --- /dev/null +++ b/common-generator-starter/target/classes/vm/java/sub-domain.java.vm @@ -0,0 +1,76 @@ +package ${packageName}.domain; + +#foreach ($import in $subImportList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * ${subTable.functionName}对象 ${subTableName} + * + * @author ${author} + * @date ${datetime} + */ +public class ${subClassName} extends BaseEntity +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $subTable.columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end + .toString(); + } +} diff --git a/common-generator-starter/target/classes/vm/js/api.js.vm b/common-generator-starter/target/classes/vm/js/api.js.vm new file mode 100644 index 0000000..9295524 --- /dev/null +++ b/common-generator-starter/target/classes/vm/js/api.js.vm @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} diff --git a/common-generator-starter/target/classes/vm/sql/sql.vm b/common-generator-starter/target/classes/vm/sql/sql.vm new file mode 100644 index 0000000..d5121af --- /dev/null +++ b/common-generator-starter/target/classes/vm/sql/sql.vm @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}', '${parentMenuId}', '1', '/${moduleName}/${businessName}', 'C', '0', '${permissionPrefix}:view', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}查询', @parentId, '1', '#', 'F', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}新增', @parentId, '2', '#', 'F', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}修改', @parentId, '3', '#', 'F', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}删除', @parentId, '4', '#', 'F', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}导出', @parentId, '5', '#', 'F', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); diff --git a/common-generator-starter/target/classes/vm/vue/index-tree.vue.vm b/common-generator-starter/target/classes/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..bfb61b5 --- /dev/null +++ b/common-generator-starter/target/classes/vm/vue/index-tree.vue.vm @@ -0,0 +1,482 @@ + + + diff --git a/common-generator-starter/target/classes/vm/vue/index.vue.vm b/common-generator-starter/target/classes/vm/vue/index.vue.vm new file mode 100644 index 0000000..65620b4 --- /dev/null +++ b/common-generator-starter/target/classes/vm/vue/index.vue.vm @@ -0,0 +1,573 @@ + + + diff --git a/common-generator-starter/target/classes/vm/vue/v3/index-tree.vue.vm b/common-generator-starter/target/classes/vm/vue/v3/index-tree.vue.vm new file mode 100644 index 0000000..5342e91 --- /dev/null +++ b/common-generator-starter/target/classes/vm/vue/v3/index-tree.vue.vm @@ -0,0 +1,464 @@ + + + diff --git a/common-generator-starter/target/classes/vm/vue/v3/index.vue.vm b/common-generator-starter/target/classes/vm/vue/v3/index.vue.vm new file mode 100644 index 0000000..08bb071 --- /dev/null +++ b/common-generator-starter/target/classes/vm/vue/v3/index.vue.vm @@ -0,0 +1,564 @@ + + + diff --git a/common-generator-starter/target/classes/vm/vue/v3/readme.txt b/common-generator-starter/target/classes/vm/vue/v3/readme.txt new file mode 100644 index 0000000..10362d6 --- /dev/null +++ b/common-generator-starter/target/classes/vm/vue/v3/readme.txt @@ -0,0 +1 @@ +ʹõRuoYi-Cloud-Vue3ǰˣôҪһ´Ŀ¼ģindex.vue.vmindex-tree.vue.vmļϼvueĿ¼ \ No newline at end of file diff --git a/common-generator-starter/target/classes/vm/xml/mapper.xml.vm b/common-generator-starter/target/classes/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..9de59b5 --- /dev/null +++ b/common-generator-starter/target/classes/vm/xml/mapper.xml.vm @@ -0,0 +1,147 @@ + + + + + +#foreach ($column in $columns) + +#end +#if($table.tree) + +#end + +#if($table.sub) + + + + + + +#foreach ($column in $subTable.columns) + +#end + +#end + + + select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName} + + + + + + + + insert into ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, +#end +#end + + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, +#end +#end + + + + + update ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName) + $column.columnName = #{$column.javaField}, +#end +#end + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} in + + #{${pkColumn.javaField}} + + +#if($table.sub) + + + delete from ${subTableName} where ${subTableFkName} in + + #{${subTableFkclassName}} + + + + + delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} + + + + insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values + + (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end) + + +#end + + \ No newline at end of file diff --git a/common-generator-starter/target/common-generator-starter-1.0.0-SNAPSHOT.jar b/common-generator-starter/target/common-generator-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..405e9de Binary files /dev/null and b/common-generator-starter/target/common-generator-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-generator-starter/target/maven-archiver/pom.properties b/common-generator-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..068ee1f --- /dev/null +++ b/common-generator-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:16 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-generator-starter diff --git a/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e1384dd --- /dev/null +++ b/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,19 @@ +com\mosty\common\generator\controller\GenController.class +com\mosty\common\generator\config\GenConstants.class +com\mosty\common\generator\util\CharsetKit.class +com\mosty\common\generator\domain\GenTableColumn.class +com\mosty\common\generator\service\IGenTableColumnService.class +com\mosty\common\generator\mapper\GenTableColumnMapper.class +com\mosty\common\generator\service\IGenTableService.class +com\mosty\common\generator\util\VelocityUtils.class +com\mosty\common\generator\config\GenConfig.class +com\mosty\common\generator\config\BaseEntity.class +com\mosty\common\generator\mapper\GenTableMapper.class +com\mosty\common\generator\util\VelocityInitializer.class +com\mosty\common\generator\util\Convert.class +com\mosty\common\generator\domain\GenTable.class +com\mosty\common\generator\util\GenUtils.class +com\mosty\common\generator\GeneratorAutoConfiguration.class +com\mosty\common\generator\service\GenTableServiceImpl.class +com\mosty\common\generator\service\GenTableColumnServiceImpl.class +com\mosty\common\generator\util\StringUtils.class diff --git a/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..96cba03 --- /dev/null +++ b/common-generator-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,30 @@ +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\GenTableServiceImpl.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\controller\GenController.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\config\GenConstants.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\VelocityUtils.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\GenTableService_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\GeneratorAutoConfiguration.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\Convert.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\IGenTableService.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\VelocityInitializer_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\mapper\GenTableMapper.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\domain\GenTableColumn_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\mapper\GenTableColumnMapper_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\VelocityInitializer.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\StringUtils.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\mapper\GenTableColumnMapper.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\config\GenConfig.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\mapper\GenTableMapper_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\domain\GenTable.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\GenTableColumnServiceImpl.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\CharsetKit.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\GenTableColumnService_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\GenUtils_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\config\GenConfig_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\domain\GenTableColumn.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\service\IGenTableColumnService.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\controller\GenController_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\domain\GenTable_bak.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\GenUtils.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\config\BaseEntity.java +E:\project\zgga\mosty-common\common-generator-starter\src\main\java\com\mosty\common\generator\util\VelocityUtils_bak.java diff --git a/common-log-base-starter/common-log-base-starter.iml b/common-log-base-starter/common-log-base-starter.iml new file mode 100644 index 0000000..315d4b5 --- /dev/null +++ b/common-log-base-starter/common-log-base-starter.iml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-log-base-starter/pom.xml b/common-log-base-starter/pom.xml new file mode 100644 index 0000000..17188d2 --- /dev/null +++ b/common-log-base-starter/pom.xml @@ -0,0 +1,98 @@ + + + + com.mosty + mosty-common + 1.0.0-SNAPSHOT + + 4.0.0 + + common-log-base-starter + + + 8 + 8 + + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + true + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.2.0 + true + + + org.springframework.boot + spring-boot-starter-aop + ${spring-boot-dependencies.version} + true + + + com.alibaba + fastjson + ${fastjson.version} + + + org.apache.commons + commons-lang3 + 3.12.0 + + + com.google.guava + guava + 29.0-jre + + + com.mosty + common-token-starter + 1.0.0-SNAPSHOT + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + + + + + + + + + + + + + + + + mosty-nexus-releases + release version + http://47.108.232.77:8181/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://47.108.232.77:8181/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/BaseController.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/BaseController.java new file mode 100644 index 0000000..322799a --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/BaseController.java @@ -0,0 +1,219 @@ +package com.mosty.operation.log; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; + +import java.beans.PropertyEditorSupport; +import java.text.ParseException; +import java.util.Date; +//import com.github.pagehelper.PageHelper; +//import com.github.pagehelper.PageInfo; +//import com.ruoyi.common.core.domain.AjaxResult; +//import com.ruoyi.common.core.domain.AjaxResult.Type; +//import com.ruoyi.common.core.domain.entity.SysUser; +//import com.ruoyi.common.core.page.PageDomain; +//import com.ruoyi.common.core.page.TableDataInfo; +//import com.ruoyi.common.core.page.TableSupport; +//import com.ruoyi.common.utils.DateUtils; +//import com.ruoyi.common.utils.PageUtils; +//import com.ruoyi.common.utils.ServletUtils; +//import com.ruoyi.common.utils.ShiroUtils; +//import com.ruoyi.common.utils.StringUtils; +//import com.ruoyi.common.utils.sql.SqlUtil; + +/** + * web层通用数据处理 + * + * @author ruoyi + */ +@Slf4j +public class BaseController { + + /** + * 将前台传递过来的日期格式的字符串,自动转化为Date类型 + */ + @InitBinder + public void initBinder(WebDataBinder binder) { + // Date 类型转换 + binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { + @Override + public void setAsText(String text) { + try { + setValue(DateUtils.parseDate(text)); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }); + } + + /** + * 设置请求分页数据 + */ +// protected void startPage() +// { +// PageUtils.startPage(); +// } +// +// /** +// * 设置请求排序数据 +// */ +// protected void startOrderBy() +// { +// PageDomain pageDomain = TableSupport.buildPageRequest(); +// if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) +// { +// String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); +// PageHelper.orderBy(orderBy); +// } +// } +// +// /** +// * 获取request +// */ +// public HttpServletRequest getRequest() +// { +// return ServletUtils.getRequest(); +// } +// +// /** +// * 获取response +// */ +// public HttpServletResponse getResponse() +// { +// return ServletUtils.getResponse(); +// } +// +// /** +// * 获取session +// */ +// public HttpSession getSession() +// { +// return getRequest().getSession(); +// } +// +// /** +// * 响应请求分页数据 +// */ +// @SuppressWarnings({ "rawtypes", "unchecked" }) +// protected TableDataInfo getDataTable(List list) +// { +// TableDataInfo rspData = new TableDataInfo(); +// rspData.setCode(0); +// rspData.setRows(list); +// rspData.setTotal(new PageInfo(list).getTotal()); +// return rspData; +// } +// +// /** +// * 响应返回结果 +// * +// * @param rows 影响行数 +// * @return 操作结果 +// */ +// protected AjaxResult toAjax(int rows) +// { +// return rows > 0 ? success() : error(); +// } +// +// /** +// * 响应返回结果 +// * +// * @param result 结果 +// * @return 操作结果 +// */ +// protected AjaxResult toAjax(boolean result) +// { +// return result ? success() : error(); +// } +// +// /** +// * 返回成功 +// */ +// public AjaxResult success() +// { +// return AjaxResult.success(); +// } +// +// /** +// * 返回失败消息 +// */ +// public AjaxResult error() +// { +// return AjaxResult.error(); +// } +// +// /** +// * 返回成功消息 +// */ +// public AjaxResult success(String message) +// { +// return AjaxResult.success(message); +// } +// +// /** +// * 返回成功数据 +// */ +// public static AjaxResult success(Object data) +// { +// return AjaxResult.success("操作成功", data); +// } +// +// /** +// * 返回失败消息 +// */ +// public AjaxResult error(String message) +// { +// return AjaxResult.error(message); +// } +// +// /** +// * 返回错误码消息 +// */ +// public AjaxResult error(Type type, String message) +// { +// return new AjaxResult(type, message); +// } +// +// /** +// * 页面跳转 +// */ +// public String redirect(String url) +// { +// return StringUtils.format("redirect:{}", url); +// } +// +// /** +// * 获取用户缓存信息 +// */ +// public SysUser getSysUser() +// { +// return ShiroUtils.getSysUser(); +// } +// +// /** +// * 设置用户缓存信息 +// */ +// public void setSysUser(SysUser user) +// { +// ShiroUtils.setSysUser(user); +// } +// +// /** +// * 获取登录用户id +// */ +// public Long getUserId() +// { +// return getSysUser().getUserId(); +// } +// +// /** +// * 获取登录用户名 +// */ +// public String getLoginName() +// { +// return getSysUser().getLoginName(); +// } +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/BusinessStatus.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/BusinessStatus.java new file mode 100644 index 0000000..3eca628 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/BusinessStatus.java @@ -0,0 +1,18 @@ +package com.mosty.operation.log; + +/** + * 操作状态 + * + * @author ruoyi + */ +public enum BusinessStatus { + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/LogAspect.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/LogAspect.java new file mode 100644 index 0000000..1d35c30 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/LogAspect.java @@ -0,0 +1,216 @@ +package com.mosty.operation.log; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.support.spring.PropertyPreFilters; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.common.base.threadpool.SimpleThreadPool; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.base.util.ServletUtils; +import com.mosty.common.base.util.SpringIocContext; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.token.JWTUtil; +import com.mosty.common.token.UserInfo; +import com.mosty.operation.log.service.SysOperLogService; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Collection; +import java.util.Map; + +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_HEADER; +import static com.mosty.common.base.entity.log.LogConst.LOG_THREAD_POOL; + + +/** + * 操作日志记录处理 + * + * @author ruoyi + */ +@Slf4j +@Aspect +@Component +public class LogAspect extends LogSaveStrategy { + + // 排除敏感属性字段 + public static final String[] EXCLUDE_PROPERTIES = {"password", "oldPassword", "newPassword", "confirmPassword"}; + + // 配置织入点 + @Pointcut("@annotation(com.mosty.common.base.entity.log.Log)") + public void logPointCut() { + } + + // 处理完请求后执行 + @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) { + handleLog(joinPoint, controllerLog, null, jsonResult); + } + + // 拦截异常操作 + @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) { + handleLog(joinPoint, controllerLog, e, null); + } + + protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) { + try { + String token = ServletUtils.getRequest().getHeader(TOKEN_HEADER); + // 获取当前的用户 从header中获取 + UserInfo userInfo = JWTUtil.getUserInfo(token); + String ipAddress = IpUtil.getIpAddress(ServletUtils.getRequest()); + // *========数据库日志=========*// + SysOperLog operLog = new SysOperLog(); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); + // 请求的地址 + operLog.setOperIp(ipAddress); + String url = ServletUtils.getRequest().getRequestURI(); + operLog.setOperUrl(url); + // 添加服务名称 + if (url != null && url.length() >= 11) { + String[] s = url.split("/"); + if (s.length >= 2 && s[1].contains("mosty-")) { + operLog.setMkmc(s[1]); + } + } + if (userInfo != null) { + operLog.setOperName(userInfo.getUserLoginName()); + operLog.setOperUserId(String.valueOf(userInfo.getUserId())); + operLog.setOperSfzh(userInfo.getIdEntityCard()); + if (StringUtils.isNotNull(userInfo.getDeptId()) + && StringUtils.isNotEmpty(userInfo.getDeptName())) { + operLog.setSsbm(userInfo.getDeptName()); + operLog.setSsbmid(String.valueOf(userInfo.getDeptId())); + operLog.setSsbmdm(userInfo.getDeptCode()); + } + } + if (e != null) { + operLog.setStatus(BusinessStatus.FAIL.ordinal()); + operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); + } + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + // 保存数据库 + SimpleThreadPool.execute(LOG_THREAD_POOL, () -> + SpringIocContext.getBean(SysOperLogService.class).insertOperlog(operLog)); + } catch (Exception exp) { + // 记录本地异常日志 + log.error("==前置通知异常=="); + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception { + // 设置action动作 + operLog.setBusinessType(log.businessType().ordinal()); + // 设置标题 + operLog.setTitle(log.title()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); + // 是否需要保存request,参数和值 + if (log.isSaveRequestData()) { + // 获取参数的信息,传入到数据库中。 + setRequestValue(joinPoint, operLog); + } + // 是否需要保存response,参数和值 + if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) { + operLog.setJsonResult(StringUtils.substring(JSONObject.toJSONString(jsonResult), 0, 2000)); + } + } + + /** + * 获取请求的参数,放到log中 + * + * @param operLog 操作日志 + * @throws Exception 异常 + */ + private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception { + Map map = ServletUtils.getRequest().getParameterMap(); + if (StringUtils.isNotEmpty(map)) { + String params = JSONObject.toJSONString(map, excludePropertyPreFilter()); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } else { + Object args = joinPoint.getArgs(); + if (StringUtils.isNotNull(args)) { + String params = argsArrayToString(joinPoint.getArgs()); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } + } + } + + /** + * 忽略敏感属性 + */ + public PropertyPreFilters.MySimplePropertyPreFilter excludePropertyPreFilter() { + return new PropertyPreFilters().addFilter().addExcludes(EXCLUDE_PROPERTIES); + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray) { + StringBuilder params = new StringBuilder(); + if (paramsArray != null && paramsArray.length > 0) { + for (Object o : paramsArray) { + if (StringUtils.isNotNull(o) && !isFilterObject(o)) { + try { + Object jsonObj = JSONObject.toJSONString(o, excludePropertyPreFilter()); + params.append(jsonObj.toString()).append(" "); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return params.toString().trim(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) { + Class clazz = o.getClass(); + if (clazz.isArray()) { + return clazz.getComponentType().isAssignableFrom(MultipartFile.class); + } else if (Collection.class.isAssignableFrom(clazz)) { + Collection collection = (Collection) o; + for (Object value : collection) { + return value instanceof MultipartFile; + } + } else if (Map.class.isAssignableFrom(clazz)) { + Map map = (Map) o; + for (Object value : map.entrySet()) { + Map.Entry entry = (Map.Entry) value; + return entry.getValue() instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/LogSaveStrategy.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/LogSaveStrategy.java new file mode 100644 index 0000000..2127597 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/LogSaveStrategy.java @@ -0,0 +1,42 @@ +package com.mosty.operation.log; + +import com.google.common.collect.Sets; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.lang.NonNull; + +import java.util.Collections; +import java.util.Set; + +public class LogSaveStrategy implements ApplicationContextAware { + + @Value("${spring.application.name}") + private String applicationName; + + /** ioc 容器 */ + private static ApplicationContext applicationContext; + + private static final Set NATIVE_APP_NAME = Collections.unmodifiableSet(Sets.newHashSet("mosty", "mosty-base")); + +// private final FeignClient; + + + private Boolean nativeInvoke() { + return NATIVE_APP_NAME.contains(applicationName); + } + + @Override + public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException { + LogSaveStrategy.applicationContext = applicationContext; + } + + protected void saveOperationLog() { + if (nativeInvoke()) { + + } +// remoteFeign(); + } + +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/OperationLogBaseAutoConfiguration.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/OperationLogBaseAutoConfiguration.java new file mode 100644 index 0000000..5778d62 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/OperationLogBaseAutoConfiguration.java @@ -0,0 +1,18 @@ +package com.mosty.operation.log; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * 代码生成自动装配 + * @author kevin + * @date 2022/2/3 3:34 PM + * @since 1.0.0 + */ +@Configuration +@ComponentScan(basePackages = "com.mosty.operation") +@MapperScan("com.mosty.operation.log.mapper") +public class OperationLogBaseAutoConfiguration { + +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/SysOperlogController.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/SysOperlogController.java new file mode 100644 index 0000000..f731296 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/SysOperlogController.java @@ -0,0 +1,118 @@ +package com.mosty.operation.log.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.common.token.JwtSysUser; +import com.mosty.operation.log.BaseController; +import com.mosty.operation.log.entity.DeleteListVO; +import com.mosty.operation.log.entity.VO.OperlogPage; +import com.mosty.operation.log.service.SysOperLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志记录 + * + * @author ruoyi + */ +@RestController +@AllArgsConstructor +@Api(tags = "操作日志") +@RequestMapping("/monitor/operlog") +public class SysOperlogController { + + + private final SysOperLogService operLogService; + + + @PostMapping("/list") + @ApiOperation("查询操作日志列表") + @Log(title = "查询操作日志详情", businessType = BusinessType.OTHER) + public ResponseResult> list(@RequestBody OperlogPage operLog) { + IPage sysOperLogPage = operLogService.selectByPage(operLog); + return ResponseResult.success(sysOperLogPage); + } + + + @Log(title = "删除操作日志", businessType = BusinessType.DELETE) + @ApiOperation("查询操作日志详情") + @PostMapping("/remove") + public ResponseResult remove(@RequestBody DeleteListVO deleteListVO) { + operLogService.deleteOperLogByIds(deleteListVO.getIds()); + return ResponseResult.success(Boolean.TRUE); + } + + @ApiOperation("查询操作日志详情") + @Log(title = "查询操作日志详情", businessType = BusinessType.OTHER) + @GetMapping("/detail/{id}") + public ResponseResult detail(@PathVariable("id") Long id) { + SysOperLog log = operLogService.getOne(new LambdaQueryWrapper() + .eq(SysOperLog::getOperId, id)); + return ResponseResult.success(log); + } + + @Log(title = "清空操作日志", businessType = BusinessType.CLEAN) + @ApiOperation("清空操作日志") + @PostMapping("/clean") + public ResponseResult clean() { + operLogService.cleanOperLog(); + return ResponseResult.success(Boolean.TRUE); + } + + @Log(title = "系统使用情况统计数字", businessType = BusinessType.OTHER) + @ApiOperation("系统使用情况统计数字") + @JwtSysUser + @PostMapping("/statistics") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天 4.90天", required = true, dataType = "String"), + }) + public ResponseResult> statistics(String type) { + return ResponseResult.success(operLogService.statistics(type)); + } + + @Log(title = "部门排名统计TOP10", businessType = BusinessType.OTHER) + @ApiOperation("部门排名统计TOP10") + @JwtSysUser + @PostMapping("/bmStatistics") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天 4.90天", required = true, dataType = "String"), + }) + public ResponseResult>> bmStatistics(String type) { + return ResponseResult.success(operLogService.bmStatistics(type)); + } + + @Log(title = "人员排名统计TOP10", businessType = BusinessType.OTHER) + @ApiOperation("人员排名统计TOP10") + @JwtSysUser + @PostMapping("/ryStatistics") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天 4.90天", required = true, dataType = "String"), + }) + public ResponseResult>> ryStatistics(String type) { + return ResponseResult.success(operLogService.ryStatistics(type)); + } + + @Log(title = "模块排名统计", businessType = BusinessType.OTHER) + @ApiOperation("模块排名统计") + @JwtSysUser + @PostMapping("/mkStatistics") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天 4.90天", required = true, dataType = "String"), + }) + public ResponseResult>> mkStatistics(String type) { + return ResponseResult.success(operLogService.mkStatistics(type)); + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/provider/SysOperlogProviderController.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/provider/SysOperlogProviderController.java new file mode 100644 index 0000000..2ed997f --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/controller/provider/SysOperlogProviderController.java @@ -0,0 +1,38 @@ +package com.mosty.operation.log.controller.provider; + +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.operation.log.BaseController; +import com.mosty.operation.log.service.SysOperLogService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +/** + * 操作日志记录 + * + * @author ruoyi + */ +@RestController +@Api(tags = "操作日志 for Feign调用") +@RequestMapping("/provider/monitor/operateLog") +public class SysOperlogProviderController extends BaseController { + + private String prefix = "monitor/operlog"; + + @Autowired + private SysOperLogService operLogService; + + // 添加操作日志 + @PostMapping("/save") + public ResponseResult save(@RequestBody SysOperLog sysOperLog) { + operLogService.insertOperlog(sysOperLog); + return ResponseResult.success(); + } + + @GetMapping() + public String operlog(){ + return prefix + "/operlog"; + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/BaseEntity.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/BaseEntity.java new file mode 100644 index 0000000..3e46bfb --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/BaseEntity.java @@ -0,0 +1,115 @@ +package com.mosty.operation.log.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Entity基类 + * + * @author ruoyi + */ +public class BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 搜索值 */ + private String searchValue; + + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新者 */ + private String updateBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** 备注 */ + private String remark; + + /** 请求参数 */ + private Map params; + + public String getSearchValue() + { + return searchValue; + } + + public void setSearchValue(String searchValue) + { + this.searchValue = searchValue; + } + + public String getCreateBy() + { + return createBy; + } + + public void setCreateBy(String createBy) + { + this.createBy = createBy; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public String getUpdateBy() + { + return updateBy; + } + + public void setUpdateBy(String updateBy) + { + this.updateBy = updateBy; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Map getParams() + { + if (params == null) + { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) + { + this.params = params; + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/DeleteListVO.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/DeleteListVO.java new file mode 100644 index 0000000..c52d549 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/DeleteListVO.java @@ -0,0 +1,20 @@ +package com.mosty.operation.log.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="DeleteListVO", description="DeleteList批量") +public class DeleteListVO { + /** + * ID集合 + */ + private List ids; +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excel.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excel.java new file mode 100644 index 0000000..0666716 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excel.java @@ -0,0 +1,175 @@ +package com.mosty.operation.log.entity; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.math.BigDecimal; + +/** + * 自定义导出Excel数据注解 + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel +{ + /** + * 导出时在excel中排序 + */ + public int sort() default Integer.MAX_VALUE; + + /** + * 导出到Excel中的名字. + */ + public String name() default ""; + + /** + * 日期格式, 如: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) + */ + public String dictType() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + public String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + public String separator() default ","; + + /** + * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) + */ + public int scale() default -1; + + /** + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN + */ + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + + /** + * 导出类型(0数字 1字符串) + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 导出时在excel中每个列的高度 单位为字符 + */ + public double height() default 14; + + /** + * 导出时在excel中每个列的宽 单位为字符 + */ + public double width() default 16; + + /** + * 文字后缀,如% 90 变成90% + */ + public String suffix() default ""; + + /** + * 当值为空时,字段的默认值 + */ + public String defaultValue() default ""; + + /** + * 提示信息 + */ + public String prompt() default ""; + + /** + * 设置只能选择不能输入的列内容. + */ + public String[] combo() default {}; + + /** + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. + */ + public boolean isExport() default true; + + /** + * 另一个类中的属性名称,支持多级获取,以小数点隔开 + */ + public String targetAttr() default ""; + + /** + * 是否自动统计数据,在最后追加一行统计数据总和 + */ + public boolean isStatistics() default false; + + /** + * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右) + */ + public Align align() default Align.AUTO; + + /** + * 自定义数据处理器 + */ + public Class handler() default ExcelHandlerAdapter.class; + + /** + * 自定义数据处理器参数 + */ + public String[] args() default {}; + + public enum Align + { + AUTO(0), LEFT(1), CENTER(2), RIGHT(3); + private final int value; + + Align(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1), IMAGE(2); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/ExcelHandlerAdapter.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/ExcelHandlerAdapter.java new file mode 100644 index 0000000..3e868e0 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/ExcelHandlerAdapter.java @@ -0,0 +1,19 @@ +package com.mosty.operation.log.entity; + +/** + * Excel数据格式处理适配器 + * + * @author ruoyi + */ +public interface ExcelHandlerAdapter +{ + /** + * 格式化 + * + * @param value 单元格数据值 + * @param args excel注解args参数组 + * + * @return 处理后的值 + */ + Object format(Object value, String[] args); +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excels.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excels.java new file mode 100644 index 0000000..a91694b --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/Excels.java @@ -0,0 +1,18 @@ +package com.mosty.operation.log.entity; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel注解集 + * + * @author ruoyi + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Excels +{ + Excel[] value(); +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/SysUser.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/SysUser.java new file mode 100644 index 0000000..197b694 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/SysUser.java @@ -0,0 +1,377 @@ +package com.mosty.operation.log.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 用户对象 sys_user + * + * @author ruoyi + */ +public class SysUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号") + private Long userId; + + /** 部门ID */ + @Excel(name = "部门编号", type = Excel.Type.IMPORT) + private Long deptId; + + /** 部门父ID */ + private Long parentId; + + /** 角色ID */ + private Long roleId; + + /** 登录名称 */ + @Excel(name = "登录名称") + private String loginName; + + /** 用户名称 */ + @Excel(name = "用户名称") + private String userName; + + /** 用户类型 */ + private String userType; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 用户性别 */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 盐加密 */ + private String salt; + + /** 帐号状态(0正常 1停用) */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + @Excel(name = "最后登录IP", type = Excel.Type.EXPORT) + private String loginIp; + + /** 最后登录时间 */ + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT) + private Date loginDate; + + /** 密码最后更新时间 */ + private Date pwdUpdateDate; + + /** 部门对象 */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT) + }) +// private SysDept dept; +// +// private List roles; + + /** 角色组 */ + private Long[] roleIds; + + /** 岗位组 */ + private Long[] postIds; + + public SysUser() + { + + } + + public SysUser(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public boolean isAdmin() + { + return isAdmin(this.userId); + } + + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + +// @Xss(message = "登录账号不能包含脚本字符") +// @NotBlank(message = "登录账号不能为空") +// @Size(min = 0, max = 30, message = "登录账号长度不能超过30个字符") + public String getLoginName() + { + return loginName; + } + + public void setLoginName(String loginName) + { + this.loginName = loginName; + } + +// @Xss(message = "用户昵称不能包含脚本字符") +// @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserType() + { + return userType; + } + + public void setUserType(String userType) + { + this.userType = userType; + } + +// @Email(message = "邮箱格式不正确") +// @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + +// @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") + public String getPhonenumber() + { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) + { + this.phonenumber = phonenumber; + } + + public String getSex() + { + return sex; + } + + public void setSex(String sex) + { + this.sex = sex; + } + + public String getAvatar() + { + return avatar; + } + + public void setAvatar(String avatar) + { + this.avatar = avatar; + } + + @JsonIgnore + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getSalt() + { + return salt; + } + + public void setSalt(String salt) + { + this.salt = salt; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getLoginIp() + { + return loginIp; + } + + public void setLoginIp(String loginIp) + { + this.loginIp = loginIp; + } + + public Date getLoginDate() + { + return loginDate; + } + + public void setLoginDate(Date loginDate) + { + this.loginDate = loginDate; + } + + public Date getPwdUpdateDate() + { + return pwdUpdateDate; + } + + public void setPwdUpdateDate(Date pwdUpdateDate) + { + this.pwdUpdateDate = pwdUpdateDate; + } + +// public SysDept getDept() +// { +// if (dept == null) +// { +// dept = new SysDept(); +// } +// return dept; +// } +// +// public void setDept(SysDept dept) +// { +// this.dept = dept; +// } +// +// public List getRoles() +// { +// return roles; +// } +// +// public void setRoles(List roles) +// { +// this.roles = roles; +// } + + public Long[] getRoleIds() + { + return roleIds; + } + + public void setRoleIds(Long[] roleIds) + { + this.roleIds = roleIds; + } + + public Long[] getPostIds() + { + return postIds; + } + + public void setPostIds(Long[] postIds) + { + this.postIds = postIds; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("deptId", getDeptId()) + .append("loginName", getLoginName()) + .append("userName", getUserName()) + .append("userType", getUserType()) + .append("email", getEmail()) + .append("phonenumber", getPhonenumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("password", getPassword()) + .append("salt", getSalt()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) +// .append("dept", getDept()) +// .append("roles", getRoles()) + .toString(); + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/VO/OperlogPage.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/VO/OperlogPage.java new file mode 100644 index 0000000..4f92d5c --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/entity/VO/OperlogPage.java @@ -0,0 +1,42 @@ +package com.mosty.operation.log.entity.VO; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mosty.common.base.entity.log.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +public class OperlogPage extends Page { + + /** + * 操作模块 + */ + @ApiModelProperty(value = "操作模块") + private String title; + + /** + * 操作人员 + */ + @ApiModelProperty(value = "操作人员") + private String operName; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + @ApiModelProperty(value = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") + private Integer businessType; + + /** + * 操作状态(0正常 1异常) + */ + @ApiModelProperty(value = "状态 0=正常,1=异常") + private Integer status; + + + +} + diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/mapper/SysOperLogMapper.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/mapper/SysOperLogMapper.java new file mode 100644 index 0000000..708e79a --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/mapper/SysOperLogMapper.java @@ -0,0 +1,61 @@ +package com.mosty.operation.log.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.base.entity.log.SysOperLog; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 操作日志 数据层 + * + * @author ruoyi + */ +public interface SysOperLogMapper extends BaseMapper { + + // 新增操作日志 + void insertOperlog(SysOperLog operLog); + + // 查询系统操作日志集合 + List selectOperLogList(SysOperLog operLog); + + // 批量删除系统操作日志 + int deleteOperLogByIds(String[] ids); + + // 查询操作日志详细 + SysOperLog selectOperLogById(Long operId); + + // 清空操作日志 + void cleanOperLog(); + + // 查询使用次数 + int getSycs(@Param("kssj") String kssj, + @Param("jssj") String jssj, + @Param("useSql") String useSql, + @Param("status") String status); + + // 查询访问人数 + int getFwrs(@Param("kssj") String kssj, + @Param("jssj") String jssj, + @Param("useSql") String useSql); + + // 部门排名统计 + List> bmStatistics(@Param("kssj") String kssj, + @Param("jssj") String jssj, + @Param("aUseSql") String aUseSql, + @Param("bUseSql") String bUseSql); + + // 人员排名统计 + List> ryStatistics(@Param("kssj") String kssj, + @Param("jssj") String jssj, + @Param("aUseSql") String aUseSql, + @Param("bUseSql") String bUseSql); + + // 模块排名统计 + List> mkStatistics(@Param("kssj") String kssj, + @Param("jssj") String jssj, + @Param("aUseSql") String aUseSql, + @Param("bUseSql") String bUseSql); +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/service/SysOperLogService.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/service/SysOperLogService.java new file mode 100644 index 0000000..69be0f7 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/service/SysOperLogService.java @@ -0,0 +1,53 @@ +package com.mosty.operation.log.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.operation.log.entity.VO.OperlogPage; +import com.mosty.operation.log.mapper.SysOperLogMapper; +import com.mosty.operation.log.util.Convert; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志 服务层处理 + * + * @author ruoyi + */ +@Service +public interface SysOperLogService extends IService { + + // 新增操作日志 + void insertOperlog(SysOperLog operLog); + + // 查询系统操作日志集合 + List selectOperLogList(SysOperLog operLog); + + // 批量删除系统操作日志 + void deleteOperLogByIds(List ids); + + // 查询操作日志详细 + SysOperLog selectOperLogById(Long operId); + + // 清空操作日志 + void cleanOperLog(); + + //分页查询 + IPage selectByPage(OperlogPage operLog); + + // 系统使用情况统计数字 + Map statistics(String type); + + // 部门排名统计TOP10 + List> bmStatistics(String type); + + // 人员排名统计TOP10 + List> ryStatistics(String type); + + // 模块排名统计 + List> mkStatistics(String type); +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.java new file mode 100644 index 0000000..229eb6d --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.java @@ -0,0 +1,173 @@ +package com.mosty.operation.log.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.base.entity.log.SysOperLog; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.token.UserInfo; +import com.mosty.common.token.UserInfoManager; +import com.mosty.common.util.PermissionsUtil; +import com.mosty.operation.log.entity.VO.OperlogPage; +import com.mosty.operation.log.mapper.SysOperLogMapper; +import com.mosty.operation.log.service.SysOperLogService; +import com.mosty.operation.log.util.Convert; +import org.apache.catalina.User; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.*; + +/** + * 操作日志 服务层处理 + */ + +@Service +public class SysOperLogServiceImpl extends ServiceImpl + implements SysOperLogService { + + @Resource + private SysOperLogMapper operLogMapper; + + // 新增操作日志 + @Override + public void insertOperlog(SysOperLog operLog) { + if (operLog.getOperTime() == null) { + operLog.setOperTime(new Date()); + } + operLogMapper.insertOperlog(operLog); + } + + // 查询系统操作日志集合 + @Override + public List selectOperLogList(SysOperLog operLog) { + return operLogMapper.selectOperLogList(operLog); + } + + // 批量删除系统操作日志 + @Override + public void deleteOperLogByIds(List ids) { + operLogMapper.delete(new LambdaQueryWrapper() + .in(SysOperLog::getOperId, ids)); + } + + // 查询操作日志详细 + @Override + public SysOperLog selectOperLogById(Long operId) { + return operLogMapper.selectOperLogById(operId); + } + + // 清空操作日志 + @Override + public void cleanOperLog() { + operLogMapper.cleanOperLog(); + } + + @Override + public IPage selectByPage(OperlogPage dto) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + qw.like(StringUtils.isNotBlank(dto.getTitle()), SysOperLog::getTitle, dto.getTitle()) + .like(StringUtils.isNotBlank(dto.getOperName()), SysOperLog::getOperName, dto.getOperName()) + .eq(Objects.nonNull(dto.getBusinessType()), SysOperLog::getBusinessType, dto.getBusinessType()) + .eq(Objects.nonNull(dto.getStatus()), SysOperLog::getStatus, dto.getStatus()) + .orderByDesc(SysOperLog::getOperId); + return operLogMapper.selectPage(dto, qw); + } + + @Override + public Map statistics(String type) { + UserInfo user = UserInfoManager.get(); + String useSql = PermissionsUtil.createSql("", user); + String kssj = null, jssj; + jssj = DateUtils.getTime(); + if ("1".equals(type)) { + kssj = DateUtils.getDate() + " 00:00:00"; + } else if ("2".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -8)); + } else if ("3".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -31)); + } else if ("4".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -90)); + } + Map map = new HashMap<>(); + // 请求成功次数 + map.put("qqcgcs", this.operLogMapper.getSycs(kssj, jssj, useSql, "0")); + // 请求失败次数 + map.put("qqsbcs", this.operLogMapper.getSycs(kssj, jssj, useSql, "1")); + // 访问人数 + map.put("fwrs", this.operLogMapper.getFwrs(kssj, jssj, useSql)); + return map; + } + + @Override + public List> bmStatistics(String type) { + UserInfo user = UserInfoManager.get(); + String aUseSql = PermissionsUtil.createSql("a", user); + String bUseSql = PermissionsUtil.createSql("b", user); + String kssj = null, jssj; + jssj = DateUtils.getTime(); + if ("1".equals(type)) { + kssj = DateUtils.getDate() + " 00:00:00"; + } else if ("2".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -8)); + } else if ("3".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -31)); + } else if ("4".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -90)); + } + return this.baseMapper.bmStatistics(kssj, jssj, aUseSql, bUseSql); + } + + @Override + public List> ryStatistics(String type) { + UserInfo user = UserInfoManager.get(); + String aUseSql = PermissionsUtil.createSql("a", user); + String bUseSql = PermissionsUtil.createSql("b", user); + String kssj = null, jssj; + jssj = DateUtils.getTime(); + if ("1".equals(type)) { + kssj = DateUtils.getDate() + " 00:00:00"; + } else if ("2".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -8)); + } else if ("3".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -31)); + } else if ("4".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -90)); + } + return this.baseMapper.ryStatistics(kssj, jssj, aUseSql, bUseSql); + } + + @Override + public List> mkStatistics(String type) { + UserInfo user = UserInfoManager.get(); + String aUseSql = PermissionsUtil.createSql("a", user); + String bUseSql = PermissionsUtil.createSql("b", user); + String kssj = null, jssj; + jssj = DateUtils.getTime(); + if ("1".equals(type)) { + kssj = DateUtils.getDate() + " 00:00:00"; + } else if ("2".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -8)); + } else if ("3".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -31)); + } else if ("4".equals(type)) { + kssj = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", + DateUtils.getNextDate(new Date(), "D", -90)); + } + return this.baseMapper.mkStatistics(kssj, jssj, aUseSql, bUseSql); + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/util/Convert.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/Convert.java new file mode 100644 index 0000000..a01e521 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/Convert.java @@ -0,0 +1,854 @@ +package com.mosty.operation.log.util; + +import org.apache.commons.lang3.ArrayUtils; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; + +/** + * 类型转换器 + * + * @author ruoyi + */ +public class Convert { + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) { + if (null == value) { + return defaultValue; + } + if (value instanceof String) { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) { + if (null == value) { + return defaultValue; + } + if (value instanceof Character) { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Byte) { + return (Byte) value; + } + if (value instanceof Number) { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Byte.parseByte(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Short) { + return (Short) value; + } + if (value instanceof Number) { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Short.parseShort(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Number) { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return NumberFormat.getInstance().parse(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Integer) { + return (Integer) value; + } + if (value instanceof Number) { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Integer.parseInt(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Integer[]{}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Long[]{}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Long) { + return (Long) value; + } + if (value instanceof Number) { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Double) { + return (Double) value; + } + if (value instanceof Number) { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Float) { + return (Float) value; + } + if (value instanceof Number) { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Float.parseFloat(valueStr.trim()); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof Boolean) { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) { + case "true": + return true; + case "false": + return false; + case "yes": + return true; + case "ok": + return true; + case "no": + return false; + case "1": + return true; + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) { + if (value == null) { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return Enum.valueOf(clazz, valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof BigInteger) { + return (BigInteger) value; + } + if (value instanceof Long) { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return new BigInteger(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) { + if (value == null) { + return defaultValue; + } + if (value instanceof BigDecimal) { + return (BigDecimal) value; + } + if (value instanceof Long) { + return new BigDecimal((Long) value); + } + if (value instanceof Double) { + return new BigDecimal((Double) value); + } + if (value instanceof Integer) { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) { + return defaultValue; + } + try { + return new BigDecimal(valueStr); + } catch (Exception e) { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ +// public static String utf8Str(Object obj) +// { +// return str(obj, CharsetKit.CHARSET_UTF_8); +// } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) { + if (null == obj) { + return null; + } + + if (obj instanceof String) { + return (String) obj; + } else if (obj instanceof byte[]) { + return str((byte[]) obj, charset); + } else if (obj instanceof Byte[]) { + byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); + return str(bytes, charset); + } else if (obj instanceof ByteBuffer) { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) { + if (data == null) { + return null; + } + + if (null == charset) { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) { + if (data == null) { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) { + if (null == charset) { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) { + char c[] = input.toCharArray(); + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') { + c[i] = '\u3000'; + } else if (c[i] < '\177') { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) { + char c[] = text.toCharArray(); + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') { + c[i] = ' '; + } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) { + String[] fraction = {"角", "分"}; + String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; + String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}}; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/util/ServletUtils.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/ServletUtils.java new file mode 100644 index 0000000..e83e0b4 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/ServletUtils.java @@ -0,0 +1,155 @@ +package com.mosty.operation.log.util; + +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +/** + * 客户端工具类 + * + * @author ruoyi + */ +public class ServletUtils { + /** + * 定义移动端请求的所有可能类型 + */ + private final static String[] agent = {"Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser"}; + + /** + * 获取String参数 + */ + public static String getParameter(String name) { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + * @return null + */ + public static String renderString(HttpServletResponse response, String string) { + try { + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().print(string); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) { + String accept = request.getHeader("accept"); + if (accept != null && accept.indexOf("application/json") != -1) { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { + return true; + } + + String ajax = request.getParameter("__ajax"); + if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) { + return true; + } + return false; + } + + /** + * 判断User-Agent 是不是来自于手机 + */ + public static boolean checkAgentIsMobile(String ua) { + boolean flag = false; + if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) { + // 排除 苹果桌面系统 + if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) { + for (String item : agent) { + if (ua.contains(item)) { + flag = true; + break; + } + } + } + } + return flag; + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/java/com/mosty/operation/log/util/StringUtils.java b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/StringUtils.java new file mode 100644 index 0000000..392b808 --- /dev/null +++ b/common-log-base-starter/src/main/java/com/mosty/operation/log/util/StringUtils.java @@ -0,0 +1,478 @@ +package com.mosty.operation.log.util; + +import org.springframework.util.AntPathMatcher; + +import java.util.*; + +/** + * 字符串工具类 + * + * @author ruoyi + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils { + /** + * 空字符串 + */ + private static final String NULLSTR = ""; + + /** + * 下划线 + */ + private static final char SEPARATOR = '_'; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + * * @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) { + if (str == null) { + return NULLSTR; + } + + if (start < 0) { + start = str.length() + start; + } + + if (start < 0) { + start = 0; + } + if (start > str.length()) { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) { + if (str == null) { + return NULLSTR; + } + + if (end < 0) { + end = str.length() + end; + } + if (start < 0) { + start = str.length() + start; + } + + if (end > str.length()) { + end = str.length(); + } + + if (start > end) { + return NULLSTR; + } + + if (start < 0) { + start = 0; + } + if (end < 0) { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ +// public static String format(String template, Object... params) +// { +// if (isEmpty(params) || isEmpty(template)) +// { +// return template; +// } +// return StrFormatter.format(template, params); +// } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ +// public static boolean ishttp(String link) +// { +// return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); +// } + + /** + * 字符串转set + * + * @param str 字符串 + * @param sep 分隔符 + * @return set集合 + */ + public static final Set str2Set(String str, String sep) { + return new HashSet(str2List(str, sep, true, false)); + } + + /** + * 字符串转list + * + * @param str 字符串 + * @param sep 分隔符 + * @param filterBlank 过滤纯空白 + * @param trim 去掉首尾空白 + * @return list集合 + */ + public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) { + List list = new ArrayList(); + if (StringUtils.isEmpty(str)) { + return list; + } + + // 过滤空白字符串 + if (filterBlank && StringUtils.isBlank(str)) { + return list; + } + String[] split = str.split(sep); + for (String string : split) { + if (filterBlank && StringUtils.isBlank(string)) { + continue; + } + if (trim) { + string = string.trim(); + } + list.add(string); + } + + return list; + } + + /** + * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 + * + * @param cs 指定字符串 + * @param searchCharSequences 需要检查的字符串数组 + * @return 是否包含任意一个字符串 + */ + public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { + if (isEmpty(cs) || isEmpty(searchCharSequences)) { + return false; + } + for (CharSequence testStr : searchCharSequences) { + if (containsIgnoreCase(cs, testStr)) { + return true; + } + } + return false; + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) { + if (str == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + if (i > 0) { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } else { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { + sb.append(SEPARATOR); + } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + if (str != null && strs != null) { + for (String s : strs) { + if (str.equalsIgnoreCase(trim(s))) { + return true; + } + } + } + return false; + } + + /** + * 删除最后一个字符串 + * + * @param str 输入字符串 + * @param spit 以什么类型结尾的 + * @return 截取后的字符串 + */ + public static String lastStringDel(String str, String spit) { + if (!StringUtils.isEmpty(str) && str.endsWith(spit)) { + return str.subSequence(0, str.length() - 1).toString(); + } + return str; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) { + // 没必要转换 + return ""; + } else if (!name.contains("_")) { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 + * 例如:user_name->userName + */ + public static String toCamelCase(String s) { + if (s == null) { + return null; + } + if (s.indexOf(SEPARATOR) == -1) { + return s; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + + if (c == SEPARATOR) { + upperCase = true; + } else if (upperCase) { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } else { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) { + return (T) obj; + } +} \ No newline at end of file diff --git a/common-log-base-starter/src/main/resources/META-INF/spring.factories b/common-log-base-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..9a1327a --- /dev/null +++ b/common-log-base-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.operation.log.OperationLogBaseAutoConfiguration \ No newline at end of file diff --git a/common-log-base-starter/target/classes/META-INF/spring.factories b/common-log-base-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..9a1327a --- /dev/null +++ b/common-log-base-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.operation.log.OperationLogBaseAutoConfiguration \ No newline at end of file diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController$1.class b/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController$1.class new file mode 100644 index 0000000..d104fa1 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController$1.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController.class b/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController.class new file mode 100644 index 0000000..bb35f19 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/BaseController.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/BusinessStatus.class b/common-log-base-starter/target/classes/com/mosty/operation/log/BusinessStatus.class new file mode 100644 index 0000000..a15c068 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/BusinessStatus.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/LogAspect.class b/common-log-base-starter/target/classes/com/mosty/operation/log/LogAspect.class new file mode 100644 index 0000000..c7d9152 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/LogAspect.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/LogSaveStrategy.class b/common-log-base-starter/target/classes/com/mosty/operation/log/LogSaveStrategy.class new file mode 100644 index 0000000..5294d89 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/LogSaveStrategy.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/OperationLogBaseAutoConfiguration.class b/common-log-base-starter/target/classes/com/mosty/operation/log/OperationLogBaseAutoConfiguration.class new file mode 100644 index 0000000..5961859 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/OperationLogBaseAutoConfiguration.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/controller/SysOperlogController.class b/common-log-base-starter/target/classes/com/mosty/operation/log/controller/SysOperlogController.class new file mode 100644 index 0000000..8f4b26e Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/controller/SysOperlogController.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/controller/provider/SysOperlogProviderController.class b/common-log-base-starter/target/classes/com/mosty/operation/log/controller/provider/SysOperlogProviderController.class new file mode 100644 index 0000000..9909215 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/controller/provider/SysOperlogProviderController.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/BaseEntity.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/BaseEntity.class new file mode 100644 index 0000000..29d1854 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/BaseEntity.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/DeleteListVO.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/DeleteListVO.class new file mode 100644 index 0000000..065b208 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/DeleteListVO.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Align.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Align.class new file mode 100644 index 0000000..76bbaee Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Align.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$ColumnType.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$ColumnType.class new file mode 100644 index 0000000..49e0e3b Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$ColumnType.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Type.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Type.class new file mode 100644 index 0000000..e203723 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel$Type.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel.class new file mode 100644 index 0000000..8724aef Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excel.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/ExcelHandlerAdapter.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/ExcelHandlerAdapter.class new file mode 100644 index 0000000..48af806 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/ExcelHandlerAdapter.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excels.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excels.class new file mode 100644 index 0000000..8cbf813 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/Excels.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/SysUser.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/SysUser.class new file mode 100644 index 0000000..f6ca663 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/SysUser.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/entity/VO/OperlogPage.class b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/VO/OperlogPage.class new file mode 100644 index 0000000..31d894e Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/entity/VO/OperlogPage.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/mapper/SysOperLogMapper.class b/common-log-base-starter/target/classes/com/mosty/operation/log/mapper/SysOperLogMapper.class new file mode 100644 index 0000000..8291d49 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/mapper/SysOperLogMapper.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/service/SysOperLogService.class b/common-log-base-starter/target/classes/com/mosty/operation/log/service/SysOperLogService.class new file mode 100644 index 0000000..d3a0ad3 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/service/SysOperLogService.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.class b/common-log-base-starter/target/classes/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.class new file mode 100644 index 0000000..cff9ec3 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/service/impl/SysOperLogServiceImpl.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/util/Convert.class b/common-log-base-starter/target/classes/com/mosty/operation/log/util/Convert.class new file mode 100644 index 0000000..5f7de31 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/util/Convert.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/util/ServletUtils.class b/common-log-base-starter/target/classes/com/mosty/operation/log/util/ServletUtils.class new file mode 100644 index 0000000..68aebf3 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/util/ServletUtils.class differ diff --git a/common-log-base-starter/target/classes/com/mosty/operation/log/util/StringUtils.class b/common-log-base-starter/target/classes/com/mosty/operation/log/util/StringUtils.class new file mode 100644 index 0000000..a08b7e1 Binary files /dev/null and b/common-log-base-starter/target/classes/com/mosty/operation/log/util/StringUtils.class differ diff --git a/common-log-base-starter/target/common-log-base-starter-1.0.0-SNAPSHOT.jar b/common-log-base-starter/target/common-log-base-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..ae5efd8 Binary files /dev/null and b/common-log-base-starter/target/common-log-base-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-log-base-starter/target/maven-archiver/pom.properties b/common-log-base-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..c8ed89d --- /dev/null +++ b/common-log-base-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:11 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-log-base-starter diff --git a/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..0cd5280 --- /dev/null +++ b/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,24 @@ +com\mosty\operation\log\BusinessStatus.class +com\mosty\operation\log\mapper\SysOperLogMapper.class +com\mosty\operation\log\util\StringUtils.class +com\mosty\operation\log\entity\DeleteListVO.class +com\mosty\operation\log\util\ServletUtils.class +com\mosty\operation\log\entity\Excels.class +com\mosty\operation\log\entity\VO\OperlogPage.class +com\mosty\operation\log\entity\SysUser.class +com\mosty\operation\log\entity\Excel$Type.class +com\mosty\operation\log\entity\Excel$ColumnType.class +com\mosty\operation\log\entity\BaseEntity.class +com\mosty\operation\log\controller\SysOperlogController.class +com\mosty\operation\log\entity\ExcelHandlerAdapter.class +com\mosty\operation\log\entity\Excel$Align.class +com\mosty\operation\log\controller\provider\SysOperlogProviderController.class +com\mosty\operation\log\OperationLogBaseAutoConfiguration.class +com\mosty\operation\log\BaseController.class +com\mosty\operation\log\service\impl\SysOperLogServiceImpl.class +com\mosty\operation\log\BaseController$1.class +com\mosty\operation\log\service\SysOperLogService.class +com\mosty\operation\log\LogAspect.class +com\mosty\operation\log\util\Convert.class +com\mosty\operation\log\entity\Excel.class +com\mosty\operation\log\LogSaveStrategy.class diff --git a/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..a31c541 --- /dev/null +++ b/common-log-base-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,20 @@ +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\service\impl\SysOperLogServiceImpl.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\LogSaveStrategy.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\util\ServletUtils.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\util\StringUtils.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\LogAspect.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\OperationLogBaseAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\BaseEntity.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\SysUser.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\DeleteListVO.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\Excel.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\Excels.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\VO\OperlogPage.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\BusinessStatus.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\util\Convert.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\entity\ExcelHandlerAdapter.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\mapper\SysOperLogMapper.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\controller\SysOperlogController.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\service\SysOperLogService.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\BaseController.java +C:\tools\dy外网\mosty-common\common-log-base-starter\src\main\java\com\mosty\operation\log\controller\provider\SysOperlogProviderController.java diff --git a/common-magic-api-starter/common-magic-api-starter.iml b/common-magic-api-starter/common-magic-api-starter.iml new file mode 100644 index 0000000..4a33f39 --- /dev/null +++ b/common-magic-api-starter/common-magic-api-starter.iml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-magic-api-starter/pom.xml b/common-magic-api-starter/pom.xml new file mode 100644 index 0000000..091070c --- /dev/null +++ b/common-magic-api-starter/pom.xml @@ -0,0 +1,38 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-magic-api-starter + + + 8 + 8 + + + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + + org.ssssssss + magic-api-spring-boot-starter + 2.0.1 + + + org.ssssssss + magic-api-plugin-swagger + 2.0.1 + + + + \ No newline at end of file diff --git a/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/MagicApiAutoConfiguration.java b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/MagicApiAutoConfiguration.java new file mode 100644 index 0000000..bf73fb7 --- /dev/null +++ b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/MagicApiAutoConfiguration.java @@ -0,0 +1,15 @@ +package com.mosty.common.magic.api; + +import org.springframework.context.annotation.Configuration; + +/** + * 自动装配启动类型 + * @author kevin + * @date 2022/2/3 7:28 PM + * @since 1.0.0 + */ +@Configuration +@SuppressWarnings("unused") +public class MagicApiAutoConfiguration { + +} diff --git a/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/CustomJsonValueProvider.java b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/CustomJsonValueProvider.java new file mode 100644 index 0000000..6af9c0d --- /dev/null +++ b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/CustomJsonValueProvider.java @@ -0,0 +1,60 @@ +package com.mosty.common.magic.api.config; + +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; +import org.ssssssss.magicapi.core.context.RequestEntity; +import org.ssssssss.magicapi.core.interceptor.ResultProvider; + +/** + * magic 全局结果包装 + * @author kevin + * @date 2022/5/29 6:06 下午 + * @since 1.0.0 + * @see ResponseResult + * @see com.mosty.common.base.exception.MostyExceptionHandler + */ +@Slf4j +@Component +@Qualifier("globalResultHandler") +public class CustomJsonValueProvider implements ResultProvider { + /** + * 定义返回结果,默认返回JsonBean + */ + @Override + public Object buildResult(RequestEntity requestEntity, int code, String message, Object data) { + // 如果对分页格式有要求的话,可以对data的类型进行判断,进而返回不同的格式 + return new ResponseResult(code, message, data); + } + + @Override + public Object buildException(RequestEntity requestEntity, Throwable throwable) { + throwable.printStackTrace(); + log.warn("业务异常:message={}", throwable.getMessage()); + Throwable cause = throwable.getCause(); + if (cause instanceof BusinessException) { + BusinessException businessException = (BusinessException) cause; + return businessException.getCode() != null ? + ResponseResult.fail(businessException.getCode(), businessException.getMessage()) : + ResponseResult.fail(businessException.getMessage()); + } + + return ResponseResult.fail(500, "系统异常,请稍后重试"); + } + + /** + * 定义分页返回结果,该项会被封装在Json结果内, + * 此方法可以不覆盖,默认返回PageResult + */ +// @Override +// public Object buildPageResult(RequestEntity requestEntity, Page page, long total, List> data) { +// return new HashMap(){ +// { +// put("total", total); +// put("list", data); +// } +// }; +// } +} \ No newline at end of file diff --git a/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/TokenParseInterceptor.java b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/TokenParseInterceptor.java new file mode 100644 index 0000000..712d077 --- /dev/null +++ b/common-magic-api-starter/src/main/java/com/mosty/common/magic/api/config/TokenParseInterceptor.java @@ -0,0 +1,46 @@ +package com.mosty.common.magic.api.config; + +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.ssssssss.magicapi.core.interceptor.RequestInterceptor; +import org.ssssssss.magicapi.core.model.ApiInfo; +import org.ssssssss.script.MagicScriptContext; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * 泛解析jwt 信息,实现类似 {@code JwtSysUser} 的效果 + */ +@Component +@Order(1) //拦截器顺序,可选 +public class TokenParseInterceptor implements RequestInterceptor { + + /* + * 当返回对象时,直接将此对象返回到页面,返回null时,继续执行后续操作 + */ + @Override + public Object preHandle(ApiInfo info, MagicScriptContext context, HttpServletRequest request, HttpServletResponse response) { + System.out.println("请求前:" + info.getPath()); + // 拦截请求并直接返回结果,不继续后续代码 + // 需要注意的是,拦截器返回的结果不会被包裹一层json值,也不会走ResultProvider + // return new JsonBean<>(100,"拦截器返回"); + // 放开请求,执行后续代码 + return null; + } + /** + * 执行完毕之后执行 + * @param value 即将要返回到页面的值 + * @return 返回到页面的对象,当返回null时执行后续拦截器,否则直接返回该值,不执行后续拦截器 + */ + @Override + public Object postHandle(ApiInfo info, MagicScriptContext context, Object value, HttpServletRequest request, HttpServletResponse response) { + System.out.println("请求后:" + info.getPath()); + System.out.println("返回结果:" + value); + // 拦截请求并直接返回结果,不继续后续代码 + // 需要注意的是,拦截器返回的结果不会被包裹一层json值,也不会走ResultProvider + // return new JsonBean<>(100,"拦截器返回"); + // 放开请求,执行后续代码 + return null; + } +} \ No newline at end of file diff --git a/common-magic-api-starter/src/main/resources/META-INF/spring.factories b/common-magic-api-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..541f2f5 --- /dev/null +++ b/common-magic-api-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,4 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.magic.api.MagicApiAutoConfiguration,\ +com.mosty.common.magic.api.config.CustomJsonValueProvider,\ +com.mosty.common.magic.api.config.TokenParseInterceptor \ No newline at end of file diff --git a/common-magic-api-starter/target/classes/META-INF/spring.factories b/common-magic-api-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..541f2f5 --- /dev/null +++ b/common-magic-api-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,4 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.magic.api.MagicApiAutoConfiguration,\ +com.mosty.common.magic.api.config.CustomJsonValueProvider,\ +com.mosty.common.magic.api.config.TokenParseInterceptor \ No newline at end of file diff --git a/common-magic-api-starter/target/classes/com/mosty/common/magic/api/MagicApiAutoConfiguration.class b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/MagicApiAutoConfiguration.class new file mode 100644 index 0000000..19cff8c Binary files /dev/null and b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/MagicApiAutoConfiguration.class differ diff --git a/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/CustomJsonValueProvider.class b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/CustomJsonValueProvider.class new file mode 100644 index 0000000..8163e46 Binary files /dev/null and b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/CustomJsonValueProvider.class differ diff --git a/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/TokenParseInterceptor.class b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/TokenParseInterceptor.class new file mode 100644 index 0000000..888138e Binary files /dev/null and b/common-magic-api-starter/target/classes/com/mosty/common/magic/api/config/TokenParseInterceptor.class differ diff --git a/common-magic-api-starter/target/common-magic-api-starter-1.0.0-SNAPSHOT.jar b/common-magic-api-starter/target/common-magic-api-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..973a2c7 Binary files /dev/null and b/common-magic-api-starter/target/common-magic-api-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-magic-api-starter/target/maven-archiver/pom.properties b/common-magic-api-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..ad27fa6 --- /dev/null +++ b/common-magic-api-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:24 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-magic-api-starter diff --git a/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..61d01e3 --- /dev/null +++ b/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\mosty\common\magic\api\config\CustomJsonValueProvider.class +com\mosty\common\magic\api\config\TokenParseInterceptor.class +com\mosty\common\magic\api\MagicApiAutoConfiguration.class diff --git a/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..492ffe4 --- /dev/null +++ b/common-magic-api-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\tools\dy外网\mosty-common\common-magic-api-starter\src\main\java\com\mosty\common\magic\api\config\TokenParseInterceptor.java +C:\tools\dy外网\mosty-common\common-magic-api-starter\src\main\java\com\mosty\common\magic\api\MagicApiAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-magic-api-starter\src\main\java\com\mosty\common\magic\api\config\CustomJsonValueProvider.java diff --git a/common-redis-starter/common-redis-starter.iml b/common-redis-starter/common-redis-starter.iml new file mode 100644 index 0000000..367c443 --- /dev/null +++ b/common-redis-starter/common-redis-starter.iml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-redis-starter/pom.xml b/common-redis-starter/pom.xml new file mode 100644 index 0000000..a582c6e --- /dev/null +++ b/common-redis-starter/pom.xml @@ -0,0 +1,69 @@ + + + + com.mosty + mosty-common + 1.0.0-SNAPSHOT + + 4.0.0 + + common-redis-starter + + + common-redis-starter缓存服务 + + + + + + + org.springframework.boot + spring-boot-starter-data-redis + ${starter-data-redis.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + true + + + com.alibaba + fastjson + ${fastjson.version} + true + + + + + + mosty-nexus-releases + release version + http://47.108.232.77:8181/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://47.108.232.77:8181/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-compiler-plugin + + 6 + 6 + + + + + \ No newline at end of file diff --git a/common-redis-starter/src/main/java/com/mosty/common/redis/RedisAutoConfiguration.java b/common-redis-starter/src/main/java/com/mosty/common/redis/RedisAutoConfiguration.java new file mode 100644 index 0000000..0da5998 --- /dev/null +++ b/common-redis-starter/src/main/java/com/mosty/common/redis/RedisAutoConfiguration.java @@ -0,0 +1,17 @@ +package com.mosty.common.redis; + +import com.mosty.common.redis.configure.RedisConfig; +import com.mosty.common.redis.service.RedisService; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +/** + * 代码生成自动装配 + * @author kevin + * @date 2022/2/3 3:34 PM + * @since 1.0.0 + */ +@Configuration +@Import({RedisService.class, RedisConfig.class}) +public class RedisAutoConfiguration { +} diff --git a/common-redis-starter/src/main/java/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.java b/common-redis-starter/src/main/java/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.java new file mode 100644 index 0000000..e2ba7e7 --- /dev/null +++ b/common-redis-starter/src/main/java/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.java @@ -0,0 +1,64 @@ +package com.mosty.common.redis.configure; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import org.springframework.util.Assert; + +import java.nio.charset.Charset; + +/** + * Redis使用FastJson序列化 + * + * @author ruoyi + */ +public class FastJson2JsonRedisSerializer implements RedisSerializer { + + @SuppressWarnings("unused") + private ObjectMapper objectMapper = new ObjectMapper(); + + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + + private Class clazz; + + static { + ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + } + + public FastJson2JsonRedisSerializer(Class clazz) { + super(); + this.clazz = clazz; + } + + @Override + public byte[] serialize(T t) throws SerializationException { + if (t == null) { + return new byte[0]; + } + return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET); + } + + @Override + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes == null || bytes.length <= 0) { + return null; + } + String str = new String(bytes, DEFAULT_CHARSET); + + return JSON.parseObject(str, clazz); + } + + public void setObjectMapper(ObjectMapper objectMapper) { + Assert.notNull(objectMapper, "'objectMapper' must not be null"); + this.objectMapper = objectMapper; + } + + protected JavaType getJavaType(Class clazz) { + return TypeFactory.defaultInstance().constructType(clazz); + } +} diff --git a/common-redis-starter/src/main/java/com/mosty/common/redis/configure/RedisConfig.java b/common-redis-starter/src/main/java/com/mosty/common/redis/configure/RedisConfig.java new file mode 100644 index 0000000..450d6a5 --- /dev/null +++ b/common-redis-starter/src/main/java/com/mosty/common/redis/configure/RedisConfig.java @@ -0,0 +1,48 @@ +package com.mosty.common.redis.configure; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * redis配置 + * + * @author ruoyi + */ +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport { + @Bean + @SuppressWarnings(value = {"unchecked", "rawtypes"}) + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); + + ObjectMapper mapper = new ObjectMapper(); + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY); + serializer.setObjectMapper(mapper); + + // 使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(serializer); + + // Hash的key也采用StringRedisSerializer的序列化方式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(serializer); + + template.afterPropertiesSet(); + return template; + } +} diff --git a/common-redis-starter/src/main/java/com/mosty/common/redis/service/RedisService.java b/common-redis-starter/src/main/java/com/mosty/common/redis/service/RedisService.java new file mode 100644 index 0000000..4cb24fa --- /dev/null +++ b/common-redis-starter/src/main/java/com/mosty/common/redis/service/RedisService.java @@ -0,0 +1,232 @@ +package com.mosty.common.redis.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +/** + * spring redis 工具类 + * + * @author ruoyi + **/ +@SuppressWarnings(value = {"unchecked", "rawtypes"}) +@Component +public class RedisService { + @Autowired + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setCacheObject(final String key, final T value) { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit) { + redisTemplate.opsForValue().set(key, value, timeout, timeUnit); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout) { + return expire(key, timeout, TimeUnit.SECONDS); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @param unit 时间单位 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout, final TimeUnit unit) { + return redisTemplate.expire(key, timeout, unit); + } + + /** + * 获取有效时间 + * + * @param key Redis键 + * @return 有效时间 + */ + public long getExpire(final String key) { + return redisTemplate.getExpire(key); + } + + /** + * 判断 key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(final String key) { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public boolean deleteObject(final String key) { + return redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + * @return + */ + public long deleteObject(final Collection collection) { + return redisTemplate.delete(collection); + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public long setCacheList(final String key, final List dataList) { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + return count == null ? 0 : count; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(final String key) { + return redisTemplate.opsForList().range(key, 0, -1); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(final String key) { + return redisTemplate.opsForSet().members(key); + } + + /** + * 缓存Map + * + * @param key + * @param dataMap + */ + public void setCacheMap(final String key, final Map dataMap) { + if (dataMap != null) { + redisTemplate.opsForHash().putAll(key, dataMap); + } + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(final String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public void setCacheMapValue(final String key, final String hKey, final T value) { + redisTemplate.opsForHash().put(key, hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public T getCacheMapValue(final String key, final String hKey) { + HashOperations opsForHash = redisTemplate.opsForHash(); + return opsForHash.get(key, hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public List getMultiCacheMapValue(final String key, final Collection hKeys) { + return redisTemplate.opsForHash().multiGet(key, hKeys); + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(final String pattern) { + return redisTemplate.keys(pattern); + } +} diff --git a/common-redis-starter/src/main/resources/META-INF/spring.factories b/common-redis-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..f90f55a --- /dev/null +++ b/common-redis-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,4 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.redis.RedisAutoConfiguration + + diff --git a/common-redis-starter/target/classes/META-INF/spring.factories b/common-redis-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..f90f55a --- /dev/null +++ b/common-redis-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,4 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.redis.RedisAutoConfiguration + + diff --git a/common-redis-starter/target/classes/com/mosty/common/redis/RedisAutoConfiguration.class b/common-redis-starter/target/classes/com/mosty/common/redis/RedisAutoConfiguration.class new file mode 100644 index 0000000..06c6a8c Binary files /dev/null and b/common-redis-starter/target/classes/com/mosty/common/redis/RedisAutoConfiguration.class differ diff --git a/common-redis-starter/target/classes/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.class b/common-redis-starter/target/classes/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.class new file mode 100644 index 0000000..916ebd8 Binary files /dev/null and b/common-redis-starter/target/classes/com/mosty/common/redis/configure/FastJson2JsonRedisSerializer.class differ diff --git a/common-redis-starter/target/classes/com/mosty/common/redis/configure/RedisConfig.class b/common-redis-starter/target/classes/com/mosty/common/redis/configure/RedisConfig.class new file mode 100644 index 0000000..f4787c3 Binary files /dev/null and b/common-redis-starter/target/classes/com/mosty/common/redis/configure/RedisConfig.class differ diff --git a/common-redis-starter/target/classes/com/mosty/common/redis/service/RedisService.class b/common-redis-starter/target/classes/com/mosty/common/redis/service/RedisService.class new file mode 100644 index 0000000..77be5d9 Binary files /dev/null and b/common-redis-starter/target/classes/com/mosty/common/redis/service/RedisService.class differ diff --git a/common-redis-starter/target/common-redis-starter-1.0.0-SNAPSHOT.jar b/common-redis-starter/target/common-redis-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..1615cc9 Binary files /dev/null and b/common-redis-starter/target/common-redis-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-redis-starter/target/maven-archiver/pom.properties b/common-redis-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..36408be --- /dev/null +++ b/common-redis-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:03 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-redis-starter diff --git a/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..0ad910d --- /dev/null +++ b/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +com\mosty\common\redis\configure\FastJson2JsonRedisSerializer.class +com\mosty\common\redis\service\RedisService.class +com\mosty\common\redis\RedisAutoConfiguration.class +com\mosty\common\redis\configure\RedisConfig.class diff --git a/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..72f17f1 --- /dev/null +++ b/common-redis-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,4 @@ +C:\tools\dy外网\mosty-common\common-redis-starter\src\main\java\com\mosty\common\redis\RedisAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-redis-starter\src\main\java\com\mosty\common\redis\service\RedisService.java +C:\tools\dy外网\mosty-common\common-redis-starter\src\main\java\com\mosty\common\redis\configure\RedisConfig.java +C:\tools\dy外网\mosty-common\common-redis-starter\src\main\java\com\mosty\common\redis\configure\FastJson2JsonRedisSerializer.java diff --git a/common-task-starter/common-task-starter.iml b/common-task-starter/common-task-starter.iml new file mode 100644 index 0000000..645e8cf --- /dev/null +++ b/common-task-starter/common-task-starter.iml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-task-starter/pom.xml b/common-task-starter/pom.xml new file mode 100644 index 0000000..34e0196 --- /dev/null +++ b/common-task-starter/pom.xml @@ -0,0 +1,116 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-task-starter + 1.0.0-SNAPSHOT + + + 8 + 8 + + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + true + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.2.0 + + + org.springframework.boot + spring-boot-starter-aop + ${spring-boot-dependencies.version} + true + + + + org.springframework.boot + spring-boot-starter-validation + ${spring-boot-dependencies.version} + + + com.alibaba + fastjson + ${fastjson.version} + + + org.apache.commons + commons-lang3 + 3.12.0 + + + com.google.guava + guava + 29.0-jre + + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + com.mosty + common-core-starter + 1.0.0-SNAPSHOT + + + com.mosty + common-redis-starter + 1.0.0-SNAPSHOT + + + + com.mosty + common-token-starter + 1.0.0-SNAPSHOT + + + + org.projectlombok + lombok + 1.16.18 + provided + + + org.apache.shiro + shiro-core + ${shiro.version} + + + + + + mosty-nexus-releases + release version + http://47.108.232.77:8181/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://47.108.232.77:8181/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + \ No newline at end of file diff --git a/common-task-starter/src/main/java/com/mosty/common/task/TaskAutoConfiguration.java b/common-task-starter/src/main/java/com/mosty/common/task/TaskAutoConfiguration.java new file mode 100644 index 0000000..31c068f --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/TaskAutoConfiguration.java @@ -0,0 +1,16 @@ +package com.mosty.common.task; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Configuration; + +/** + * + * @author kevin + * @date 2022/2/3 7:28 PM + * @since 1.0.0 + */ +@Configuration +@MapperScan("com.mosty.common.task.mapper") +public class TaskAutoConfiguration { + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteStatusEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteStatusEnum.java new file mode 100644 index 0000000..c8ebc88 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteStatusEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行状态 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum ExecuteStatusEnum { + + /** 1。未完成 */ + UNFINISH(1, "未完成"), + + /** 2。已执行 */ + FINISH(2, "已完成"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteTypeEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteTypeEnum.java new file mode 100644 index 0000000..ab1a4bc --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/ExecuteTypeEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行类型 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum ExecuteTypeEnum { + + /** 1用户 */ + USER(1, "用户"), + + /** 2。部门 */ + DEPT(2, "部门"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/GroupCountTypeEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/GroupCountTypeEnum.java new file mode 100644 index 0000000..2a4b73d --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/GroupCountTypeEnum.java @@ -0,0 +1,32 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行类型 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum GroupCountTypeEnum { + + /** 1。今天 */ + TODAY(1, "今天"), + + /** 2。七天 */ + WEEK(2, "七天"), + + + /** 3。30天 */ + MONTH(3, "30天"), + /** 4。全部 */ + ALL(4, "全部"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/LineChartTypeEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/LineChartTypeEnum.java new file mode 100644 index 0000000..20aa39b --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/LineChartTypeEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 折线图类型 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum LineChartTypeEnum { + + /** 1 日 */ + DAY(1, "日"), + + /** 2 月 */ + MONTH(2, "月"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/RuleTypeEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/RuleTypeEnum.java new file mode 100644 index 0000000..925f953 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/RuleTypeEnum.java @@ -0,0 +1,26 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行类型 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum RuleTypeEnum { + + /** 1 单人 */ + ONE(1, "单人"), + + /** 2 多人 */ + MORE(2, "多人"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskItemStatusEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskItemStatusEnum.java new file mode 100644 index 0000000..547990f --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskItemStatusEnum.java @@ -0,0 +1,28 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行类型 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum TaskItemStatusEnum { + + /** 0未查看 */ + NOTVIEWED(0, "未查看"), + + /** 1。已查看 */ + VIEWED(1, "已查看"), + /** 2。完成 */ + FINISH(2, "完成"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskLogStatusEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskLogStatusEnum.java new file mode 100644 index 0000000..86b980a --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskLogStatusEnum.java @@ -0,0 +1,43 @@ +package com.mosty.common.task.constant.enums; + +import lombok.AllArgsConstructor; + +/** + * 执行状态 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum TaskLogStatusEnum { + + /** 0未查看 */ + NOTVIEWED(0, "下发"), + + /** 1。已查看 */ + VIEWED(1, "查看"), + /** 2。完成 */ + FINISH(2, "完成"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + /** + * 根据编码匹配菜单类型 + * @param code 编码 + * @return 菜单类型枚举 + */ + public static TaskLogStatusEnum valueOf(Integer code) { + if (code == null) { + return null; + } + for (TaskLogStatusEnum taskTypeEnum : TaskLogStatusEnum.values()) { + if (taskTypeEnum.code.equals(code)) { + return taskTypeEnum; + } + } + return null; + } +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskTypeEnum.java b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskTypeEnum.java new file mode 100644 index 0000000..3769b74 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/constant/enums/TaskTypeEnum.java @@ -0,0 +1,42 @@ +package com.mosty.common.task.constant.enums; + +import com.mosty.common.base.constant.enums.MenuTypeEnum; +import lombok.AllArgsConstructor; +import org.jetbrains.annotations.Contract; + +/** + * 执行状态 + * @author liyan + * @date 2022/2/16 11:06 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum TaskTypeEnum { + + /** 1。核实任务 */ + VERIFY("1", "核实任务"), + + /** 2。预警指令 */ + EARLY("2", "预警指令"), + OTHER("3", "其他") + ; + + /** 编码 */ + public final String code; + + /** 描述 */ + public final String desc; + /** + * 根据编码匹配菜单类型 + * @param code 编码 + * @return 菜单类型枚举 + */ + public static TaskTypeEnum getEnum(String code) { + for (TaskTypeEnum taskTypeEnum : TaskTypeEnum.values()) { + if (taskTypeEnum.code.equals(code)) { + return taskTypeEnum; + } + } + return TaskTypeEnum.OTHER; + } +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskController.java b/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskController.java new file mode 100644 index 0000000..992f3be --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskController.java @@ -0,0 +1,110 @@ +package com.mosty.common.task.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.task.entity.SysTask; +import com.mosty.common.task.entity.vo.*; +import com.mosty.common.task.service.SysTaskService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@SuppressWarnings("unused") +@RestController +@CrossOrigin +@AllArgsConstructor +@RequestMapping("/sysTask") +@Api(tags = "任务接口") +public class SysTaskController { + @Resource + private SysTaskService sysTaskService; + + /** + * 添加任务并下发 + * @param addSysTaskVO 添加任务并下发 + * @return 添加结果 + */ + @PostMapping("addSysTask") + @ApiOperation(value = "添加任务并下发", httpMethod = "POST", response = Boolean.class) + @Log(title = "添加任务并下发",businessType = BusinessType.INSERT) + public ResponseResult addSysTask(@RequestBody @Valid AddSysTaskVO addSysTaskVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysTaskService.saveInfo(addSysTaskVO,ipAddress); + return ResponseResult.success(Boolean.TRUE); + } + + /** + * 查看回调 + * @return 添加结果 + */ + @PostMapping("detail") + @ApiOperation(value = "查看回调", httpMethod = "POST", response = SysTask.class) + @Log(title = "查看回调",businessType = BusinessType.UPDATE) + public ResponseResult detail(@RequestBody DetailSysTaskVO detailSysTaskVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + SysTask task= sysTaskService.detail(detailSysTaskVO,ipAddress); + return ResponseResult.success(task); + } + + /** + * 完成回调 + * @return 添加结果 + */ + @PostMapping("finish") + @ApiOperation(value = "完成回调", httpMethod = "POST", response = Boolean.class) + @Log(title = "完成回调",businessType = BusinessType.UPDATE) + public ResponseResult finish(@RequestBody FinishSysTaskVO finishSysTaskVO, HttpServletRequest servletRequest) { + String ipAddress = IpUtil.getIpAddress(servletRequest); + sysTaskService.finish(finishSysTaskVO,ipAddress); + return ResponseResult.success(true); + } + + /** + * 查询当前登陆用户的任务 + * @return 当前登陆用户的任务 + */ + @PostMapping("findByList") + @ApiOperation(value = "查询当前登陆用户的任务", httpMethod = "POST", response = SysTaskItemVO.class) + public ResponseResult> findByList(@RequestBody QueryTaskVO queryTaskVO, HttpServletRequest servletRequest) { + IPage page = sysTaskService.findByList(queryTaskVO); + return ResponseResult.success(page); + } + + + + /** + * 查询当前登陆用户的任务日志 + * @return 当前登陆用户的任务 + */ + @PostMapping("findLogByList") + @ApiOperation(value = "查询当前登陆用户的任务日志", httpMethod = "POST", response = SysTaskLogVO.class) + public ResponseResult> findLogByList(@RequestBody QueryTaskLogVO queryTaskLogVO, HttpServletRequest servletRequest) { + List page = sysTaskService.findLogByList(queryTaskLogVO); + return ResponseResult.success(page); + } + /** + * 查询任务数量 + * @return 查询任务数量 + */ + @PostMapping("countByQuery") + @ApiOperation(value = "查询任务数量", httpMethod = "POST", response = Long.class) + public ResponseResult countByQuery(@RequestBody QueryTaskVO queryTaskVO, HttpServletRequest servletRequest) { + Long count = sysTaskService.countByQuery(queryTaskVO); + return ResponseResult.success(count); + } + + + + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskReportController.java b/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskReportController.java new file mode 100644 index 0000000..f4a2d54 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/controller/SysTaskReportController.java @@ -0,0 +1,84 @@ +package com.mosty.common.task.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.base.domain.ResponseResult; +import com.mosty.common.base.entity.log.BusinessType; +import com.mosty.common.base.entity.log.Log; +import com.mosty.common.base.util.IpUtil; +import com.mosty.common.task.entity.SysTask; +import com.mosty.common.task.entity.vo.*; +import com.mosty.common.task.service.SysTaskService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +@Slf4j +@SuppressWarnings("unused") +@RestController +@AllArgsConstructor +@CrossOrigin +@RequestMapping("/sysTaskReport") +@Api(tags = "任务数量报表接口") +public class SysTaskReportController { + @Resource + private SysTaskService sysTaskService; + + /** + * 查询今日数据 + * @param + * @return 添加结果 + */ + @PostMapping("todayCount") + @ApiOperation(value = "查询今日统计数据", httpMethod = "POST", response = SysTaskCountToday.class) + public ResponseResult todayCount() { + SysTaskCountToday today= sysTaskService.todayCount(); + return ResponseResult.success(today); + } + + /** + * 查询全部统计数据 + * @param + * @return 添加结果 + */ + @PostMapping("allCount") + @ApiOperation(value = "查询全部统计数据", httpMethod = "POST", response = SysTaskCountToday.class) + public ResponseResult allCount() { + SysTaskCountToday today= sysTaskService.allCount(); + return ResponseResult.success(today); + } + + /** + * 查询分类条数 + * @param + * @return 添加结果 + */ + @PostMapping("groupCount/{countType}") + @ApiOperation(value = "查询全部统计数据 1.今日 2.七日 3。 30天 4。 全部。", httpMethod = "POST", response = SysTaskCountGroup.class) + public ResponseResult> groupCount(@PathVariable("countType") Integer countType) { + List groups = sysTaskService.groupCount(countType); + return ResponseResult.success(groups); + } + + /** + * 查询折线图数据 + * @param + * @return 添加结果 + */ + @PostMapping("lineChart/{lineChartType}") + @ApiOperation(value = "查询折线图数据 1 按日统计 2 按月统计", httpMethod = "POST", response = SysTaskLineChartVO.class) + public ResponseResult> lineChart(@PathVariable("lineChartType") Integer lineChartType) { + List lineCharts= sysTaskService.lineChart(lineChartType); + return ResponseResult.success(lineCharts); + } + + + + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTask.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTask.java new file mode 100644 index 0000000..f52747e --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTask.java @@ -0,0 +1,261 @@ +package com.mosty.common.task.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 任务表 + * @TableName sys_task + */ +@TableName(value ="sys_task") +@Data +public class SysTask implements Serializable { + /** + * id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 任务类型 + */ + @TableField(value = "rwlx") + private String rwlx; + + /** + * 执行类型 + */ + @TableField(value = "zxlx") + private Integer zxlx; + + /** + * 任务紧急程度 + */ + @TableField(value = "rwjjcd") + private String rwjjcd; + + /** + * 任务名称 + */ + @TableField(value = "rwmc") + private String rwmc; + + /** + * 任务内容 + */ + @TableField(value = "rwnr") + private String rwnr; + + /** + * 任务制定时间 + */ + @TableField(value = "rwzdsj") + private LocalDateTime rwzdsj; + + /** + * 任务完成时间 + */ + @TableField(value = "rwwcsj") + private LocalDateTime rwwcsj; + + /** + * 任务要求完成时间 + */ + @TableField(value = "rwyqwcsj") + private LocalDateTime rwyqwcsj; + + /** + * 任务创建人身份证号 + */ + @TableField(value = "rwcjrsfzh") + private String rwcjrsfzh; + + /** + * 任务创建人姓名 + */ + @TableField(value = "rwcjrxm") + private String rwcjrxm; + + /** + * 任务创建人单位 + */ + @TableField(value = "rwcjrdw") + private String rwcjrdw; + + /** + * 任务创建人部门id + */ + @TableField(value = "rwcjrbm_id") + private Long rwcjrbmId; + + /** + * 任务创建人部门名称 + */ + @TableField(value = "rwcjrbmmc") + private String rwcjrbmmc; + + /** + * 任务创建人单位id + */ + @TableField(value = "rwcjrdw_id") + private Long rwcjrdwId; + + + /** + * 任务创建人电话 + */ + @TableField(value = "rwcjrdh") + private String rwcjrdh; + + /** + * 任务创建规则 1.单人任务 2.多人任务 + */ + @TableField(value = "rwcjrgz") + private Integer rwcjrgz; + + /** + * 任务执行状态 1,未完成 2.已完成 + */ + @TableField(value = "rwzxzt") + private Integer rwzxzt; + + /** + * 任务来源系统 + */ + @TableField(value = "rwlyxt") + private String rwlyxt; + + /** + * 任务来源id + */ + @TableField(value = "rwly_id") + private String rwlyId; + + /** + * 任务url + */ + @TableField(value = "rw_url") + private String rwUrl; + + /** + * 任务终端 + */ + @TableField(value = "rwzd") + private String rwzd; + + + /** + * 应用id + */ + @TableField(value = "yy_id") + private Long yyId; + + /** + * 备注 + */ + @TableField(value = "bz") + private String bz; + + /** + * 注销标志0正常 1.注销 + */ + @TableField(value = "xt_zxbz") + private Integer xtZxbz; + + /** + * 注销原因 + */ + @TableField(value = "xt_zxyy") + private String xtZxyy; + + /** + * 采集时间 + */ + @TableField(value = "xt_cjsj") + private LocalDateTime xtCjsj; + + /** + * 录入时间 + */ + @TableField(value = "xt_lrsj") + private LocalDateTime xtLrsj; + + /** + * 录入人姓名 + */ + @TableField(value = "xt_lrrxm") + private String xtLrrxm; + + /** + * 录入人id + */ + @TableField(value = "xt_lrrid") + private Long xtLrrid; + + /** + * 录入人部门 + */ + @TableField(value = "xt_lrrbm") + private String xtLrrbm; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrrbmid") + private Long xtLrrbmid; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrip") + private String xtLrip; + + /** + * 最后修改时间 + */ + @TableField(value = "xt_zhxgsj") + private LocalDateTime xtZhxgsj; + + /** + * 最后修改人姓名 + */ + @TableField(value = "xt_zhxgrxm") + private String xtZhxgrxm; + + /** + * 最后修改人id + */ + @TableField(value = "xt_zhxgid") + private Long xtZhxgid; + + /** + * 最后修改人部门 + */ + @TableField(value = "xt_zhxgrbm") + private String xtZhxgrbm; + + /** + * 最后修改人部门id + */ + @TableField(value = "xt_zhxgrbmid") + private Long xtZhxgrbmid; + + /** + * 最后修改人ip + */ + @TableField(value = "xt_zhxgrip") + private String xtZhxgrip; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + +} \ No newline at end of file diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskItem.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskItem.java new file mode 100644 index 0000000..9196758 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskItem.java @@ -0,0 +1,200 @@ +package com.mosty.common.task.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * 任务下发表 + * @TableName sys_task_item + */ +@TableName(value ="sys_task_item") +@Data +public class SysTaskItem implements Serializable { + /** + * 主键id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 任务id + */ + @TableField(value = "rw_id") + private Long rwId; + + /** + * 任务接受人id + */ + @TableField(value = "rwjsr_id") + private Long rwjsrId; + + /** + * 任务接受人身份证号 + */ + @TableField(value = "rwjsrsfzh") + private String rwjsrsfzh; + + /** + * 任务接受人姓名 + */ + @TableField(value = "rwjsrxm") + private String rwjsrxm; + + /** + * 任务接受人单位id + */ + @TableField(value = "rwjsrdw_id") + private Long rwjsrdwId; + + /** + * 任务接受人单位 + */ + @TableField(value = "rwjsrdw") + private String rwjsrdw; + + /** + * 任务接受人部门id + */ + @TableField(value = "rwjsrbm_id") + private Long rwjsrbmId; + + /** + * 任务接受人部门名称 + */ + @TableField(value = "rwjsrbmmc") + private String rwjsrbmmc; + + /** + * 任务状态 0.未查看 1.已查看 2.已完成 + */ + @TableField(value = "rwzt") + private Integer rwzt; + + /** + * 任务制定时间 + */ + @TableField(value = "rwzdsj") + private LocalDateTime rwzdsj; + + /** + * 任务查看时间 + */ + @TableField(value = "rwcksj") + private LocalDateTime rwcksj; + + /** + * 任务完成时间 + */ + @TableField(value = "rwwcsj") + private LocalDateTime rwwcsj; + + /** + * 备注 + */ + @TableField(value = "bz") + private String bz; + + /** + * 注销标志0正常 1.注销 + */ + @TableField(value = "xt_zxbz") + private Integer xtZxbz; + + /** + * 注销原因 + */ + @TableField(value = "xt_zxyy") + private String xtZxyy; + + /** + * 采集时间 + */ + @TableField(value = "xt_cjsj") + private LocalDateTime xtCjsj; + + /** + * 录入时间 + */ + @TableField(value = "xt_lrsj") + private LocalDateTime xtLrsj; + + /** + * 录入人姓名 + */ + @TableField(value = "xt_lrrxm") + private String xtLrrxm; + + /** + * 录入人id + */ + @TableField(value = "xt_lrrid") + private Long xt_lrrid; + + /** + * 录入人部门 + */ + @TableField(value = "xt_lrrbm") + private String xtLrrbm; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrrbmid") + private String xtLrrbmid; + + /** + * 录入人部门id + */ + @TableField(value = "xt_lrip") + private String xtLrip; + + /** + * 最后修改时间 + */ + @TableField(value = "xt_zhxgsj") + private LocalDateTime xtZhxgsj; + + /** + * 最后修改人姓名 + */ + @TableField(value = "xt_zhxgrxm") + private String xtZhxgrxm; + + /** + * 最后修改人id + */ + @TableField(value = "xt_zhxgid") + private Long xtZhxgid; + + /** + * 最后修改人部门 + */ + @TableField(value = "xt_zhxgrbm") + private String xtZhxgrbm; + + /** + * 最后修改人部门id + */ + @TableField(value = "xt_zhxgrbmid") + private Long xtZhxgrbmid; + + /** + * 最后修改人ip + */ + @TableField(value = "xt_zhxgrip") + private String xtZhxgrip; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + + + + + +} \ No newline at end of file diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskLog.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskLog.java new file mode 100644 index 0000000..b45567b --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/SysTaskLog.java @@ -0,0 +1,58 @@ +package com.mosty.common.task.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * 任务日志表 + * @TableName sys_task_log + */ +@TableName(value ="sys_task_log") +@Data +public class SysTaskLog implements Serializable { + /** + * 主键id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 任务下发处置表id + */ + @TableField(value = "task_item_id") + private Long taskItemId; + + /** + * 任务id + */ + @TableField(value = "rw_id") + private Long rwId; + + /** + * 任务接受人id + */ + @TableField(value = "rwjsr_id") + private Long rwjsrId; + + /** + * 任务处置时间 + */ + @TableField(value = "rwczsj") + private LocalDateTime rwczsj; + + /** + * 任务处置状态 + */ + @TableField(value = "rwczzt") + private Integer rwczzt; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + +} \ No newline at end of file diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.java new file mode 100644 index 0000000..700b444 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.java @@ -0,0 +1,30 @@ +package com.mosty.common.task.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +@Accessors(chain = true) +public class AddSysTaskDeptVO implements Serializable { + + @ApiModelProperty("任务接受部门编码, 执行类型为部门时 必传" ) + private Long deptCode; + + /** + * 任务接受部门单位id + */ + @ApiModelProperty("任务接受人单位id 执行类型为部门时 必传") + private Long companyId; + + /** + * 任务接受部门单位名称 + */ + @ApiModelProperty("任务接受人单位名称 执行类型为部门时 必传") + private String companyName; + + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.java new file mode 100644 index 0000000..35293a0 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.java @@ -0,0 +1,41 @@ +package com.mosty.common.task.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@Accessors(chain = true) +public class AddSysTaskUserInfoVO implements Serializable { + + + + + /** + * 身份证号 + */ + @ApiModelProperty("身份证号") + @NotNull(message = "身份证号") + private String idCardNo; + + + /** + * 任务接受人单位id + */ + @ApiModelProperty("任务接受人单位id") + @NotNull(message = "任务接受人单位id") + private Long companyId; + + /** + * 任务接受人单位名称 + */ + @ApiModelProperty("任务接受人单位名称") + private String companyName; + + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskVO.java new file mode 100644 index 0000000..685a5ea --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/AddSysTaskVO.java @@ -0,0 +1,166 @@ +package com.mosty.common.task.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +@Data +@Accessors(chain = true) +public class AddSysTaskVO implements Serializable { + /** + * 应用id + */ + @ApiModelProperty("应用id") + @NotNull(message = "应用id不能为空") + private Long appId; + + /** + * 任务类型 + */ + @ApiModelProperty("任务类型 1, 核实任务 2。预警指令") + @NotNull(message = "任务类型不能为空") + private String rwlx; + + /** + * 执行类型 + */ + @ApiModelProperty("执行类型 1用户 2部门") + @NotNull(message = "执行类型不能为空") + private Integer zxlx; + + /** + * 任务紧急程度 + */ + @ApiModelProperty("任务紧急程度") + @NotNull(message = "任务紧急程度不能为空") + private String rwjjcd; + + /** + * 任务名称 + */ + @ApiModelProperty("任务名称") + @NotBlank(message = "任务名称不能为空") + private String rwmc; + + /** + * 任务内容 + */ + @ApiModelProperty("任务内容") + @NotBlank(message = "任务内容不能为空") + private String rwnr; + + /** + * 任务制定时间 + */ + @ApiModelProperty("任务制定时间") + private LocalDateTime rwzdsj; + + /** + * 任务要求完成时间 + */ + @ApiModelProperty("任务要求完成时间") + private LocalDateTime rwyqwcsj; + /** + * 任务创建人ID + */ + @ApiModelProperty("任务创建人ID") + private Long rwcjrId; + /** + * 任务创建人身份证号 + */ + @ApiModelProperty("任务创建人身份证号") + private String rwcjrsfzh; + + /** + * 任务创建人姓名 + */ + @ApiModelProperty("任务创建人姓名") + private String rwcjrxm; + + /** + * 任务创建人单位 + */ + @ApiModelProperty("任务创建人单位") + private String rwcjrdw; + + /** + * 任务创建人部门id + */ + @ApiModelProperty("任务创建人部门id") + private Long rwcjrbmId; + + /** + * 任务创建人部门名称 + */ + @ApiModelProperty("任务创建人部门名称") + private String rwcjrbmmc; + + /** + * 任务创建人单位id + */ + @ApiModelProperty("任务创建人单位id") + private Long rwcjrdwId; + + + /** + * 任务创建人电话 + */ + @ApiModelProperty("任务创建人电话") + private String rwcjrdh; + + /** + * 任务创建规则 1.单人任务 2.多人任务 + */ + @ApiModelProperty("任务创建规则 1.单人任务 2.多人任务") + private Integer rwcjrgz; + + /** + * 任务来源系统 + */ + @ApiModelProperty("任务来源系统 1 智能安防,2。公共安全监管 3。三级指挥") + @NotNull(message = "任务来源系统不能为空 1 智能安防,2。公共安全监管 3。三级指挥" ) + private String rwlyxt; + + /** + * 任务来源id + */ + @ApiModelProperty("任务来源id ") + private String rwlyId; + + + /** + * 任务url + */ + @ApiModelProperty("任务url") + private String rwUrl; + + /** + * 任务终端 + */ + @ApiModelProperty("任务终端 1,安卓 2 H5 ") + @NotNull(message = "任务终端不能为空 1") + private String rwzd; + + /** + * 备注 + */ + private String bz; + /** + * 执行类型为用户时 必穿 + */ + @ApiModelProperty("执行类型为用户时 必传 任务接受人信息") + private List UserInfos; + + /** + * 执行类型为用户时 必穿 + */ + @ApiModelProperty("执行类型为部门时 必传 任务接受部门信息") + private List deptVOS; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/DetailSysTaskVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/DetailSysTaskVO.java new file mode 100644 index 0000000..d7b95ed --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/DetailSysTaskVO.java @@ -0,0 +1,15 @@ +package com.mosty.common.task.entity.vo; + +import com.mosty.common.token.UserInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +@Data +public class DetailSysTaskVO implements Serializable { + @ApiModelProperty(value = "下发任务id",required = true) + private Long taskItemId; + @ApiModelProperty(value ="操作人身份证",required = true) + private String idCardNo; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/FinishSysTaskVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/FinishSysTaskVO.java new file mode 100644 index 0000000..9c37543 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/FinishSysTaskVO.java @@ -0,0 +1,25 @@ +package com.mosty.common.task.entity.vo; + +import com.mosty.common.token.UserInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class FinishSysTaskVO implements Serializable { + @ApiModelProperty(value = "下发任务id") + private Long taskItemId; + @ApiModelProperty(value ="操作人身份证",required = true) + @NotBlank(message="操作人身份证不能为空") + private String idCardNo; + @ApiModelProperty(value = "来源任务id",required = true) + @NotBlank(message = "来源系统id不能为空") + private String lyxtId; + @ApiModelProperty(value ="部门编码") + private String deptCode; + + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskLogVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskLogVO.java new file mode 100644 index 0000000..fa27525 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskLogVO.java @@ -0,0 +1,28 @@ +package com.mosty.common.task.entity.vo; + +import cn.hutool.db.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +@Data +@Accessors(chain = true) +public class QueryTaskLogVO implements Serializable { + /** + * 身份证号 + */ + @ApiModelProperty(value = "用户id",required = true) + private Long userId; + /** + * 任务id + */ + @ApiModelProperty("任务id") + private Long rwId; + /** + * 下发任务id + */ + @ApiModelProperty("下发任务id") + private Long taskItemId; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskVO.java new file mode 100644 index 0000000..d547dc9 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/QueryTaskVO.java @@ -0,0 +1,69 @@ +package com.mosty.common.task.entity.vo; + +import cn.hutool.db.Page; +import com.mosty.common.token.UserInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@Accessors(chain = true) +public class QueryTaskVO extends Page implements Serializable { + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号",required = true) + @NotBlank(message = "身份证号不能为空") + private String idCardNo; + /** + * 部门编码 + */ + @ApiModelProperty(value = "部门编码(获取不到部门id传编码)",required = true) + private Long deptCode; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门编码",required = true) + private Long deptId; + /** + * 任务名称 + */ + @ApiModelProperty("任务名称") + private String taskName; + /** + * 任务状态 0 未查看 1已查看 2已完成 + */ + @ApiModelProperty("任务状态 0 未查看 1已查看 2已完成") + private Integer taskStatus; + + /** + * 任务来源 + */ + @ApiModelProperty("任务来源 01_智能安防社区 02_公共安全监管 03_三级指挥") + private Integer source; + + /** + * 任务类型 + */ + @ApiModelProperty("任务类型 01 核实任务 02 预警指令") + private Integer taskType; + + /** + * 任务开始时间 + */ + @ApiModelProperty("任务开始时间") + private LocalDateTime startTime; + + /** + * 任务结束时间 + */ + @ApiModelProperty("任务结束时间") + private LocalDateTime endTime; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountGroup.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountGroup.java new file mode 100644 index 0000000..61478ec --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountGroup.java @@ -0,0 +1,14 @@ +package com.mosty.common.task.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SysTaskCountGroup implements Serializable { + @ApiModelProperty("任务类型") + private String rwlx; + @ApiModelProperty("数量") + private Long count; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountToday.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountToday.java new file mode 100644 index 0000000..80702b6 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskCountToday.java @@ -0,0 +1,14 @@ +package com.mosty.common.task.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SysTaskCountToday implements Serializable { + @ApiModelProperty("完成数量") + private Long finishCount; + @ApiModelProperty("未完成数量") + private Long unFinishCount; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskItemVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskItemVO.java new file mode 100644 index 0000000..f1762a4 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskItemVO.java @@ -0,0 +1,78 @@ +package com.mosty.common.task.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.data.annotation.Transient; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +@Data +@Accessors(chain = true) +public class SysTaskItemVO implements Serializable { + private Long id; + + /** + * 任务来源id + */ + @ApiModelProperty("任务来源id") + private String rwlyId; + + + /** + * 任务类型 + */ + @ApiModelProperty("任务类型") + private String rwlx; + /** + * 任务类型描述 + */ + @ApiModelProperty("任务类型描述") + private String rwlxDesc; + + /** + * 任务名称 + */ + @ApiModelProperty("任务名称") + private String rwmc; + + /** + * 任务内容 + */ + @ApiModelProperty("任务内容") + private String rwnr; + /** + * 任务Url + */ + @ApiModelProperty("任务Url") + private String rwurl; + /** + * 身份证号 + */ + @ApiModelProperty("身份证号") + private String idCardNo; + + /** + * 任务内容 + */ + @ApiModelProperty("任务来源系统") + private String rwlyxt; + + + /** + * 任务要求完成时间 + */ + @ApiModelProperty(value = "任务要求完成时间") + private LocalDateTime rwyqwcsj; + /** + * 任务日志 + */ + @ApiModelProperty("任务日志") + private List logs; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLineChartVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLineChartVO.java new file mode 100644 index 0000000..7d44d0f --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLineChartVO.java @@ -0,0 +1,16 @@ +package com.mosty.common.task.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SysTaskLineChartVO implements Serializable { + @ApiModelProperty("序号:月 1 -12 日期 近七天 例子:4-11") + private String no; + + @ApiModelProperty("数量") + private Long count; + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLogVO.java b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLogVO.java new file mode 100644 index 0000000..a59bfb1 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/entity/vo/SysTaskLogVO.java @@ -0,0 +1,29 @@ +package com.mosty.common.task.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +public class SysTaskLogVO implements Serializable { + /** + * 任务处置时间 + */ + @ApiModelProperty(value = "任务处置时间") + private LocalDateTime rwczsj; + + /** + * 任务处置状态 + */ + @ApiModelProperty(value = "rwczzt") + private Integer rwczzt; + + /** + * 任务处置状态 + */ + @ApiModelProperty(value = "任务处置状态") + private String rwczztDesc; +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskItemMapper.java b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskItemMapper.java new file mode 100644 index 0000000..b283df1 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskItemMapper.java @@ -0,0 +1,17 @@ +package com.mosty.common.task.mapper; + +import com.mosty.common.task.entity.SysTaskItem; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author liyan +* @description 针对表【sys_task_item(任务下发表)】的数据库操作Mapper +* @createDate 2022-04-21 21:34:04 +*/ +public interface SysTaskItemMapper extends BaseMapper { + +} + + + + diff --git a/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskLogMapper.java b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskLogMapper.java new file mode 100644 index 0000000..99a340c --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskLogMapper.java @@ -0,0 +1,17 @@ +package com.mosty.common.task.mapper; + +import com.mosty.common.task.entity.SysTaskLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author liyan +* @description 针对表【sys_task_log(任务日志表)】的数据库操作Mapper +* @createDate 2022-04-21 21:34:09 +*/ +public interface SysTaskLogMapper extends BaseMapper { + +} + + + + diff --git a/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskMapper.java b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskMapper.java new file mode 100644 index 0000000..2773761 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/mapper/SysTaskMapper.java @@ -0,0 +1,40 @@ +package com.mosty.common.task.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.task.entity.SysTask; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mosty.common.task.entity.vo.QueryTaskVO; +import com.mosty.common.task.entity.vo.SysTaskItemVO; +import org.apache.ibatis.annotations.Param; + +/** +* @author liyan +* @description 针对表【sys_task(任务表)】的数据库操作Mapper +* @createDate 2022-04-21 21:31:14 +*/ +public interface SysTaskMapper extends BaseMapper { + /** + * 分页查询 + * @param queryTaskVO + * @return + */ + IPage findByList(IPage page,@Param("param") QueryTaskVO queryTaskVO); + + /** + * 根据条件查询 执行类型为用户的任务数量 + * @param queryTaskVO + * @return + */ + Long countByUser(@Param("param") QueryTaskVO queryTaskVO); + + /** + * 执行类型为部门 查询对应条件的数量 + * @param queryTaskVO + * @return + */ + Long countByDept(@Param("param") QueryTaskVO queryTaskVO); +} + + + + diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskItemService.java b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskItemService.java new file mode 100644 index 0000000..846abe8 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskItemService.java @@ -0,0 +1,13 @@ +package com.mosty.common.task.service; + +import com.mosty.common.task.entity.SysTaskItem; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author liyan +* @description 针对表【sys_task_item(任务下发表)】的数据库操作Service +* @createDate 2022-04-21 21:34:04 +*/ +public interface SysTaskItemService extends IService { + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskLogService.java b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskLogService.java new file mode 100644 index 0000000..b59446c --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskLogService.java @@ -0,0 +1,13 @@ +package com.mosty.common.task.service; + +import com.mosty.common.task.entity.SysTaskLog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author liyan +* @description 针对表【sys_task_log(任务日志表)】的数据库操作Service +* @createDate 2022-04-21 21:34:09 +*/ +public interface SysTaskLogService extends IService { + +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskService.java b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskService.java new file mode 100644 index 0000000..d0b92e1 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/SysTaskService.java @@ -0,0 +1,84 @@ +package com.mosty.common.task.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.mosty.common.task.entity.SysTask; +import com.baomidou.mybatisplus.extension.service.IService; +import com.mosty.common.task.entity.vo.*; + +import java.util.List; + +/** +* @author liyan +* @description 针对表【sys_task(任务表)】的数据库操作Service +* @createDate 2022-04-21 21:31:14 +*/ +public interface SysTaskService extends IService { + /** + * 保存下发任务 + * @param addSysTaskVO + * @param ipAddress + */ + void saveInfo(AddSysTaskVO addSysTaskVO, String ipAddress); + + /** + * 查看任务详情 + * @param detailSysTaskVO + * @param ipAddress + * @return + */ + SysTask detail(DetailSysTaskVO detailSysTaskVO, String ipAddress); + + /** + * 完成回调 + * @param finishSysTaskVO + * @param ipAddress + */ + void finish(FinishSysTaskVO finishSysTaskVO, String ipAddress); + + /** + * 分页查询 + * @param queryTaskVO + * @return + */ + IPage findByList(QueryTaskVO queryTaskVO); + + /** + * 查询对应的日志 + * @param queryTaskLogVO + * @return + */ + List findLogByList(QueryTaskLogVO queryTaskLogVO); + + /** + * 查询任务数量根据条件 + * @param queryTaskVO + * @return + */ + Long countByQuery(QueryTaskVO queryTaskVO); + + /** + * 查询当天的任务数据 + * @return + */ + SysTaskCountToday todayCount(); + + /** + * 查询全部统计数据 + * @return + */ + SysTaskCountToday allCount(); + + /** + * 根据类型统计数据 + * @param countType + * @return + */ + List groupCount(Integer countType); + + /** + * 获取折线图数据 + * @param lineChartType + * @return + */ + List lineChart(Integer lineChartType); +} diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.java b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.java new file mode 100644 index 0000000..aeb9359 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.java @@ -0,0 +1,22 @@ +package com.mosty.common.task.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.task.entity.SysTaskItem; +import com.mosty.common.task.service.SysTaskItemService; +import com.mosty.common.task.mapper.SysTaskItemMapper; +import org.springframework.stereotype.Service; + +/** +* @author liyan +* @description 针对表【sys_task_item(任务下发表)】的数据库操作Service实现 +* @createDate 2022-04-21 21:34:04 +*/ +@Service +public class SysTaskItemServiceImpl extends ServiceImpl + implements SysTaskItemService{ + +} + + + + diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.java b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.java new file mode 100644 index 0000000..9a82633 --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.java @@ -0,0 +1,22 @@ +package com.mosty.common.task.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mosty.common.task.entity.SysTaskLog; +import com.mosty.common.task.service.SysTaskLogService; +import com.mosty.common.task.mapper.SysTaskLogMapper; +import org.springframework.stereotype.Service; + +/** +* @author liyan +* @description 针对表【sys_task_log(任务日志表)】的数据库操作Service实现 +* @createDate 2022-04-21 21:34:09 +*/ +@Service +public class SysTaskLogServiceImpl extends ServiceImpl + implements SysTaskLogService{ + +} + + + + diff --git a/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskServiceImpl.java b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskServiceImpl.java new file mode 100644 index 0000000..5a5d6df --- /dev/null +++ b/common-task-starter/src/main/java/com/mosty/common/task/service/impl/SysTaskServiceImpl.java @@ -0,0 +1,515 @@ +package com.mosty.common.task.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import com.mosty.common.base.constant.enums.DeletedEnum; +import com.mosty.common.base.exception.Asserts; +import com.mosty.common.base.util.DateUtils; +import com.mosty.common.base.util.LocalDateTimeUtils; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.core.business.entity.SysDept; +import com.mosty.common.core.business.entity.SysUser; +import com.mosty.common.core.business.service.SysDeptService; +import com.mosty.common.core.business.service.SysUserService; +import com.mosty.common.core.login.dto.DeptDTO; +import com.mosty.common.task.constant.enums.*; +import com.mosty.common.task.entity.SysTask; +import com.mosty.common.task.entity.SysTaskItem; +import com.mosty.common.task.entity.SysTaskLog; +import com.mosty.common.task.entity.vo.*; +import com.mosty.common.task.service.SysTaskItemService; +import com.mosty.common.task.service.SysTaskLogService; +import com.mosty.common.task.service.SysTaskService; +import com.mosty.common.task.mapper.SysTaskMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author liyan + * @description 针对表【sys_task(任务表)】的数据库操作Service实现 + * @createDate 2022-04-21 21:31:14 + */ +@Service +public class SysTaskServiceImpl extends ServiceImpl + implements SysTaskService { + @Resource + private SysTaskMapper sysTaskMapper; + @Resource + private SysTaskItemService sysTaskItemService; + @Resource + private SysTaskLogService sysTaskLogService; + @Resource + private SysUserService userService; + @Resource + private SysDeptService sysDeptService; + + @Override + public IPage findByList(QueryTaskVO queryTaskVO) { + String idCardNo = queryTaskVO.getIdCardNo(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idCardNo); + SysUser sysUser = userService.getBaseMapper().selectOne(queryWrapper); + Asserts.check(sysUser == null, "身份证 %s 对应的用户不存在!", idCardNo); + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + Asserts.check(CollectionUtils.isEmpty(deptList), "身份证 %s 没有绑定部门!", idCardNo); + DeptDTO deptDTO = deptList.get(0); + if (Objects.nonNull(deptDTO)) { + queryTaskVO.setDeptId(deptDTO.getDeptId()); + } + IPage page = new Page<>(queryTaskVO.getPageNumber(), queryTaskVO.getPageSize()); + IPage result = sysTaskMapper.findByList(page, queryTaskVO); + if (CollectionUtils.isNotEmpty(result.getRecords())) { + List records = result.getRecords(); + records.forEach(sysTaskItemVO -> { + sysTaskItemVO.setRwlxDesc(TaskTypeEnum.getEnum(sysTaskItemVO.getRwlx()).desc); + }); + getLogs(records); + result.setRecords(records); + } + return result; + } + + @Override + public List findLogByList(QueryTaskLogVO queryTaskLogVO) { + LambdaQueryWrapper logQueryWrapper = new LambdaQueryWrapper<>(); + if (Objects.nonNull(queryTaskLogVO.getTaskItemId())) { + logQueryWrapper.eq(SysTaskLog::getTaskItemId, queryTaskLogVO.getTaskItemId()); + } + if (Objects.nonNull(queryTaskLogVO.getRwId())) { + logQueryWrapper.eq(SysTaskLog::getRwId, queryTaskLogVO.getRwId()); + } + if (Objects.nonNull(queryTaskLogVO.getUserId())) { + logQueryWrapper.eq(SysTaskLog::getRwjsrId, queryTaskLogVO.getUserId()); + } + List list = sysTaskLogService.list(logQueryWrapper); + List sysTaskLogVOS = BeanUtil.copyToList(list, SysTaskLogVO.class); + return sysTaskLogVOS; + } + + @Override + public Long countByQuery(QueryTaskVO queryTaskVO) { + String idCardNo = queryTaskVO.getIdCardNo(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idCardNo); + queryWrapper.eq("xt_zxbz",DeletedEnum.NATURE.code); + SysUser sysUser = userService.getBaseMapper().selectOne(queryWrapper); + Asserts.check(sysUser == null, "身份证 %s 对应的用户不存在!", idCardNo); + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + Asserts.check(CollectionUtils.isEmpty(deptList), "身份证 %s 没有绑定部门!", idCardNo); + DeptDTO deptDTO = deptList.get(0); + if (Objects.nonNull(deptDTO)) { + queryTaskVO.setDeptId(deptDTO.getDeptId()); + } + //查询 + Long count = sysTaskMapper.countByUser(queryTaskVO); + Long deptCount = sysTaskMapper.countByDept(queryTaskVO); + return deptCount + count; + } + + @Override + public SysTaskCountToday todayCount() { + long unFinish = this.count(new LambdaQueryWrapper() + .eq(SysTask::getRwzxzt, ExecuteStatusEnum.UNFINISH.code).between(SysTask::getRwzdsj, + LocalDateTimeUtils.todayStart(), LocalDateTimeUtils.todayEnd())); + long finish = this.count(new LambdaQueryWrapper() + .eq(SysTask::getRwzxzt, ExecuteStatusEnum.FINISH.code).between(SysTask::getRwzdsj, + LocalDateTimeUtils.todayStart(), LocalDateTimeUtils.todayEnd())); + SysTaskCountToday today = new SysTaskCountToday(); + today.setFinishCount(finish); + today.setUnFinishCount(unFinish); + return today; + } + + @Override + public SysTaskCountToday allCount() { + long unFinish = this.count(new LambdaQueryWrapper() + .eq(SysTask::getRwzxzt, ExecuteStatusEnum.UNFINISH.code)); + long finish = this.count(new LambdaQueryWrapper() + .eq(SysTask::getRwzxzt, ExecuteStatusEnum.FINISH.code)); + SysTaskCountToday today = new SysTaskCountToday(); + today.setFinishCount(finish); + today.setUnFinishCount(unFinish); + return today; + } + + @Override + public List groupCount(Integer countType) { + List groupList = new ArrayList<>(); + initGroupList(groupList); + if (GroupCountTypeEnum.ALL.code.equals(countType)) { + List list = this.list(new LambdaQueryWrapper()); + Map> typeMap = list.stream().collect(Collectors.groupingBy(SysTask::getRwlx)); + groupList.forEach(item -> { + if (typeMap.containsKey(item.getRwlx())){ + item.setCount( Long.valueOf(typeMap.get(item.getRwlx()).size())); + } + }); + } + if (GroupCountTypeEnum.TODAY.code.equals(countType)) { + List list = this.list(new LambdaQueryWrapper().between(SysTask::getRwzdsj, + LocalDateTimeUtils.todayStart(), LocalDateTimeUtils.todayEnd())); + Map> typeMap = list.stream().collect(Collectors.groupingBy(SysTask::getRwlx)); + groupList.forEach(item -> { + if (typeMap.containsKey(item.getRwlx())){ + item.setCount( Long.valueOf(typeMap.get(item.getRwlx()).size())); + } + + }); + } + if (GroupCountTypeEnum.WEEK.code.equals(countType)) { + List list = this.list(new LambdaQueryWrapper().between(SysTask::getRwzdsj, + LocalDateTimeUtils.daysStart(7), LocalDateTime.now())); + Map> typeMap = list.stream().collect(Collectors.groupingBy(SysTask::getRwlx)); + groupList.forEach(item -> { + if (typeMap.containsKey(item.getRwlx())){ + item.setCount( Long.valueOf(typeMap.get(item.getRwlx()).size())); + } + + }); + } + if (GroupCountTypeEnum.MONTH.code.equals(countType)) { + List list = this.list(new LambdaQueryWrapper().between(SysTask::getRwzdsj, + LocalDateTimeUtils.daysStart(30), LocalDateTime.now())); + Map> typeMap = list.stream().collect(Collectors.groupingBy(SysTask::getRwlx)); + groupList.forEach(item -> { + if (typeMap.containsKey(item.getRwlx())){ + item.setCount( Long.valueOf(typeMap.get(item.getRwlx()).size())); + } + + }); + } + return groupList; + } + + private void initGroupList(List groupList) { + TaskTypeEnum[] values = TaskTypeEnum.values(); + for (TaskTypeEnum value : values) { + SysTaskCountGroup group = new SysTaskCountGroup(); + group.setCount(0L); + group.setRwlx(value.code); + groupList.add(group); + } + + } + + @Override + public List lineChart(Integer lineChartType) { + if (LineChartTypeEnum.DAY.code.equals(lineChartType)) { + List sysTaskLineChartVOS = getDay(); + sysTaskLineChartVOS.sort(Comparator.comparing(SysTaskLineChartVO::getNo)); + return sysTaskLineChartVOS; + } else { + List sysTaskLineChartVOS = getMonth(); + sysTaskLineChartVOS.sort(Comparator.comparing(SysTaskLineChartVO::getNo)); + return sysTaskLineChartVOS; + } + } + + private List getMonth() { + List sysTaskLineChartVOS = new ArrayList<>(); + Map monthGroup = getMonthGroup(12); + //获取最近七天的数据 + LocalDateTime begin = LocalDateTimeUtils.todayStart().minusYears(1); + LocalDateTime after = LocalDateTimeUtils.todayEnd(); + List list = this.list(new LambdaQueryWrapper().between(SysTask::getRwzdsj, begin, after)); + Map> taskMap = list.stream().collect(Collectors.groupingBy(item -> DateUtils.parseDateToStr(DateUtils.YY_MM, DateUtils.LocalDateTimeToDate(item.getRwzdsj())))); + monthGroup.entrySet().forEach(item -> { + SysTaskLineChartVO chartVO = new SysTaskLineChartVO(); + if (taskMap.containsKey(item.getKey())) { + List sysTasks = taskMap.get(item.getKey()); + chartVO.setNo(item.getKey()); + chartVO.setCount(Long.valueOf(sysTasks.size())); + } else { + chartVO.setNo(item.getKey()); + chartVO.setCount(0L); + } + sysTaskLineChartVOS.add(chartVO); + }); + return sysTaskLineChartVOS; + } + + private List getDay() { + List sysTaskLineChartVOS = new ArrayList<>(); + //获取最近七天的数据 + Map dayMap = getDayGroup(7); + LocalDateTime begin = LocalDateTimeUtils.todayStart().minusDays(7); + LocalDateTime after = LocalDateTimeUtils.todayEnd(); + List list = this.list(new LambdaQueryWrapper().between(SysTask::getRwzdsj, begin, after)); + Map> taskMap = list.stream().collect(Collectors.groupingBy(item -> DateUtils.parseDateToStr(DateUtils.MM_DD, DateUtils.LocalDateTimeToDate(item.getRwzdsj())))); + dayMap.entrySet().forEach(item -> { + SysTaskLineChartVO chartVO = new SysTaskLineChartVO(); + if (taskMap.containsKey(item.getKey())) { + List sysTasks = taskMap.get(item.getKey()); + chartVO.setNo(item.getKey()); + chartVO.setCount(Long.valueOf(sysTasks.size())); + } else { + chartVO.setNo(item.getKey()); + chartVO.setCount(0L); + } + sysTaskLineChartVOS.add(chartVO); + }); + return sysTaskLineChartVOS; + + } + + private Map getDayGroup(Integer dayNum) { + Map map = new HashMap<>(); + for (int i = 1; i <= dayNum; i++) { + map.put(DateUtils.parseDateToStr(DateUtils.MM_DD, DateUtils.LocalDateTimeToDate(LocalDateTime.now().minusDays(i))), 0L); + } + return map; + } + + private Map getMonthGroup(Integer monthNum) { + Map map = new HashMap<>(); + for (int i = 1; i <= monthNum; i++) { + map.put(DateUtils.parseDateToStr(DateUtils.YY_MM, DateUtils.LocalDateTimeToDate(LocalDateTime.now().minusMonths(i))), 0L); + } + return map; + + } + + + /** + * 获取对应任务的日志 + * + * @param records + */ + private void getLogs(List records) { + List taskItemIds = records.stream().map(SysTaskItemVO::getId).collect(Collectors.toList()); + List list = sysTaskLogService.list(new LambdaQueryWrapper() + .in(SysTaskLog::getTaskItemId, taskItemIds).orderByDesc(SysTaskLog::getRwczsj)); + if (CollectionUtils.isNotEmpty(list)) { + Map> itemMap = + list.stream().collect(Collectors.groupingBy(SysTaskLog::getTaskItemId)); + records.forEach(item -> { + List sysTaskLogs = itemMap.get(item.getId()); + List sysTaskLogVOS = BeanUtil.copyToList(sysTaskLogs, SysTaskLogVO.class); + sysTaskLogVOS.forEach(log -> { + log.setRwczztDesc(TaskLogStatusEnum.valueOf(log.getRwczzt()).desc); + }); + item.setLogs(sysTaskLogVOS); + }); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveInfo(AddSysTaskVO addSysTaskVO, String ipAddress) { + //1.记录任务 如果是执行类型部门, + // 判断规则为单人且下发部门id 不能为空 + //如果是执行类型为 人 那么下发用户List不能为空 + validInfo(addSysTaskVO); + SysTask sysTask = BeanUtil.copyProperties(addSysTaskVO, SysTask.class); + sysTask.setXtZhxgsj(LocalDateTime.now()); + sysTask.setXtCjsj(LocalDateTime.now()); + sysTask.setXtLrip(ipAddress); + sysTask.setXtZhxgid(addSysTaskVO.getRwcjrId()); + sysTask.setXtZhxgrxm(addSysTaskVO.getRwcjrxm()); + sysTask.setXtZhxgrbmid(addSysTaskVO.getRwcjrbmId()); + sysTask.setXtZhxgrbm(addSysTaskVO.getRwcjrbmmc()); + + sysTask.setXtLrsj(LocalDateTime.now()); + sysTask.setXtLrrid(addSysTaskVO.getRwcjrId()); + sysTask.setXtLrrxm(addSysTaskVO.getRwcjrxm()); + sysTask.setXtLrrbmid(addSysTaskVO.getRwcjrbmId()); + sysTask.setXtLrrbm(addSysTaskVO.getRwcjrbmmc()); + sysTask.setYyId(addSysTaskVO.getAppId()); + this.save(sysTask); + //2。下发相关任务 + saveItems(addSysTaskVO, sysTask); + } + + @Override + @Transactional + public SysTask detail(DetailSysTaskVO detailSysTaskVO, String ipAddress) { + String idCardNo = detailSysTaskVO.getIdCardNo(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idCardNo); + SysUser sysUser = userService.getBaseMapper().selectOne(queryWrapper); + Asserts.check(sysUser == null, "身份证 %s 对应的用户不存在!", idCardNo); + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO deptDTO = deptList.get(0); + //1。更新对应任务下发表为已查看 + SysTaskItem taskItem = sysTaskItemService.getById(detailSysTaskVO.getTaskItemId()); + if (TaskItemStatusEnum.NOTVIEWED.code.equals(taskItem.getRwzt())) { + taskItem.setRwcksj(LocalDateTime.now()); + taskItem.setRwzt(TaskItemStatusEnum.VIEWED.code); + taskItem.setXtZxbz(DeletedEnum.NATURE.code); + taskItem.setXtZhxgsj(LocalDateTime.now()); + taskItem.setXtLrip(ipAddress); + taskItem.setXtZhxgid(sysUser.getId()); + taskItem.setXtZhxgrxm(sysUser.getUserName()); + taskItem.setXtZhxgrbmid(deptDTO.getDeptId()); + taskItem.setXtZhxgrbm(deptDTO.getDeptName()); + sysTaskItemService.updateById(taskItem); + } + //2。插入日志 + SysTaskLog log = new SysTaskLog(); + log.setRwId(taskItem.getRwId()); + log.setRwjsrId(sysUser.getId()); + log.setTaskItemId(taskItem.getId()); + log.setRwczsj(LocalDateTime.now()); + log.setRwczzt(TaskItemStatusEnum.VIEWED.code); + sysTaskLogService.save(log); + //返回任务详情 + SysTask task = this.getById(taskItem.getRwId()); + task.setId(detailSysTaskVO.getTaskItemId()); + return task; + } + + @Override + @Transactional + public void finish(FinishSysTaskVO finishSysTaskVO, String ipAddress) { + List list = this.list(new LambdaQueryWrapper().eq(SysTask::getRwlyId, finishSysTaskVO.getLyxtId())); + if (CollectionUtils.isEmpty(list)){ + Asserts.check(true, "没有查到对应任务", finishSysTaskVO.getLyxtId()); + } + SysTask sourceTask = list.get(0); + //1。更新对应任务下发表为完成 + String idCardNo = finishSysTaskVO.getIdCardNo(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", idCardNo); + SysUser sysUser = userService.getBaseMapper().selectOne(queryWrapper); + Asserts.check(sysUser == null, "身份证 %s 对应的用户不存在!", idCardNo); + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO deptDTO = deptList.get(0); + SysTaskItem taskItem =null; + if (ExecuteTypeEnum.USER.code.equals(sourceTask.getZxlx())){ + taskItem = sysTaskItemService.getOne(new LambdaQueryWrapper() + .eq(SysTaskItem::getRwId, sourceTask.getId()).eq(SysTaskItem::getRwjsrsfzh, idCardNo)); + }else{ + Asserts.check(StringUtils.isBlank(finishSysTaskVO.getDeptCode()), "任务类型为部门时部门编码不能为空", finishSysTaskVO.getDeptCode()); + SysDept sysDept = sysDeptService.getOne(new LambdaQueryWrapper() + .eq(SysDept::getOrgCode, finishSysTaskVO.getDeptCode()) + .eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code)); + Asserts.check(sysDept == null, "部门编码 %s 对应的部门不存在!", finishSysTaskVO.getDeptCode()); + taskItem = sysTaskItemService.getOne(new LambdaQueryWrapper() + .eq(SysTaskItem::getRwId, sourceTask.getId()).eq(SysTaskItem::getRwjsrbmId,sysDept.getId())); + } + Asserts.check(TaskItemStatusEnum.FINISH.code.equals(taskItem.getRwzt()), "该任务已经完成,请勿重复完成"); + taskItem.setRwwcsj(LocalDateTime.now()); + taskItem.setRwzt(TaskItemStatusEnum.FINISH.code); + taskItem.setXtZhxgsj(LocalDateTime.now()); + taskItem.setXtLrip(ipAddress); + taskItem.setXtZhxgid(sysUser.getId()); + taskItem.setXtZhxgrxm(sysUser.getUserName()); + taskItem.setXtZhxgrbmid(deptDTO.getDeptId()); + taskItem.setXtZhxgrbm(deptDTO.getDeptName()); + sysTaskItemService.updateById(taskItem); + //2。插入日志 + SysTaskLog log = new SysTaskLog(); + log.setRwId(taskItem.getRwId()); + log.setRwjsrId(sysUser.getId()); + log.setTaskItemId(taskItem.getId()); + log.setRwczsj(LocalDateTime.now()); + log.setRwczzt(TaskItemStatusEnum.FINISH.code); + sysTaskLogService.save(log); + //3 判断任务是否执行完成 + SysTask task = this.getById(taskItem.getRwId()); + if (ExecuteTypeEnum.DEPT.code.equals(task.getZxlx()) || RuleTypeEnum.ONE.code.equals(task.getRwcjrgz())) { + task.setRwzxzt(2); + task.setXtZhxgsj(LocalDateTime.now()); + task.setXtLrip(ipAddress); + task.setXtZhxgid(sysUser.getId()); + task.setXtZhxgrxm(sysUser.getUserName()); + task.setXtZhxgrbmid(deptDTO.getDeptId()); + task.setXtZhxgrbm(deptDTO.getDeptName()); + this.updateById(task); + } else { + int count = sysTaskItemService.count(new LambdaQueryWrapper() + .ne(SysTaskItem::getId, finishSysTaskVO.getTaskItemId()).ne(SysTaskItem::getRwzt, TaskItemStatusEnum.FINISH.code)); + if (count == 0) { + task.setRwzxzt(2); + task.setXtZhxgsj(LocalDateTime.now()); + task.setXtLrip(ipAddress); + task.setXtZhxgid(sysUser.getId()); + task.setXtZhxgrxm(sysUser.getUserName()); + task.setXtZhxgrbmid(deptDTO.getDeptId()); + task.setXtZhxgrbm(deptDTO.getDeptName()); + this.updateById(task); + } + } + + } + + + private void saveItems(AddSysTaskVO addSysTaskVO, SysTask sysTask) { + List logs = new ArrayList<>(); + if (ExecuteTypeEnum.USER.code.equals(addSysTaskVO.getZxlx())) { + List userInfos = addSysTaskVO.getUserInfos(); + userInfos.forEach(item -> { + SysTaskItem taskItem = new SysTaskItem(); + taskItem.setRwId(sysTask.getId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id_entity_card", item.getIdCardNo()); + SysUser sysUser = userService.getBaseMapper().selectOne(queryWrapper); + Asserts.check(sysUser == null, "身份证 %s 对应的用户不存在!", item.getIdCardNo()); + taskItem.setRwjsrId(sysUser.getId()); + List deptList = sysDeptService.selectUserDeptList(sysUser.getId()); + DeptDTO deptDTO = deptList.get(0); + taskItem.setRwjsrbmId(deptDTO.getDeptId()); + taskItem.setRwjsrbmmc(deptDTO.getDeptName()); + taskItem.setRwjsrdw(item.getCompanyName()); + taskItem.setRwjsrdwId(item.getCompanyId()); + taskItem.setRwjsrxm(sysUser.getUserName()); + taskItem.setRwjsrsfzh(sysUser.getIdEntityCard()); + sysTaskItemService.save(taskItem); + SysTaskLog log = new SysTaskLog(); + log.setRwId(sysTask.getId()); + log.setRwjsrId(sysUser.getId()); + log.setTaskItemId(taskItem.getId()); + log.setRwczsj(LocalDateTime.now()); + log.setRwczzt(TaskItemStatusEnum.NOTVIEWED.code); + logs.add(log); + }); + } else { + List deptVOS = addSysTaskVO.getDeptVOS(); + deptVOS.forEach(item -> { + SysTaskItem taskItem = new SysTaskItem(); + taskItem.setRwId(sysTask.getId()); + SysDept one = sysDeptService.getOne(new LambdaQueryWrapper() + .eq(SysDept::getOrgCode, item.getDeptCode()) + .eq(SysDept::getXtZxbz, DeletedEnum.NATURE.code)); + taskItem.setRwjsrbmId(one.getId()); + taskItem.setRwjsrdw(item.getCompanyName()); + taskItem.setRwjsrdwId(item.getCompanyId()); + sysTaskItemService.save(taskItem); + SysTaskLog log = new SysTaskLog(); + log.setRwId(sysTask.getId()); + log.setTaskItemId(taskItem.getId()); + log.setRwczsj(LocalDateTime.now()); + log.setRwczzt(TaskItemStatusEnum.NOTVIEWED.code); + logs.add(log); + }); + + } + sysTaskLogService.saveBatch(logs); + + + } + + private void validInfo(AddSysTaskVO addSysTaskVO) { + Asserts.check(ExecuteTypeEnum.USER.code.equals(addSysTaskVO.getZxlx()) + && CollectionUtil.isEmpty(addSysTaskVO.getUserInfos()), "执行类型为用户用户信息为不能为空"); + + Asserts.check(ExecuteTypeEnum.DEPT.code.equals(addSysTaskVO.getZxlx()) + && CollectionUtil.isEmpty(addSysTaskVO.getDeptVOS()), "执行类型为部门,部门信息为不能为空"); + } +} + + + + diff --git a/common-task-starter/src/main/resources/META-INF/spring.factories b/common-task-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..dd70f63 --- /dev/null +++ b/common-task-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.task.TaskAutoConfiguration \ No newline at end of file diff --git a/common-task-starter/src/main/resources/mapper/SysTaskItemMapper.xml b/common-task-starter/src/main/resources/mapper/SysTaskItemMapper.xml new file mode 100644 index 0000000..63e8f2d --- /dev/null +++ b/common-task-starter/src/main/resources/mapper/SysTaskItemMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,rw_id,rwjsr_id, + rwjsrsfzh,rwjsrxm,rwjsrdw_id, + rwjsrdw,rwjsrbm_id,rwjsrbmmc, + rwzt,rwzdsj,rwcksj, + rwwcsj,bz,xt_zxbz, + xt_zxyy,xt_cjsj,xt_lrsj, + xt_lrrxm,xt_lrrid,xt_lrrbm, + xt_lrrbmid,xt_lrip,xt_zhxgsj, + xt_zhxgrxm,xt_zhxgid,xt_zhxgrbm, + xt_zhxgrbmid,xt_zhxgrip + + diff --git a/common-task-starter/src/main/resources/mapper/SysTaskLogMapper.xml b/common-task-starter/src/main/resources/mapper/SysTaskLogMapper.xml new file mode 100644 index 0000000..b8158c5 --- /dev/null +++ b/common-task-starter/src/main/resources/mapper/SysTaskLogMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + id,rw_xfczb_id,rw_id, + rwjsr_id,rwczsj,rwczzt + + diff --git a/common-task-starter/src/main/resources/mapper/SysTaskMapper.xml b/common-task-starter/src/main/resources/mapper/SysTaskMapper.xml new file mode 100644 index 0000000..c0caa02 --- /dev/null +++ b/common-task-starter/src/main/resources/mapper/SysTaskMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,rwlx,rwjjcd, + rwmc,rwnr,rwzdsj, + rwwcsj,rwyqwcsj,rwcjrsfzh, + rwcjrxm,rwcjrdw,rwcjrdw_id, + rwcjrdh,rwcjrgz,rwzxzt, + rwlyxt,rw_url,bz, + xt_zxbz,xt_zxyy,xt_cjsj, + xt_lrsj,xt_lrrxm,xt_lrrid, + xt_lrrbm,xt_lrrbmid,xt_lrip, + xt_zhxgsj,xt_zhxgrxm,xt_zhxgid, + xt_zhxgrbm,xt_zhxgrbmid,xt_zhxgrip + + + + + + + diff --git a/common-task-starter/target/classes/META-INF/spring.factories b/common-task-starter/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..dd70f63 --- /dev/null +++ b/common-task-starter/target/classes/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.mosty.common.task.TaskAutoConfiguration \ No newline at end of file diff --git a/common-task-starter/target/classes/com/mosty/common/task/TaskAutoConfiguration.class b/common-task-starter/target/classes/com/mosty/common/task/TaskAutoConfiguration.class new file mode 100644 index 0000000..34bf2f4 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/TaskAutoConfiguration.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteStatusEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteStatusEnum.class new file mode 100644 index 0000000..7c4bb12 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteStatusEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteTypeEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteTypeEnum.class new file mode 100644 index 0000000..b29a036 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/ExecuteTypeEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/GroupCountTypeEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/GroupCountTypeEnum.class new file mode 100644 index 0000000..557924c Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/GroupCountTypeEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/LineChartTypeEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/LineChartTypeEnum.class new file mode 100644 index 0000000..83a8a57 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/LineChartTypeEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/RuleTypeEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/RuleTypeEnum.class new file mode 100644 index 0000000..516c11b Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/RuleTypeEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskItemStatusEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskItemStatusEnum.class new file mode 100644 index 0000000..54f77d3 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskItemStatusEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskLogStatusEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskLogStatusEnum.class new file mode 100644 index 0000000..f68a5a2 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskLogStatusEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskTypeEnum.class b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskTypeEnum.class new file mode 100644 index 0000000..9e4b786 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/constant/enums/TaskTypeEnum.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskController.class b/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskController.class new file mode 100644 index 0000000..d58b31f Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskController.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskReportController.class b/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskReportController.class new file mode 100644 index 0000000..c31d7ed Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/controller/SysTaskReportController.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/SysTask.class b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTask.class new file mode 100644 index 0000000..5c62629 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTask.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskItem.class b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskItem.class new file mode 100644 index 0000000..84d39ec Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskItem.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskLog.class b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskLog.class new file mode 100644 index 0000000..b92830e Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/SysTaskLog.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.class new file mode 100644 index 0000000..287ace0 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskDeptVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.class new file mode 100644 index 0000000..501baaa Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskUserInfoVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskVO.class new file mode 100644 index 0000000..0898006 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/AddSysTaskVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/DetailSysTaskVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/DetailSysTaskVO.class new file mode 100644 index 0000000..06322b6 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/DetailSysTaskVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/FinishSysTaskVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/FinishSysTaskVO.class new file mode 100644 index 0000000..ebcf320 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/FinishSysTaskVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskLogVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskLogVO.class new file mode 100644 index 0000000..fc90d04 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskLogVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskVO.class new file mode 100644 index 0000000..0973290 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/QueryTaskVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountGroup.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountGroup.class new file mode 100644 index 0000000..25a71f3 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountGroup.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountToday.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountToday.class new file mode 100644 index 0000000..23c6198 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskCountToday.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskItemVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskItemVO.class new file mode 100644 index 0000000..0f99ec6 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskItemVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLineChartVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLineChartVO.class new file mode 100644 index 0000000..e47d1d7 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLineChartVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLogVO.class b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLogVO.class new file mode 100644 index 0000000..6984c8d Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/entity/vo/SysTaskLogVO.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskItemMapper.class b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskItemMapper.class new file mode 100644 index 0000000..a204b1f Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskItemMapper.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskLogMapper.class b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskLogMapper.class new file mode 100644 index 0000000..5eca394 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskLogMapper.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskMapper.class b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskMapper.class new file mode 100644 index 0000000..31a8a7b Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/mapper/SysTaskMapper.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskItemService.class b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskItemService.class new file mode 100644 index 0000000..80c7de6 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskItemService.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskLogService.class b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskLogService.class new file mode 100644 index 0000000..de18375 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskLogService.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskService.class b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskService.class new file mode 100644 index 0000000..45578aa Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/SysTaskService.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.class b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.class new file mode 100644 index 0000000..fb07dbe Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskItemServiceImpl.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.class b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.class new file mode 100644 index 0000000..d19cc65 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskLogServiceImpl.class differ diff --git a/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskServiceImpl.class b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskServiceImpl.class new file mode 100644 index 0000000..9e41132 Binary files /dev/null and b/common-task-starter/target/classes/com/mosty/common/task/service/impl/SysTaskServiceImpl.class differ diff --git a/common-task-starter/target/classes/mapper/SysTaskItemMapper.xml b/common-task-starter/target/classes/mapper/SysTaskItemMapper.xml new file mode 100644 index 0000000..63e8f2d --- /dev/null +++ b/common-task-starter/target/classes/mapper/SysTaskItemMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,rw_id,rwjsr_id, + rwjsrsfzh,rwjsrxm,rwjsrdw_id, + rwjsrdw,rwjsrbm_id,rwjsrbmmc, + rwzt,rwzdsj,rwcksj, + rwwcsj,bz,xt_zxbz, + xt_zxyy,xt_cjsj,xt_lrsj, + xt_lrrxm,xt_lrrid,xt_lrrbm, + xt_lrrbmid,xt_lrip,xt_zhxgsj, + xt_zhxgrxm,xt_zhxgid,xt_zhxgrbm, + xt_zhxgrbmid,xt_zhxgrip + + diff --git a/common-task-starter/target/classes/mapper/SysTaskLogMapper.xml b/common-task-starter/target/classes/mapper/SysTaskLogMapper.xml new file mode 100644 index 0000000..b8158c5 --- /dev/null +++ b/common-task-starter/target/classes/mapper/SysTaskLogMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + id,rw_xfczb_id,rw_id, + rwjsr_id,rwczsj,rwczzt + + diff --git a/common-task-starter/target/classes/mapper/SysTaskMapper.xml b/common-task-starter/target/classes/mapper/SysTaskMapper.xml new file mode 100644 index 0000000..c0caa02 --- /dev/null +++ b/common-task-starter/target/classes/mapper/SysTaskMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,rwlx,rwjjcd, + rwmc,rwnr,rwzdsj, + rwwcsj,rwyqwcsj,rwcjrsfzh, + rwcjrxm,rwcjrdw,rwcjrdw_id, + rwcjrdh,rwcjrgz,rwzxzt, + rwlyxt,rw_url,bz, + xt_zxbz,xt_zxyy,xt_cjsj, + xt_lrsj,xt_lrrxm,xt_lrrid, + xt_lrrbm,xt_lrrbmid,xt_lrip, + xt_zhxgsj,xt_zhxgrxm,xt_zhxgid, + xt_zhxgrbm,xt_zhxgrbmid,xt_zhxgrip + + + + + + + diff --git a/common-task-starter/target/common-task-starter-1.0.0-SNAPSHOT.jar b/common-task-starter/target/common-task-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..1fdd18f Binary files /dev/null and b/common-task-starter/target/common-task-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-task-starter/target/maven-archiver/pom.properties b/common-task-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..f880639 --- /dev/null +++ b/common-task-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:23 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-task-starter diff --git a/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..7243174 --- /dev/null +++ b/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,35 @@ +com\mosty\common\task\constant\enums\GroupCountTypeEnum.class +com\mosty\common\task\entity\vo\SysTaskLineChartVO.class +com\mosty\common\task\mapper\SysTaskMapper.class +com\mosty\common\task\entity\vo\SysTaskCountToday.class +com\mosty\common\task\service\impl\SysTaskLogServiceImpl.class +com\mosty\common\task\constant\enums\ExecuteStatusEnum.class +com\mosty\common\task\constant\enums\LineChartTypeEnum.class +com\mosty\common\task\entity\SysTask.class +com\mosty\common\task\service\impl\SysTaskItemServiceImpl.class +com\mosty\common\task\constant\enums\RuleTypeEnum.class +com\mosty\common\task\constant\enums\TaskItemStatusEnum.class +com\mosty\common\task\controller\SysTaskController.class +com\mosty\common\task\mapper\SysTaskLogMapper.class +com\mosty\common\task\entity\vo\DetailSysTaskVO.class +com\mosty\common\task\entity\vo\AddSysTaskDeptVO.class +com\mosty\common\task\entity\vo\QueryTaskVO.class +com\mosty\common\task\service\SysTaskLogService.class +com\mosty\common\task\controller\SysTaskReportController.class +com\mosty\common\task\entity\vo\AddSysTaskUserInfoVO.class +com\mosty\common\task\entity\vo\QueryTaskLogVO.class +com\mosty\common\task\entity\vo\SysTaskCountGroup.class +com\mosty\common\task\constant\enums\ExecuteTypeEnum.class +com\mosty\common\task\entity\vo\SysTaskLogVO.class +com\mosty\common\task\service\SysTaskService.class +com\mosty\common\task\service\SysTaskItemService.class +com\mosty\common\task\entity\SysTaskLog.class +com\mosty\common\task\entity\vo\AddSysTaskVO.class +com\mosty\common\task\entity\vo\FinishSysTaskVO.class +com\mosty\common\task\TaskAutoConfiguration.class +com\mosty\common\task\service\impl\SysTaskServiceImpl.class +com\mosty\common\task\constant\enums\TaskLogStatusEnum.class +com\mosty\common\task\constant\enums\TaskTypeEnum.class +com\mosty\common\task\entity\SysTaskItem.class +com\mosty\common\task\mapper\SysTaskItemMapper.class +com\mosty\common\task\entity\vo\SysTaskItemVO.class diff --git a/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..9e89179 --- /dev/null +++ b/common-task-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,35 @@ +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\ExecuteTypeEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\SysTaskItemVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\LineChartTypeEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\mapper\SysTaskItemMapper.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\SysTaskLogVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\ExecuteStatusEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\SysTaskLineChartVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\SysTask.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\SysTaskItem.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\impl\SysTaskServiceImpl.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\FinishSysTaskVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\impl\SysTaskLogServiceImpl.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\SysTaskCountToday.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\controller\SysTaskReportController.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\SysTaskItemService.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\SysTaskLog.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\controller\SysTaskController.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\SysTaskService.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\RuleTypeEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\AddSysTaskVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\QueryTaskLogVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\DetailSysTaskVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\AddSysTaskDeptVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\TaskTypeEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\TaskAutoConfiguration.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\GroupCountTypeEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\TaskLogStatusEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\AddSysTaskUserInfoVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\QueryTaskVO.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\constant\enums\TaskItemStatusEnum.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\mapper\SysTaskMapper.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\SysTaskLogService.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\entity\vo\SysTaskCountGroup.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\service\impl\SysTaskItemServiceImpl.java +C:\tools\dy外网\mosty-common\common-task-starter\src\main\java\com\mosty\common\task\mapper\SysTaskLogMapper.java diff --git a/common-token-starter/common-token-starter.iml b/common-token-starter/common-token-starter.iml new file mode 100644 index 0000000..1f9f2a6 --- /dev/null +++ b/common-token-starter/common-token-starter.iml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common-token-starter/pom.xml b/common-token-starter/pom.xml new file mode 100644 index 0000000..bb7f2cb --- /dev/null +++ b/common-token-starter/pom.xml @@ -0,0 +1,84 @@ + + + + mosty-common + com.mosty + 1.0.0-SNAPSHOT + + 4.0.0 + + common-token-starter + + + 8 + 8 + + + + + com.mosty + common-base-starter + 1.0.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + true + + + com.alibaba + transmittable-thread-local + ${transmittable-version} + + + org.springframework.boot + spring-boot-starter-aop + ${spring-boot-dependencies.version} + true + + + com.auth0 + java-jwt + 3.8.1 + + + + org.projectlombok + lombok + 1.16.18 + provided + + + + com.vividsolutions + jts + 1.13 + + + + + + + mosty-nexus-releases + release version + http://10.64.201.126:8081/repository/maven-releases/ + + + mosty-nexus-snapshots + snapshots version + http://10.64.201.126:8081/repository/maven-snapshots/ + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + \ No newline at end of file diff --git a/common-token-starter/src/main/java/com/mosty/common/token/DeptInfo.java b/common-token-starter/src/main/java/com/mosty/common/token/DeptInfo.java new file mode 100644 index 0000000..5bdc8bb --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/DeptInfo.java @@ -0,0 +1,60 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.mosty.common.token; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 部门信息 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class DeptInfo implements Serializable { + + private static final long serialVersionUID = -2608276244908343842L; + + + @ApiModelProperty(value = "所属部门id") + private Long ssbmid; + + @ApiModelProperty(value = "所属部门") + private String ssbm; + + @ApiModelProperty(value = "所属部门代码") + private String ssbmdm; + + @ApiModelProperty(value = "所属县公安局") + private String ssxgaj; + + @ApiModelProperty(value = "所属县公安局id") + private Long ssxgajid; + + @ApiModelProperty(value = "所属县公安局代码") + private String ssxgajdm; + + @ApiModelProperty(value = "所属市公安局id") + private Long sssgajid; + + @ApiModelProperty(value = "所属市公安局") + private String sssgaj; + + @ApiModelProperty(value = "所属市公安局代码") + private String sssgajdm; + + @ApiModelProperty("权限等级(D_ZDY_SJQX)") + private String permissionsLevel; + + @ApiModelProperty("权限过滤条件ids") + private String ids; +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/JWTUtil.java b/common-token-starter/src/main/java/com/mosty/common/token/JWTUtil.java new file mode 100644 index 0000000..e2f1ab2 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/JWTUtil.java @@ -0,0 +1,102 @@ +package com.mosty.common.token; + +import cn.hutool.json.JSON; +import com.alibaba.fastjson.JSONObject; +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.TokenExpiredException; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.auth0.jwt.interfaces.JWTVerifier; +import com.mosty.common.base.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpStatus; + +import java.util.Date; + +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_ISSUER; +import static com.mosty.common.base.constant.SystemConfigConstants.TOKEN_KEY; + +/** + * token工具类 + * + * @author kevin + * @date 2022/3/21 11:03 PM + * @since 1.0.0 + */ +@Slf4j +public class JWTUtil { + public JWTUtil() { + } + + public static DecodedJWT verify(String token) { + try { + // 这里不判断token过期状态 +// Algorithm algorithm = Algorithm.HMAC256(TOKEN_KEY); +// JWTVerifier verifier = JWT.require(algorithm).withIssuer(new String[]{TOKEN_ISSUER}).build(); +// DecodedJWT decodedJWT = verifier.verify(token); +// +// Date expiresAt = decodedJWT.getExpiresAt(); +// if (expiresAt.before(new Date())) { +// log.info("token已过期"); +// } +// +// return expiresAt.after(new Date()) ? decodedJWT : null; + if(StringUtils.isNotEmpty(token)){ + Algorithm algorithm = Algorithm.HMAC256(TOKEN_KEY); + JWTVerifier verifier = JWT.require(algorithm).withIssuer(new String[]{TOKEN_ISSUER}).build(); + return verifier.verify(token); + } + return null; + } catch (TokenExpiredException expiredException) { + log.warn("token过期:{}", expiredException.getMessage()); + throw new BusinessException(HttpStatus.UNAUTHORIZED.value(), "token过期,请重新登陆", null); + } catch (Exception var11) { + var11.printStackTrace(); + log.error("解签失败: {}", var11.getMessage()); + return null; + } + } + + /** + * token 泛解析用户信息 + * + * @param token jwt token + * @return 用户信息 + */ + public static UserInfo getUserInfo(String token) { + DecodedJWT jwt = verify(token); + if (jwt == null) { + return null; + } + return new UserInfo( + jwt.getClaim("userId").asLong(), + jwt.getClaim("userName").asString(), + jwt.getClaim("phone").asString(), + jwt.getClaim("userLoginName").asString(), + jwt.getClaim("inDustRialId").asString(), + jwt.getClaim("idEntityCard").asString(), + jwt.getClaim("isVirtualUser").asString(), + jwt.getClaim("level").asString(), + jwt.getClaim("deptId").asLong(), + jwt.getClaim("deptName").asString(), + jwt.getClaim("deptCode").asString(), + jwt.getClaim("fxjDeptId").asLong(), + jwt.getClaim("fxjDeptName").asString(), + jwt.getClaim("fxjDeptCode").asString(), + jwt.getClaim("dszDeptId").asLong(), + jwt.getClaim("dszDeptName").asString(), + jwt.getClaim("dszDeptCode").asString(), + jwt.getClaim("deptLevel").asString(), + jwt.getClaim("deptBizType").asString(), + JSONObject.parseObject(jwt.getClaim("permissions").asString(), UserPermissionsInfo.class) + ); + } + + public static void main(String[] args) { + UserInfo res = getUserInfo("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6Inprai1mcG0tc3RvcmVhZG1pbiIsImV4cCI6MTYyODMzMTE1NCwiaWF0IjoxNjI3ODk5MTU0LCJ1c2VySWQiOjUzfQ.hJ25t46zntTUknwjsB0UJzOIFcM5n7IG0DDA6RVP8jM"); + System.out.println(res); + } + +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/JwtSysUser.java b/common-token-starter/src/main/java/com/mosty/common/token/JwtSysUser.java new file mode 100644 index 0000000..6993965 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/JwtSysUser.java @@ -0,0 +1,25 @@ +package com.mosty.common.token; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 用户信息泛解析标识 + * @author kevin + * @date 2022/2/16 1:17 PM + * @since 1.0.0 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface JwtSysUser { + + /** + * 用户realm,方便后续扩展 + * @return 用户 + */ + String value() default ""; +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/SysUserInterceptor.java b/common-token-starter/src/main/java/com/mosty/common/token/SysUserInterceptor.java new file mode 100644 index 0000000..6440e24 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/SysUserInterceptor.java @@ -0,0 +1,129 @@ +package com.mosty.common.token; + +import com.mosty.common.base.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.lang.Nullable; +import org.springframework.util.StringUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.annotation.PostConstruct; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Method; + +/** + * token解析器 + * @author kevin + * @date 2022/3/21 11:12 PM + * @since 1.0.0 + */ +@Slf4j +@SuppressWarnings("unused") +public class SysUserInterceptor implements HandlerInterceptor { + public SysUserInterceptor() { + } + + @PostConstruct + public void init() { + } + + public boolean preHandle(@Nullable HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Object handler){ + if (!(handler instanceof HandlerMethod)) { + return true; + }else{ + HandlerMethod handlerMethod =(HandlerMethod)handler; + Method method = handlerMethod.getMethod(); + JwtSysUser sysUser =(JwtSysUser)method.getAnnotation(JwtSysUser.class); + + if(sysUser == null) { + sysUser = (JwtSysUser) method.getDeclaringClass().getAnnotation(JwtSysUser.class); + } + if (sysUser == null) { + return true; + }else { + UserInfo info = this.getUserInfoFromJwtToken(request, sysUser); + if(info == null){ + throw new BusinessException(401,"登录过期,请重新登录!!",(Object)null); + } else { + UserInfoManager.set(info); + return true; + } + } + + } + + } + + public void afterCompletion(@Nullable HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Object handler, Exception ex) { + UserInfoManager.clear(); + } + + private boolean setUserInfo(UserInfo info, JwtSysUser sysUser) { +// if (this.mockUserInfo) { +// return true; +// } + +// UserInfoResp resp = this.userInfoCache.getUserInfo(info.getUserId(), sysUser.value()); +// if (resp == null) { +// return false; +// } else { +// info.setMerchantId(resp.getMerchantId()); +// info.setMobile(resp.getMobile()); +// info.setUsername(resp.getUsername()); +// info.setAccount(resp.getAccount()); +// info.setStatus(resp.getStatus()); +// info.setEmail(resp.getEmail()); +// info.setSystemType(SystemTypeEnum.toEnum(resp.getSystem())); +// info.setUserInfoType(UserInfoTypeEnum.toEnum(resp.getType())); +// return true; +// } + return true; + } + + private UserInfo getUserInfoFromJwtToken(HttpServletRequest request, JwtSysUser sysUser) { + try { + String token = request.getHeader("token"); + if (token == null) { + token = request.getHeader("Authorization"); + } + + if (!StringUtils.isEmpty(token)) { + return JWTUtil.getUserInfo(token); + } + } catch (Exception e) { + log.error("解析token异常", e); + } + return null; + } + + private void writeNeedLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { + this.assemblyResponse(request, response, "用户未登录!", HttpStatus.UNAUTHORIZED, "BIZ.USER_NOT_LOGIN"); + } + + private void writeException(HttpServletRequest request, HttpServletResponse response) throws IOException { + this.assemblyResponse(request, response, "网络异常,请稍后再试", HttpStatus.OK, "BIZ.BUSSINESS_EXCEPTION"); + } + + private void assemblyResponse(HttpServletRequest request, HttpServletResponse response, String errorMsg, HttpStatus unauthorized, String userNotLogin) throws IOException { + response.setContentType("application/json;charset=UTF-8"); + response.setStatus(unauthorized.value()); + String origin = request.getHeader("Origin"); + if (origin == null) { + response.addHeader("Access-Control-Allow-Origin", "*"); + } else { + response.addHeader("Access-Control-Allow-Origin", origin); + } + + response.addHeader("Access-Control-Allow-Headers", "*"); + response.addHeader("Access-Control-Allow-Credentials", "true"); + response.addHeader("Access-Control-Allow-Methods", "GET,POST,PUT,OPTIONS,DELETE"); + PrintWriter writer = response.getWriter(); +// writer.write(JSON.toJSONString(new ResponseResult(userNotLogin, errorMsg))); + writer.flush(); + writer.close(); + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/UserInfo.java b/common-token-starter/src/main/java/com/mosty/common/token/UserInfo.java new file mode 100644 index 0000000..0dd335a --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/UserInfo.java @@ -0,0 +1,91 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.mosty.common.token; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * 用户信息 + * + * @author kevin + * @date 2022/2/16 1:24 PM + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@AllArgsConstructor +public class UserInfo implements Serializable { + + private static final long serialVersionUID = -2608276244908343842L; + + @ApiModelProperty(value = "用户id") + public final Long userId; + + @ApiModelProperty(value = "用户名") + public final String userName; + + @ApiModelProperty(value = "用户电话") + public final String phone; + + @ApiModelProperty(value = "用户账号") + public final String userLoginName; + + @ApiModelProperty(value = "用户行业号码") + public final String inDustRialId; + + @ApiModelProperty(value = "用户身份证号") + public final String idEntityCard; + + @ApiModelProperty(value = "是否虚拟用户") + public final String isVirtualUser; + + @ApiModelProperty(value = "数据权限范围") + public final String level; + + @ApiModelProperty(value = "部门id") + public final Long deptId; + + @ApiModelProperty(value = "部门名称") + public final String deptName; + + @ApiModelProperty(value = "部门编码") + public final String deptCode; + + @ApiModelProperty(value = "分县局部门id") + public final Long fxjDeptId; + + @ApiModelProperty(value = "分县局部门名称") + public final String fxjDeptName; + + @ApiModelProperty(value = "分县局部门编码") + public final String fxjDeptCode; + + @ApiModelProperty(value = "地市州部门id") + public final Long dszDeptId; + + @ApiModelProperty(value = "地市州部门名称") + public final String dszDeptName; + + @ApiModelProperty(value = "地市州部门编码") + public final String dszDeptCode; + + @ApiModelProperty(value = "部门等级") + public final String deptLevel; + + @ApiModelProperty(value = "所在部门业务类型代码") + public final String deptBizType; + + @ApiModelProperty(value = "用户数据权限SQL") + public final UserPermissionsInfo userPermissionsInfo; + +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/UserInfoCache.java b/common-token-starter/src/main/java/com/mosty/common/token/UserInfoCache.java new file mode 100644 index 0000000..4122dc8 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/UserInfoCache.java @@ -0,0 +1,69 @@ +//package com.mosty.common.token; +// +//import com.google.common.base.Function; +//import com.google.common.cache.CacheBuilder; +//import com.google.common.cache.CacheLoader; +//import com.google.common.cache.LoadingCache; +//import java.util.HashMap; +//import java.util.Map; +//import java.util.concurrent.TimeUnit; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.stereotype.Component; +//import org.springframework.util.StringUtils; +// +//@Component +//public class UserInfoCache { +// private static final Logger log = LoggerFactory.getLogger(UserInfoCache.class); +// private static final String KEY_MID = "_"; +// private final Map>> func = new HashMap(); +// private final LoadingCache cache; +// +// public UserInfoCache(StoreUserInfoClient storeUserInfoClient, PlatformUserInfoClient platformUserInfoClient) { +// this.cache = CacheBuilder.newBuilder().maximumSize(10000L).expireAfterWrite(3L, TimeUnit.MINUTES).build(new CacheLoader() { +// public UserInfoResp load(String key) { +// if (StringUtils.isEmpty(key)) { +// return null; +// } else { +// String[] vs = key.split("_"); +// Integer type = Integer.valueOf(vs[0]); +// Integer userId = Integer.valueOf(vs[1]); +// UserType userType = UserType.toEnum(type); +// if (userType == null) { +// UserInfoCache.log.error("用户类型正确,type:{},userId:{}", type, userId); +// return null; +// } else { +// ResponseResult result = (ResponseResult)((Function)UserInfoCache.this.func.get(type)).apply(userId); +// if (result != null) { +// if (result.isSuccess()) { +// return (UserInfoResp)result.getData(); +// } +// +// UserInfoCache.log.error("调用{}后台用户失败:{},{}", new Object[]{userType.getName(), userId, result.getMessage()}); +// } +// +// return null; +// } +// } +// } +// }); +// if (storeUserInfoClient != null && platformUserInfoClient != null) { +// this.func.put(UserType.store.getValue(), storeUserInfoClient::getUserInfo); +// this.func.put(UserType.platform.getValue(), platformUserInfoClient::getUserInfo); +// } +// +// } +// +// public UserInfoResp getUserInfo(Integer userId, UserType userType) { +// if (userId != null && userType != null) { +// try { +// return (UserInfoResp)this.cache.getUnchecked(userType.value + "_" + userId); +// } catch (Exception var4) { +// log.error("key:{}/{} err", new Object[]{userId, userType, var4}); +// return null; +// } +// } else { +// return null; +// } +// } +//} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/UserInfoManager.java b/common-token-starter/src/main/java/com/mosty/common/token/UserInfoManager.java new file mode 100644 index 0000000..36ac8c7 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/UserInfoManager.java @@ -0,0 +1,34 @@ +package com.mosty.common.token; + +import com.alibaba.ttl.TransmittableThreadLocal; +import com.mosty.common.base.exception.BusinessException; + +public class UserInfoManager { + + /** + * 用户信息 + */ + private static final ThreadLocal USER_CONTEXT = TransmittableThreadLocal.withInitial(() -> null); + + public UserInfoManager() {} + + public static void set(UserInfo userInfo) { + USER_CONTEXT.set(userInfo); + } + + public static void clear() { + USER_CONTEXT.remove(); + } + + public static UserInfo get() { + UserInfo user = USER_CONTEXT.get(); + if (user == null) { + throw new BusinessException("登录信息获取异常,请重新登录!!"); + } + return user; + } + + public static UserInfo getUser() { + return USER_CONTEXT.get(); + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/UserPermissionsInfo.java b/common-token-starter/src/main/java/com/mosty/common/token/UserPermissionsInfo.java new file mode 100644 index 0000000..a19312d --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/UserPermissionsInfo.java @@ -0,0 +1,36 @@ +package com.mosty.common.token; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 用户权限信息 + * @author Lhh + * @date 2022/06/27 17:24 + * @since 1.0.0 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class UserPermissionsInfo { + + @ApiModelProperty("权限过滤条件ids") + private String ids; + + @ApiModelProperty("权限过滤条件orgcodes") + private String orgcodes; + + @ApiModelProperty("权限等级(D_ZDY_SJQX)") + private String permissionsLevel; + + @ApiModelProperty("权限SQL(ssbmid)") + private String permissionsSql; + + @ApiModelProperty("权限SQL(ssbmdm)") + private String permissionsSqlCode; + +} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/UserType.java b/common-token-starter/src/main/java/com/mosty/common/token/UserType.java new file mode 100644 index 0000000..190eb97 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/UserType.java @@ -0,0 +1,28 @@ +//package com.mosty.common.token; +// +//import com.aimart.common.base.BaseEnum; +// +//public enum UserType implements BaseEnum { +// store(1, "商家/门店后台"), +// platform(2, "平台后台"); +// +// public final int value; +// public final String name; +// +// public int getValue() { +// return this.value; +// } +// +// public String getName() { +// return this.name; +// } +// +// public static UserType toEnum(Integer value) { +// return (UserType)BaseEnum.toEnum(value, UserType.class); +// } +// +// private UserType(int value, String name) { +// this.value = value; +// this.name = name; +// } +//} diff --git a/common-token-starter/src/main/java/com/mosty/common/token/VirtualUserEnum.java b/common-token-starter/src/main/java/com/mosty/common/token/VirtualUserEnum.java new file mode 100644 index 0000000..bb5625f --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/token/VirtualUserEnum.java @@ -0,0 +1,43 @@ +package com.mosty.common.token; + +import lombok.AllArgsConstructor; + +/** + * 虚拟用户标识 + * @author kevin + * @date 2022/2/25 9:52 AM + * @since 1.0.0 + */ +@AllArgsConstructor +public enum VirtualUserEnum { + + /** 正常用户 */ + NATURE(1, "正常用户"), + + /** 虚拟用户 */ + VIRTUAL(2, "虚拟状态"); + + /** 编码 */ + public final Integer code; + + /** 描述 */ + public final String desc; + + /** + * 编码匹配 用户类型 + * @param code 编码 + * @return 虚拟用户枚举 + */ + public static VirtualUserEnum valueOf(Integer code) { + if (code == null) { + return null; + } + for (VirtualUserEnum virtualUserEnum : VirtualUserEnum.values()) { + if (virtualUserEnum.code.equals(code)) { + return virtualUserEnum; + } + } + return null; + } + +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/DataPermissionConstant.java b/common-token-starter/src/main/java/com/mosty/common/util/DataPermissionConstant.java new file mode 100644 index 0000000..b16fa82 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/DataPermissionConstant.java @@ -0,0 +1,27 @@ +package com.mosty.common.util; + +import lombok.AllArgsConstructor; + +/** + * 菜单类型枚举 + * @author kevin + * @date 2022/2/22 12:53 PM + * @since 1.0.0 + */ +@AllArgsConstructor +public class DataPermissionConstant { + + // 全部数据权限 + public static final String DATA_SCOPE_ALL = "1"; + // 市级数据权限 + public static final String DATA_SCOPE_CITY = "2"; + // 县级数据权限 + public static final String DATA_SCOPE_COUNTY = "3"; + // 部门及以下数据权限 + public static final String DATA_SCOPE_DEPT_AND_CHILD = "4"; + // 部门数据权限 + public static final String DATA_SCOPE_DEPT = "5"; + // 仅本人数据权限 + public static final String DATA_SCOPE_SELF = "99"; + +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/GeoHashKit.java b/common-token-starter/src/main/java/com/mosty/common/util/GeoHashKit.java new file mode 100644 index 0000000..c69fe1f --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/GeoHashKit.java @@ -0,0 +1,139 @@ +package com.mosty.common.util; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +/** + * @author dw + * @since 2022/7/19 + * 经纬度相关工具 + **/ +public class GeoHashKit { + private static final char[] _base32 = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; + + private final static Map _decodemap = new HashMap<>(); + + private static final int[] bits = {16, 8, 4, 2, 1}; + + static { + int sz = _base32.length; + for (int i = 0; i < sz; i++) { + _decodemap.put(_base32[i], i); + } + } + + + public static void main(String[] args) { + String gc1 = encode(new BigDecimal("39.916527"), new BigDecimal("116.397128")); + System.out.println(gc1); + BigDecimal[] gd1 = decode(gc1); + System.out.println(gd1[0] + ", " + gd1[1]); + } + + + /** + * 经纬度换算geoHash + * + * @param lat + * @param lon + * @return + */ + public static String encode(BigDecimal lat, BigDecimal lon) { + double latitude = lat.doubleValue(); + double longitude = lon.doubleValue(); + double[] lat_interval = {-90.0, 90.0}; + double[] lon_interval = {-180.0, 180.0}; + StringBuilder geohash = new StringBuilder(); + boolean is_even = true; + int bit = 0, ch = 0; + int precision = 12; + while (geohash.length() < precision) { + double mid; + if (is_even) { + mid = (lon_interval[0] + lon_interval[1]) / 2; + if (longitude > mid) { + ch |= bits[bit]; + lon_interval[0] = mid; + } else { + lon_interval[1] = mid; + } + } else { + mid = (lat_interval[0] + lat_interval[1]) / 2; + if (latitude > mid) { + ch |= bits[bit]; + lat_interval[0] = mid; + } else { + lat_interval[1] = mid; + } + } + is_even = !is_even; + if (bit < 4) { + bit++; + } else { + geohash.append(_base32[ch]); + bit = 0; + ch = 0; + } + } + return geohash.toString(); + } + + + public static BigDecimal[] decode(String geohash) { + double[] ge = decode_exactly(geohash); + double lat, lon, lat_err, lon_err; + lat = ge[0]; + lon = ge[1]; + lat_err = ge[2]; + lon_err = ge[3]; + double lat_precision = Math.max(1, Math.round(-Math.log10(lat_err))) - 1; + double lon_precision = Math.max(1, Math.round(-Math.log10(lon_err))) - 1; + lat = getPrecision(lat, lat_precision); + lon = getPrecision(lon, lon_precision); + return new BigDecimal[]{new BigDecimal(lat), new BigDecimal(lon)}; + } + + + public static double[] decode_exactly(String geohash) { + double[] lat_interval = {-90.0, 90.0}; + double[] lon_interval = {-180.0, 180.0}; + double lat_err = 90.0; + double lon_err = 180.0; + boolean is_even = true; + int sz = geohash.length(); + int bsz = bits.length; + double latitude, longitude; + for (int i = 0; i < sz; i++) { + int cd = _decodemap.get(geohash.charAt(i)); + for (int mask : bits) { + if (is_even) { + lon_err /= 2; + if ((cd & mask) != 0) { + lon_interval[0] = (lon_interval[0] + lon_interval[1]) / 2; + } else { + lon_interval[1] = (lon_interval[0] + lon_interval[1]) / 2; + } + } else { + lat_err /= 2; + if ((cd & mask) != 0) { + lat_interval[0] = (lat_interval[0] + lat_interval[1]) / 2; + } else { + lat_interval[1] = (lat_interval[0] + lat_interval[1]) / 2; + } + } + is_even = !is_even; + } + } + latitude = (lat_interval[0] + lat_interval[1]) / 2; + longitude = (lon_interval[0] + lon_interval[1]) / 2; + return new double[]{latitude, longitude, lat_err, lon_err}; + } + + + static double getPrecision(double x, double precision) { + double base = Math.pow(10, -precision); + double diff = x % base; + return x - diff; + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/ImageUtils.java b/common-token-starter/src/main/java/com/mosty/common/util/ImageUtils.java new file mode 100644 index 0000000..ce4f249 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/ImageUtils.java @@ -0,0 +1,547 @@ +package com.mosty.common.util; + + +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import sun.misc.BASE64Encoder; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; +import javax.net.ssl.*; +import java.awt.*; +import java.awt.color.ColorSpace; +import java.awt.geom.AffineTransform; +import java.awt.image.*; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.Arrays; +import java.util.Iterator; + +/** + * 图片处理类
+ * + * @author Esacpe + * @version 2014-8-22 + */ + +public class ImageUtils { + + private static final Logger log = LoggerFactory.getLogger(ImageUtils.class); + + + + public static byte[] getImage(String imagePath) + { + InputStream is = getFile(imagePath); + try + { + return IOUtils.toByteArray(is); + } + catch (Exception e) + { + log.error("图片加载异常 {}", e); + return null; + } + finally + { + IOUtils.closeQuietly(is); + } + } + + public static InputStream getFile(String imagePath) + { + try + { + byte[] result = readFile(imagePath); + result = Arrays.copyOf(result, result.length); + return new ByteArrayInputStream(result); + } + catch (Exception e) + { + log.error("获取图片异常 {}", e); + } + return null; + } + + /** + * 读取文件为字节数据 + * + * @param url 地址 + * @return 字节数据 + */ + public static byte[] readFile(String url) + { + InputStream in = null; + try + { + // 网络地址 + URL urlObj = new URL(url); + URLConnection urlConnection = urlObj.openConnection(); + urlConnection.setConnectTimeout(30 * 1000); + urlConnection.setReadTimeout(60 * 1000); + urlConnection.setDoInput(true); + in = urlConnection.getInputStream(); + return IOUtils.toByteArray(in); + } + catch (Exception e) + { + log.error("访问文件异常 {}", e); + return null; + } + finally + { + IOUtils.closeQuietly(in); + } + } + + + /** + * 将图片缩放处理方法
+ * + * @param source 源图片对象 + * @param targetW 转换后的宽度 + * @param targetH 转换后的高度 + * @param sameScale 是否等比例缩放 + * @return BufferedImage + */ + public static BufferedImage resize(BufferedImage source, int targetW, + int targetH, boolean sameScale) { // targetW,targetH分别表示目标长和宽 + int type = source.getType(); + BufferedImage target = null; + double sx = (double) targetW / source.getWidth(); + double sy = (double) targetH / source.getHeight(); + if (sameScale) { // 需要等比例缩放 + if (sx > sy) { + sx = sy; + targetW = (int) (sx * source.getWidth()); + } else { + sy = sx; + targetH = (int) (sy * source.getHeight()); + } + } + if (type == BufferedImage.TYPE_CUSTOM) { // handmade + ColorModel cm = source.getColorModel(); + WritableRaster raster = cm.createCompatibleWritableRaster(targetW, + targetH); + boolean alphaPremultiplied = cm.isAlphaPremultiplied(); + target = new BufferedImage(cm, raster, alphaPremultiplied, null); + } else { + target = new BufferedImage(targetW, targetH, type); + } + Graphics2D g = target.createGraphics(); + // smoother than exlax: + g.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g.drawRenderedImage(source, AffineTransform.getScaleInstance(sx, sy)); + g.dispose(); + return target; + } + + /** + * 将图片放大与缩小
+ * + * @param sourceByte 源图片的字节数组 + * @param width 转换后的宽度 + * @param height 转换后的高度 + * @param sameScale 是否等比例缩放 + * @return byte[] + */ + public static byte[] convertImageSize(byte[] sourceByte, int width, + int height, boolean sameScale) throws Exception { + byte[] returnValue = null; + if (sourceByte != null && sourceByte.length > 0) { + ByteArrayInputStream in = new ByteArrayInputStream(sourceByte); + // BufferedImage srcImage = getReadImage(in); + BufferedImage srcImage = null; + try { + srcImage = ImageIO.read(in); // RGB + } catch (Exception e) { + } + if (srcImage != null) { + BufferedImage srcImageTarget = resize(srcImage, width, height, + sameScale); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + boolean flag = ImageIO.write(srcImageTarget, "JPEG", out); + returnValue = out.toByteArray(); + } + } + return returnValue; + } + + /** + * 将图片放大与缩小后另存
+ * + * @param fromFileStr 来源文件名 + * @param saveToFileStr 目标文件名 + * @param width 转换后的宽度 + * @param height 转换后的高度 + * @param sameScale 是否等比例缩放 + */ + public static void saveImageAsJpg(String fromFileStr, String saveToFileStr, + int width, int height, boolean sameScale) throws Exception { + String imgType = "JPEG"; + if (fromFileStr.toLowerCase().endsWith(".png")) { + imgType = "PNG"; + } + File saveFile = new File(saveToFileStr); + File fromFile = new File(fromFileStr); + BufferedImage srcImage = getReadImage(fromFile); + if (srcImage != null) { + if (width > 0 || height > 0) { + srcImage = resize(srcImage, width, height, sameScale); + } + ImageIO.write(srcImage, imgType, saveFile); + } + } + + /** + * 根据文件取得bufferedImage对象(自动识别RGB与CMYK)
+ * + * @param file 来源文件名 + * @return BufferedImage + */ + private static BufferedImage getReadImage(File file) throws Exception { + BufferedImage srcImage = null; + ImageInputStream input = ImageIO.createImageInputStream(file); // 只能接收File或FileInputStream,ByteArrayInputStream无效 + Iterator readers = ImageIO.getImageReaders(input); + if (readers == null || !readers.hasNext()) { + throw new RuntimeException("1 No ImageReaders found"); + } + ImageReader reader = (ImageReader) readers.next(); + reader.setInput(input); + String format = reader.getFormatName(); + if ("JPEG".equalsIgnoreCase(format) || "JPG".equalsIgnoreCase(format)) { + try { + srcImage = ImageIO.read(file); // RGB + } catch (Exception e) { + Raster raster = reader.readRaster(0, null);// CMYK + srcImage = createJPEG4(raster); + } + input.close(); + } + return srcImage; + } + + /** + * RGB彩色空间转换为CMYK
+ * + * @param raster + * @return BufferedImage + */ + private static BufferedImage createJPEG4(Raster raster) { + int w = raster.getWidth(); + int h = raster.getHeight(); + byte[] rgb = new byte[w * h * 3]; // 彩色空间转换 + float[] Y = raster.getSamples(0, 0, w, h, 0, (float[]) null); + float[] Cb = raster.getSamples(0, 0, w, h, 1, (float[]) null); + float[] Cr = raster.getSamples(0, 0, w, h, 2, (float[]) null); + float[] K = raster.getSamples(0, 0, w, h, 3, (float[]) null); + for (int i = 0, imax = Y.length, base = 0; i < imax; i++, base += 3) { + float k = 220 - K[i], y = 255 - Y[i], cb = 255 - Cb[i], cr = 255 - Cr[i]; + double val = y + 1.402 * (cr - 128) - k; + val = (val - 128) * .65f + 128; + rgb[base] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff + : (byte) (val + 0.5); + val = y - 0.34414 * (cb - 128) - 0.71414 * (cr - 128) - k; + val = (val - 128) * .65f + 128; + rgb[base + 1] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff + : (byte) (val + 0.5); + val = y + 1.772 * (cb - 128) - k; + val = (val - 128) * .65f + 128; + rgb[base + 2] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff + : (byte) (val + 0.5); + } + raster = Raster.createInterleavedRaster(new DataBufferByte(rgb, + rgb.length), w, h, w * 3, 3, new int[]{0, 1, 2}, null); + ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); + ColorModel cm = new ComponentColorModel(cs, false, true, + Transparency.OPAQUE, DataBuffer.TYPE_BYTE); + return new BufferedImage(cm, (WritableRaster) raster, true, null); + } + + public static byte[] encodeImageTobyte(String url) { + //打开链接 + try { + URL urls = new URL(url); + HttpURLConnection conn = null; + + conn = (HttpURLConnection) urls.openConnection(); + //设置请求方式为"GET" + conn.setRequestMethod("GET"); + //超时响应时间为5秒 + conn.setConnectTimeout(5 * 1000); + //通过输入流获取图片数据 + InputStream inStream = conn.getInputStream(); + //得到图片的二进制数据,以二进制封装得到数据,具有通用性 + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while ((len = inStream.read(buffer)) != -1) { + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + //关闭输入流 + inStream.close(); + byte[] data = outStream.toByteArray(); + return data;//返回Base64编码过的字节数组字符串 + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + + /** + * 网络图片转成base64 https + * + * @param url + * @return + * @throws Exception + */ + public static byte[] encodeImageToByteHttps(String url) { + byte[] data = null; + try { + SSLContext sslcontext = SSLContext.getInstance("SSL", "SunJSSE"); + sslcontext.init(null, new TrustManager[]{new MyX509TrustManager()}, new java.security.SecureRandom()); + URL urls = new URL(url); + HostnameVerifier ignoreHostnameVerifier = new HostnameVerifier() { + public boolean verify(String s, SSLSession sslsession) { + System.out.println("WARNING: Hostname is not matched for cert."); + return true; + } + }; + HttpsURLConnection.setDefaultHostnameVerifier(ignoreHostnameVerifier); + HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory()); + //之后任何Https协议网站皆能正常访问,同第一种情况 + HttpURLConnection conn = null; + + conn = (HttpURLConnection) urls.openConnection(); + //设置请求方式为"GET" + conn.setRequestMethod("GET"); + //超时响应时间为5秒 + conn.setConnectTimeout(5 * 1000); + if (conn.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM) { + String location = conn.getHeaderField("Location"); + byte[] data1 = encodeImageToByteHttps(location.trim()); + if (null != data && data1.length > 0) { + return data1; + } + + } else { + //通过输入流获取图片数据 + InputStream inStream = conn.getInputStream(); + //得到图片的二进制数据,以二进制封装得到数据,具有通用性 + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while ((len = inStream.read(buffer)) != -1) { + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + //关闭输入流 + inStream.close(); + data = outStream.toByteArray(); + + } + } catch (Exception e) { + System.out.println("解析失败!------》" + e.getMessage()); + } + return data; + } + + + /** + * 网络图片转成base64 https + * + * @param url + * @return + * @throws Exception + */ + public static String encodeImageToBase64Https(String url) { + String base64 = null; + try { + SSLContext sslcontext = SSLContext.getInstance("SSL", "SunJSSE"); + sslcontext.init(null, new TrustManager[]{new MyX509TrustManager()}, new java.security.SecureRandom()); + URL urls = new URL(url); + HostnameVerifier ignoreHostnameVerifier = new HostnameVerifier() { + public boolean verify(String s, SSLSession sslsession) { + System.out.println("WARNING: Hostname is not matched for cert."); + return true; + } + }; + HttpsURLConnection.setDefaultHostnameVerifier(ignoreHostnameVerifier); + HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory()); + //之后任何Https协议网站皆能正常访问,同第一种情况 + HttpURLConnection conn = null; + + conn = (HttpURLConnection) urls.openConnection(); + //设置请求方式为"GET" + conn.setRequestMethod("GET"); + //超时响应时间为5秒 + conn.setConnectTimeout(5 * 1000); + if (conn.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM) { + String location = conn.getHeaderField("Location"); + String s = encodeImageToBase64Https(location.trim()); + if (StringUtils.isNotBlank(s)) { + return s; + } + + } else { + //通过输入流获取图片数据 + InputStream inStream = conn.getInputStream(); + //得到图片的二进制数据,以二进制封装得到数据,具有通用性 + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while ((len = inStream.read(buffer)) != -1) { + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + //关闭输入流 + inStream.close(); + byte[] data = outStream.toByteArray(); + //对字节数组Base64编码 + BASE64Encoder encoder = new BASE64Encoder(); + base64 = encoder.encode(data).replaceAll("[\\s*\t\n\r]", ""); + } + } catch (Exception e) { + System.out.println("解析失败!------》" + e.getMessage()); + } + return base64; + } + + /** + * 网络图片转成base64 + * + * @param url + * @return + * @throws Exception + */ + public static String encodeImageToBase64(String url) throws Exception { + //打开链接 + URL urls = new URL(url); + HttpURLConnection conn; + try { + conn = (HttpURLConnection) urls.openConnection(); + //设置请求方式为"GET" + conn.setRequestMethod("GET"); + //超时响应时间为5秒 + conn.setConnectTimeout(5 * 1000); + //通过输入流获取图片数据 + InputStream inStream = conn.getInputStream(); + //得到图片的二进制数据,以二进制封装得到数据,具有通用性 + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while ((len = inStream.read(buffer)) != -1) { + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + //关闭输入流 + inStream.close(); + byte[] data = outStream.toByteArray(); + //对字节数组Base64编码 + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(data).replaceAll("[\\s*\t\n\r]", ""); + } catch (IOException e) { + e.printStackTrace(); + throw new Exception("解析失败!"); + } + } + + public static String ImageToBase64(String imgPath) { + byte[] data = null; + try { + InputStream in = new FileInputStream(imgPath); + data = new byte[in.available()]; + in.read(data); + in.close(); + } catch (Exception e) { + e.printStackTrace(); + } +// return StringUtils.replaceBlank(StringUtils.getByteToBase64(data)); + return ""; + } + + /** + * 网络图片转成base64 + * + * @param url + * @return + * @throws Exception + */ + public static byte[] encodeImageToByte(String url) throws Exception { + //打开链接 + URL urls = new URL(url); + HttpURLConnection conn = null; + try { + conn = (HttpURLConnection) urls.openConnection(); + //设置请求方式为"GET" + conn.setRequestMethod("GET"); + //超时响应时间为5秒 + conn.setConnectTimeout(5 * 1000); + //通过输入流获取图片数据 + InputStream inStream = conn.getInputStream(); + //得到图片的二进制数据,以二进制封装得到数据,具有通用性 + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while ((len = inStream.read(buffer)) != -1) { + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + //关闭输入流 + inStream.close(); + byte[] data = outStream.toByteArray(); + return data; + } catch (IOException e) { + e.printStackTrace(); + throw new Exception("解析失败!"); + } + } + + + + + public static void main(String argv[]) throws Exception{ +// ImageUtils.saveImageAsJpg("C:/test.jpg", "c:/test2.jpg", 179, 220, +// true); + + // String s = ImageUtils.ImageToBase64("C:\\Users\\admin\\Desktop\\ryxp.jpg"); +// System.out.println(s); +// String str = "normal://repository-builder/20190628/ehlZxEcjZp09UubZQugxug==@11"; +// //编码加密 +// String encodeStr = Base64.getEncoder().encodeToString(str.getBytes("UTF-8")); +// System.out.println("加密后的字符串为:" + encodeStr); +// //解码解密 +// String decoderStr = new String(Base64.getDecoder().decode(encodeStr), StandardCharsets.UTF_8); // +// // 推荐使用StandardCharsets类指定 +// System.out.println("解密后的字符串为" + decoderStr); + + + + String tp="http://10.64.201.128:7266/xlpcAdminNew/requestservice/czrk/ryxp.jpg?sfzh=510502195403065021"; + String s = ImageUtils.encodeImageToBase64(tp); + System.out.println(s); + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/JtsUtils.java b/common-token-starter/src/main/java/com/mosty/common/util/JtsUtils.java new file mode 100644 index 0000000..b20bfce --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/JtsUtils.java @@ -0,0 +1,206 @@ +package com.mosty.common.util; + +import com.vividsolutions.jts.geom.*; +import com.vividsolutions.jts.linearref.LengthIndexedLine; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.List; + +public class JtsUtils { + private static final double EARTH_RADIUS = 6378137; + public static GeometryFactory factory = new GeometryFactory(new PrecisionModel(100000000000d)); + private static final DecimalFormat df = new DecimalFormat("0.00000000000"); + private static final DecimalFormat format = new DecimalFormat("0.0000"); + + public static String toEwkt(Geometry geom) { + if (geom == null) { + return null; + } + String type = geom.getGeometryType().toUpperCase(); + switch (type) { + case "POINT": { + Coordinate coor = geom.getCoordinate(); + return "POINT(" + formatCoordinate(coor) + ")"; + } + case "MULTIPOINT": { + return coordinateToEwkt("MULTIPOINT(", geom.getCoordinates(), ")"); + } + case "LINESTRING": { + return coordinateToEwkt("LINESTRING(", geom.getCoordinates(), ")"); + } + case "POLYGON": { + return coordinateToEwkt("POLYGON((", geom.getCoordinates(), "))"); + } + case "MULTILINESTRING": { + StringBuffer sb = new StringBuffer(); + sb.append("MULTILINESTRING("); + sb.append(multiGeometryFormat(geom)); + sb.append(")"); + return sb.toString(); + } + case "MULTIPOLYGON": { + StringBuffer sb = new StringBuffer(); + sb.append("MULTIPOLYGON("); + sb.append(multiGeometryFormat(geom)); + sb.append(")"); + return sb.toString(); + } + case "GEOMETRYCOLLECTION": { + StringBuffer sb = new StringBuffer(); + int num = geom.getNumGeometries(); + sb.append("GEOMETRYCOLLECTION("); + for (int j = 0; j < num; j++) { + Geometry element = geom.getGeometryN(j); + String subType = element.getGeometryType().toUpperCase(); + if ("POINT".equals(subType)) { + sb.append("POINT(" + formatCoordinate(element.getCoordinate()) + ")"); + } else if ("LINESTRING".equals(subType)) { + sb.append(coordinateToEwkt("LINESTRING(", element.getCoordinates(), ")")); + } else if ("POLYGON".equals(subType)) { + sb.append(coordinateToEwkt("POLYGON((", element.getCoordinates(), "))")); + } + if (j < num - 1) { + sb.append(","); + } + } + sb.append(")"); + return sb.toString(); + } + } + return null; + } + + private static String formatCoordinate(Coordinate coordinate) { + return df.format(coordinate.x) + " " + df.format(coordinate.y); + } + + public static String coordinateToEwkt(String prefix, Coordinate[] coordinates, String suffix) { + StringBuffer sb = new StringBuffer(); + sb.append(prefix); + boolean append = false; + for (Coordinate coordinate : coordinates) { + if (append) { + sb.append(","); + } + sb.append(formatCoordinate(coordinate)); + append = true; + } + sb.append(suffix); + return sb.toString(); + } + + public static String multiGeometryFormat(Geometry geom) { + StringBuffer sb = new StringBuffer(); + int num = geom.getNumGeometries(); + for (int i = 0; i < num; i++) { + Geometry g = geom.getGeometryN(i); + sb.append(coordinateToEwkt("((", g.getCoordinates(), "))")); + if (i < num - 1) { + sb.append(","); + } + } + return sb.toString(); + } + + /** + * 获取两组成的线的几何中心 + * + * @param s 起始点 + * @param e 结束点 + * @return + */ + public static Coordinate getCentroid(Coordinate s, Coordinate e) {// 获取两点组成的线的图心 + if (s.x == e.x && s.y == e.y) { + return s; + } + LineString ls = factory.createLineString(new Coordinate[]{s, e}); + Point cp = ls.getCentroid(); + return cp.getCoordinate(); + } + + /** + * 获取多个离散几何点的几何中心 + * + * @param coors + * @return + */ + public static Coordinate getCentroid(Coordinate[] coors) {// 获取多个离散点的图心 + MultiPoint mp = factory.createMultiPoint(coors); + return mp.getCentroid().getCoordinate(); + } + + /** + * 获取面 + * + * @param list + * @return + */ + public static Polygon getPolygon(List list) { + Coordinate[] coors = new Coordinate[list.size()]; + for (int i = 0; i < list.size(); i++) { + BigDecimal[] item = list.get(i); + Coordinate coor = new Coordinate(); + coor.x = item[0].doubleValue(); + coor.y = item[1].doubleValue(); + coors[i] = coor; + } + return factory.createPolygon(coors); + } + + /** + * 获取线 + * + * @param list [[x,y],[x1,y1],[x2,y2]....] + * @return + */ + public static LineString createLine(List list) { + Coordinate[] coors = new Coordinate[list.size() - 1]; + for (int i = 0; i < list.size(); i++) { + BigDecimal[] item = list.get(i); + Coordinate coor = new Coordinate(); + coor.x = item[0].doubleValue(); + coor.y = item[1].doubleValue(); + coors[i] = coor; + } + return factory.createLineString(coors); + } + + /** + * 获取点 + * + * @param x + * @param y + * @return + */ + public static Point getPoint(BigDecimal x, BigDecimal y) { + Coordinate coor = new Coordinate(x.doubleValue(), y.doubleValue()); + return factory.createPoint(coor); + } + + // 解析面类型为经纬度数组 + public static List decodePolygon(Polygon pl) { + if (pl != null) { + List list = new ArrayList<>(); + Coordinate[] coors = pl.getCoordinates(); + if (coors.length > 0) { + for (Coordinate coor : coors) { + BigDecimal[] temp = new BigDecimal[2]; + temp[0] = new BigDecimal(coor.x); + temp[1] = new BigDecimal(coor.y); + list.add(temp); + } + } + return list; + } + return null; + } + + public static Coordinate getCenter(LineString line) { + LengthIndexedLine indexedLine = new LengthIndexedLine(line); + double[] index = indexedLine.indicesOf(line); + Coordinate mid = indexedLine.extractPoint((index[0] + index[1]) / 2); + return mid; + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/MyX509TrustManager.java b/common-token-starter/src/main/java/com/mosty/common/util/MyX509TrustManager.java new file mode 100644 index 0000000..7e6c36f --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/MyX509TrustManager.java @@ -0,0 +1,22 @@ +package com.mosty.common.util; + + +import javax.net.ssl.X509TrustManager; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +public class MyX509TrustManager implements X509TrustManager { + + // 检查客户端证书 + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + // 检查服务器端证书 + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + // 返回受信任的X509证书数组 + public X509Certificate[] getAcceptedIssuers() { + return null; + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/PermissionsUtil.java b/common-token-starter/src/main/java/com/mosty/common/util/PermissionsUtil.java new file mode 100644 index 0000000..d94a6d0 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/PermissionsUtil.java @@ -0,0 +1,106 @@ +package com.mosty.common.util; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mosty.common.base.util.StringUtils; +import com.mosty.common.token.DeptInfo; +import com.mosty.common.token.UserInfo; + +import java.util.Arrays; + +/** + * 数据权限获取工具 + */ +public class PermissionsUtil { + + // 根据组织机构ID获取查询权限 + public static void queryWrapperUtilByDeptInfo(QueryWrapper queryWrapper, DeptInfo deptInfo) { + if (deptInfo != null && deptInfo.getPermissionsLevel() != null) { + String level = deptInfo.getPermissionsLevel(); + if ("1".equals(level) || "2".equals(level)) { + // do nothing + } else if ("3".equals(level)) { + queryWrapper.eq("sssgajid", deptInfo.getSssgajid()); + } else if ("4".equals(level)) { + queryWrapper.eq("ssxgajid", deptInfo.getSsxgajid()); + } else if ("5".equals(level)) { + if (StringUtils.isNotEmpty(deptInfo.getIds())) { + String[] ids = deptInfo.getIds().split(","); + queryWrapper.in("ssbmid", Arrays.asList(ids)); + } + } else if ("6".equals(level)) { + queryWrapper.eq("ssbmid", deptInfo.getSsbmid()); + } + } + } + + // 根据组织机构ID获取查询权限 + public static void queryWrapperUtil(QueryWrapper queryWrapper, UserInfo userInfo) { + if (userInfo != null && userInfo.getUserPermissionsInfo() != null) { + String level = userInfo.getUserPermissionsInfo().getPermissionsLevel(); + if ("1".equals(level) || "2".equals(level)) { + // do nothing + } else if ("3".equals(level)) { + queryWrapper.eq("sssgajid", userInfo.getDszDeptId()); + } else if ("4".equals(level)) { + queryWrapper.eq("ssxgajid", userInfo.getFxjDeptId()); + } else if ("5".equals(level)) { + if (userInfo.getUserPermissionsInfo() != null + && StringUtils.isNotEmpty(userInfo.getUserPermissionsInfo().getIds())) { + String[] ids = userInfo.getUserPermissionsInfo().getIds().split(","); + queryWrapper.in("ssbmid", Arrays.asList(ids)); + } + } else if ("6".equals(level)) { + queryWrapper.eq("ssbmid", userInfo.getDeptId()); + } + } + } + + // 根据组织机构编码获取查询权限 + public static void queryWrapperUtilByCode(QueryWrapper queryWrapper, UserInfo userInfo) { + if (userInfo != null && userInfo.getUserPermissionsInfo() != null) { + String level = userInfo.getUserPermissionsInfo().getPermissionsLevel(); + if ("1".equals(level) || "2".equals(level)) { + // do nothing + } else if ("3".equals(level)) { + queryWrapper.eq("sssgajdm", userInfo.getDszDeptCode()); + } else if ("4".equals(level)) { + queryWrapper.eq("ssxgajdm", userInfo.getFxjDeptCode()); + } else if ("5".equals(level)) { + String[] orgcodes = userInfo.getUserPermissionsInfo().getOrgcodes().split(","); + queryWrapper.in("ssbmdm", Arrays.asList(orgcodes)); + } else if ("6".equals(level)) { + queryWrapper.eq("ssbmdm", userInfo.getDeptId()); + } + } + } + + // 表别名(使用ssbmid) + public static String createSql(String tableAlias, UserInfo userInfo) { + String dataPermissionSql = ""; + if (userInfo != null && userInfo.userPermissionsInfo != null && !StringUtils.isEmpty(userInfo.userPermissionsInfo.getPermissionsSql())) { + String sql = userInfo.userPermissionsInfo.getPermissionsSql().replaceAll("'", "'"); + if (StringUtils.isEmpty(tableAlias)) { + dataPermissionSql = sql.replaceAll("alias.", ""); + } else { + dataPermissionSql = sql.replaceAll("alias", tableAlias); + } + } + return dataPermissionSql; + } + + // 表别名(使用ssbmdm) + public static String createSqlOfCode(String tableAlias, UserInfo userInfo) { + String dataPermissionSql = ""; + if (userInfo != null && userInfo.userPermissionsInfo != null && + !StringUtils.isEmpty(userInfo.userPermissionsInfo.getPermissionsSqlCode())) { + String sql = userInfo.userPermissionsInfo.getPermissionsSqlCode().replaceAll("'", "'"); + if (StringUtils.isEmpty(tableAlias)) { + dataPermissionSql = sql.replaceAll("alias.", ""); + } else { + dataPermissionSql = sql.replaceAll("alias", tableAlias); + } + } + return dataPermissionSql; + } +} diff --git a/common-token-starter/src/main/java/com/mosty/common/util/UUIDGenerator.java b/common-token-starter/src/main/java/com/mosty/common/util/UUIDGenerator.java new file mode 100644 index 0000000..c24cc39 --- /dev/null +++ b/common-token-starter/src/main/java/com/mosty/common/util/UUIDGenerator.java @@ -0,0 +1,41 @@ +package com.mosty.common.util; + +import java.util.UUID; + +public class UUIDGenerator { + + /** + * 获取UUID + * @return + */ + public static String getUUID() { + UUID uuid = UUID.randomUUID(); + String str = uuid.toString(); + // 去掉"-"符号 + str = str.replace("-", ""); + return str; + } + + /** + * 获得指定数量的UUID + * @param number 指定数量 + * @return + */ + public static String[] getUUID(int number) { + if (number < 1) { + return null; + } + String[] ss = new String[number]; + for (int i = 0; i < number; i++) { + ss[i] = getUUID(); + } + return ss; + } + + public static void main(String[] args) { + String[] ss = getUUID(10); + for (int i = 0; i < ss.length; i++) { + System.out.println("ss[" + i + "]=====" + getUUID()); + } + } +} diff --git a/common-token-starter/target/classes/com/mosty/common/token/DeptInfo.class b/common-token-starter/target/classes/com/mosty/common/token/DeptInfo.class new file mode 100644 index 0000000..7f68288 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/DeptInfo.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/JWTUtil.class b/common-token-starter/target/classes/com/mosty/common/token/JWTUtil.class new file mode 100644 index 0000000..7ca2df7 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/JWTUtil.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/JwtSysUser.class b/common-token-starter/target/classes/com/mosty/common/token/JwtSysUser.class new file mode 100644 index 0000000..accc10e Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/JwtSysUser.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/SysUserInterceptor.class b/common-token-starter/target/classes/com/mosty/common/token/SysUserInterceptor.class new file mode 100644 index 0000000..6a891a3 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/SysUserInterceptor.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/UserInfo.class b/common-token-starter/target/classes/com/mosty/common/token/UserInfo.class new file mode 100644 index 0000000..7482796 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/UserInfo.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/UserInfoManager.class b/common-token-starter/target/classes/com/mosty/common/token/UserInfoManager.class new file mode 100644 index 0000000..474a4f6 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/UserInfoManager.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/UserPermissionsInfo.class b/common-token-starter/target/classes/com/mosty/common/token/UserPermissionsInfo.class new file mode 100644 index 0000000..ac80a02 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/UserPermissionsInfo.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/token/VirtualUserEnum.class b/common-token-starter/target/classes/com/mosty/common/token/VirtualUserEnum.class new file mode 100644 index 0000000..09c73c5 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/token/VirtualUserEnum.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/DataPermissionConstant.class b/common-token-starter/target/classes/com/mosty/common/util/DataPermissionConstant.class new file mode 100644 index 0000000..f24a8a7 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/DataPermissionConstant.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/GeoHashKit.class b/common-token-starter/target/classes/com/mosty/common/util/GeoHashKit.class new file mode 100644 index 0000000..168e9a3 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/GeoHashKit.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$1.class b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$1.class new file mode 100644 index 0000000..91123ee Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$1.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$2.class b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$2.class new file mode 100644 index 0000000..e232934 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils$2.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/ImageUtils.class b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils.class new file mode 100644 index 0000000..7113b4d Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/ImageUtils.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/JtsUtils.class b/common-token-starter/target/classes/com/mosty/common/util/JtsUtils.class new file mode 100644 index 0000000..6909896 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/JtsUtils.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/MyX509TrustManager.class b/common-token-starter/target/classes/com/mosty/common/util/MyX509TrustManager.class new file mode 100644 index 0000000..709a407 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/MyX509TrustManager.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/PermissionsUtil.class b/common-token-starter/target/classes/com/mosty/common/util/PermissionsUtil.class new file mode 100644 index 0000000..02c5577 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/PermissionsUtil.class differ diff --git a/common-token-starter/target/classes/com/mosty/common/util/UUIDGenerator.class b/common-token-starter/target/classes/com/mosty/common/util/UUIDGenerator.class new file mode 100644 index 0000000..2557319 Binary files /dev/null and b/common-token-starter/target/classes/com/mosty/common/util/UUIDGenerator.class differ diff --git a/common-token-starter/target/common-token-starter-1.0.0-SNAPSHOT.jar b/common-token-starter/target/common-token-starter-1.0.0-SNAPSHOT.jar new file mode 100644 index 0000000..6aa1563 Binary files /dev/null and b/common-token-starter/target/common-token-starter-1.0.0-SNAPSHOT.jar differ diff --git a/common-token-starter/target/maven-archiver/pom.properties b/common-token-starter/target/maven-archiver/pom.properties new file mode 100644 index 0000000..85f1062 --- /dev/null +++ b/common-token-starter/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Apr 18 12:45:09 CST 2024 +version=1.0.0-SNAPSHOT +groupId=com.mosty +artifactId=common-token-starter diff --git a/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..9e1310b --- /dev/null +++ b/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,17 @@ +com\mosty\common\token\DeptInfo.class +com\mosty\common\token\JwtSysUser.class +com\mosty\common\token\VirtualUserEnum.class +com\mosty\common\token\UserPermissionsInfo.class +com\mosty\common\util\JtsUtils.class +com\mosty\common\util\ImageUtils$1.class +com\mosty\common\util\DataPermissionConstant.class +com\mosty\common\util\PermissionsUtil.class +com\mosty\common\token\UserInfoManager.class +com\mosty\common\util\MyX509TrustManager.class +com\mosty\common\token\SysUserInterceptor.class +com\mosty\common\util\ImageUtils.class +com\mosty\common\token\JWTUtil.class +com\mosty\common\util\ImageUtils$2.class +com\mosty\common\token\UserInfo.class +com\mosty\common\util\GeoHashKit.class +com\mosty\common\util\UUIDGenerator.class diff --git a/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..b6daa01 --- /dev/null +++ b/common-token-starter/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,17 @@ +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\UserType.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\DeptInfo.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\MyX509TrustManager.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\DataPermissionConstant.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\UserInfo.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\UUIDGenerator.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\PermissionsUtil.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\UserPermissionsInfo.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\JtsUtils.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\ImageUtils.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\util\GeoHashKit.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\UserInfoManager.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\VirtualUserEnum.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\JwtSysUser.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\SysUserInterceptor.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\JWTUtil.java +E:\project\zgga\mosty-common\common-token-starter\src\main\java\com\mosty\common\token\UserInfoCache.java diff --git a/h5player.min.js b/h5player.min.js new file mode 100644 index 0000000..57ed4b0 --- /dev/null +++ b/h5player.min.js @@ -0,0 +1,26495 @@ +!function (e, t) { + if ("object" == typeof exports && "object" == typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else { + var n, i = t(); + for (n in i) ("object" == typeof exports ? exports : e)[n] = i[n] + } +}(window, function () { + return n = [function (e, t, hs) { + !function (ds) { + var ls;//! moment.js +//! version : 2.29.4 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com + ds.exports = function () { + "use strict"; + var I, W; + + function h() { + return I.apply(null, arguments) + } + + function H(e) { + I = e + } + + function s(e) { + return e instanceof Array || Object.prototype.toString.call(e) === "[object Array]" + } + + function j(e) { + return e != null && Object.prototype.toString.call(e) === "[object Object]" + } + + function u(e, t) { + return Object.prototype.hasOwnProperty.call(e, t) + } + + function F(e) { + if (Object.getOwnPropertyNames) return Object.getOwnPropertyNames(e).length === 0; else { + var t; + for (t in e) if (u(e, t)) return false; + return true + } + } + + function o(e) { + return e === void 0 + } + + function d(e) { + return typeof e === "number" || Object.prototype.toString.call(e) === "[object Number]" + } + + function B(e) { + return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" + } + + function N(e, t) { + var n = [], i, r = e.length; + for (i = 0; i < r; ++i) n.push(t(e[i], i)); + return n + } + + function z(e, t) { + for (var n in t) if (u(t, n)) e[n] = t[n]; + if (u(t, "toString")) e.toString = t.toString; + if (u(t, "valueOf")) e.valueOf = t.valueOf; + return e + } + + function l(e, t, n, i) { + return $n(e, t, n, i, true).utc() + } + + function U() { + return { + empty: false, + unusedTokens: [], + unusedInput: [], + overflow: -2, + charsLeftOver: 0, + nullInput: false, + invalidEra: null, + invalidMonth: null, + invalidFormat: false, + userInvalidated: false, + iso: false, + parsedDateParts: [], + era: null, + meridiem: null, + rfc2822: false, + weekdayMismatch: false + } + } + + function c(e) { + if (e._pf == null) e._pf = U(); + return e._pf + } + + if (Array.prototype.some) W = Array.prototype.some; else W = function (e) { + var t = Object(this), n = t.length >>> 0, i; + for (i = 0; i < n; i++) if (i in t && e.call(this, t[i], i, t)) return true; + return false + }; + + function V(e) { + if (e._isValid == null) { + var t = c(e), n = W.call(t.parsedDateParts, function (e) { + return e != null + }), + i = !isNaN(e._d.getTime()) && t.overflow < 0 && !t.empty && !t.invalidEra && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n); + if (e._strict) i = i && t.charsLeftOver === 0 && t.unusedTokens.length === 0 && t.bigHour === undefined; + if (Object.isFrozen == null || !Object.isFrozen(e)) e._isValid = i; else return i + } + return e._isValid + } + + function G(e) { + var t = l(NaN); + if (e != null) z(c(t), e); else c(t).userInvalidated = true; + return t + } + + var J = h.momentProperties = [], q = false; + + function K(e, t) { + var n, i, r, a = J.length; + if (!o(t._isAMomentObject)) e._isAMomentObject = t._isAMomentObject; + if (!o(t._i)) e._i = t._i; + if (!o(t._f)) e._f = t._f; + if (!o(t._l)) e._l = t._l; + if (!o(t._strict)) e._strict = t._strict; + if (!o(t._tzm)) e._tzm = t._tzm; + if (!o(t._isUTC)) e._isUTC = t._isUTC; + if (!o(t._offset)) e._offset = t._offset; + if (!o(t._pf)) e._pf = c(t); + if (!o(t._locale)) e._locale = t._locale; + if (a > 0) for (n = 0; n < a; n++) { + i = J[n]; + r = t[i]; + if (!o(r)) e[i] = r + } + return e + } + + function X(e) { + K(this, e); + this._d = new Date(e._d != null ? e._d.getTime() : NaN); + if (!this.isValid()) this._d = new Date(NaN); + if (q === false) { + q = true; + h.updateOffset(this); + q = false + } + } + + function _(e) { + return e instanceof X || e != null && e._isAMomentObject != null + } + + function Z(e) { + if (h.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) console.warn("Deprecation warning: " + e) + } + + function e(a, s) { + var o = true; + return z(function () { + if (h.deprecationHandler != null) h.deprecationHandler(null, a); + if (o) { + var e = [], t, n, i, r = arguments.length; + for (n = 0; n < r; n++) { + t = ""; + if (typeof arguments[n] === "object") { + t += "\n[" + n + "] "; + for (i in arguments[0]) if (u(arguments[0], i)) t += i + ": " + arguments[0][i] + ", "; + t = t.slice(0, -2) + } else t = arguments[n]; + e.push(t) + } + Z(a + "\nArguments: " + Array.prototype.slice.call(e).join("") + "\n" + (new Error).stack); + o = false + } + return s.apply(this, arguments) + }, s) + } + + var $ = {}, Q; + + function ee(e, t) { + if (h.deprecationHandler != null) h.deprecationHandler(e, t); + if (!$[e]) { + Z(t); + $[e] = true + } + } + + function f(e) { + return typeof Function !== "undefined" && e instanceof Function || Object.prototype.toString.call(e) === "[object Function]" + } + + function te(e) { + var t, n; + for (n in e) if (u(e, n)) { + t = e[n]; + if (f(t)) this[n] = t; else this["_" + n] = t + } + this._config = e; + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source) + } + + function ne(e, t) { + var n = z({}, e), i; + for (i in t) if (u(t, i)) if (j(e[i]) && j(t[i])) { + n[i] = {}; + z(n[i], e[i]); + z(n[i], t[i]) + } else if (t[i] != null) n[i] = t[i]; else delete n[i]; + for (i in e) if (u(e, i) && !u(t, i) && j(e[i])) n[i] = z({}, n[i]); + return n + } + + function ie(e) { + if (e != null) this.set(e) + } + + if (h.suppressDeprecationWarnings = false, h.deprecationHandler = null, Object.keys) Q = Object.keys; else Q = function (e) { + var t, n = []; + for (t in e) if (u(e, t)) n.push(t); + return n + }; + var re = { + sameDay: "[Today at] LT", + nextDay: "[Tomorrow at] LT", + nextWeek: "dddd [at] LT", + lastDay: "[Yesterday at] LT", + lastWeek: "[Last] dddd [at] LT", + sameElse: "L" + }; + + function ae(e, t, n) { + var i = this._calendar[e] || this._calendar["sameElse"]; + return f(i) ? i.call(t, n) : i + } + + function a(e, t, n) { + var i = "" + Math.abs(e), r = t - i.length, a = e >= 0; + return (a ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, r)).toString().substr(1) + i + } + + var se = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, + oe = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, ue = {}, de = {}; + + function i(e, t, n, i) { + var r = i; + if (typeof i === "string") r = function () { + return this[i]() + }; + if (e) de[e] = r; + if (t) de[t[0]] = function () { + return a(r.apply(this, arguments), t[1], t[2]) + }; + if (n) de[n] = function () { + return this.localeData().ordinal(r.apply(this, arguments), e) + } + } + + function le(e) { + if (e.match(/\[[\s\S]/)) return e.replace(/^\[|\]$/g, ""); + return e.replace(/\\/g, "") + } + + function he(i) { + var r = i.match(se), e, a; + for (e = 0, a = r.length; e < a; e++) if (de[r[e]]) r[e] = de[r[e]]; else r[e] = le(r[e]); + return function (e) { + var t = "", n; + for (n = 0; n < a; n++) t += f(r[n]) ? r[n].call(e, i) : r[n]; + return t + } + } + + function ce(e, t) { + if (!e.isValid()) return e.localeData().invalidDate(); + t = _e(t, e.localeData()); + ue[t] = ue[t] || he(t); + return ue[t](e) + } + + function _e(e, t) { + var n = 5; + + function i(e) { + return t.longDateFormat(e) || e + } + + oe.lastIndex = 0; + while (n >= 0 && oe.test(e)) { + e = e.replace(oe, i); + oe.lastIndex = 0; + n -= 1 + } + return e + } + + var fe = { + LTS: "h:mm:ss A", + LT: "h:mm A", + L: "MM/DD/YYYY", + LL: "MMMM D, YYYY", + LLL: "MMMM D, YYYY h:mm A", + LLLL: "dddd, MMMM D, YYYY h:mm A" + }; + + function me(e) { + var t = this._longDateFormat[e], n = this._longDateFormat[e.toUpperCase()]; + if (t || !n) return t; + this._longDateFormat[e] = n.match(se).map(function (e) { + if (e === "MMMM" || e === "MM" || e === "DD" || e === "dddd") return e.slice(1); + return e + }).join(""); + return this._longDateFormat[e] + } + + var pe = "Invalid date"; + + function ye() { + return this._invalidDate + } + + var ve = "%d", ge = /\d{1,2}/; + + function Me(e) { + return this._ordinal.replace("%d", e) + } + + var Le = { + future: "in %s", + past: "%s ago", + s: "a few seconds", + ss: "%d seconds", + m: "a minute", + mm: "%d minutes", + h: "an hour", + hh: "%d hours", + d: "a day", + dd: "%d days", + w: "a week", + ww: "%d weeks", + M: "a month", + MM: "%d months", + y: "a year", + yy: "%d years" + }; + + function Se(e, t, n, i) { + var r = this._relativeTime[n]; + return f(r) ? r(e, t, n, i) : r.replace(/%d/i, e) + } + + function ke(e, t) { + var n = this._relativeTime[e > 0 ? "future" : "past"]; + return f(n) ? n(t) : n.replace(/%s/i, t) + } + + var be = {}; + + function t(e, t) { + var n = e.toLowerCase(); + be[n] = be[n + "s"] = be[t] = e + } + + function m(e) { + return typeof e === "string" ? be[e] || be[e.toLowerCase()] : undefined + } + + function we(e) { + var t = {}, n, i; + for (i in e) if (u(e, i)) { + n = m(i); + if (n) t[n] = e[i] + } + return t + } + + var De = {}; + + function n(e, t) { + De[e] = t + } + + function Te(e) { + var t = [], n; + for (n in e) if (u(e, n)) t.push({unit: n, priority: De[n]}); + t.sort(function (e, t) { + return e.priority - t.priority + }); + return t + } + + function Ee(e) { + return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0 + } + + function p(e) { + if (e < 0) return Math.ceil(e) || 0; else return Math.floor(e) + } + + function y(e) { + var t = +e, n = 0; + if (t !== 0 && isFinite(t)) n = p(t); + return n + } + + function Ye(t, n) { + return function (e) { + if (e != null) { + Ce(this, t, e); + h.updateOffset(this, n); + return this + } else return Pe(this, t) + } + } + + function Pe(e, t) { + return e.isValid() ? e._d["get" + (e._isUTC ? "UTC" : "") + t]() : NaN + } + + function Ce(e, t, n) { + if (e.isValid() && !isNaN(n)) if (t === "FullYear" && Ee(e.year()) && e.month() === 1 && e.date() === 29) { + n = y(n); + e._d["set" + (e._isUTC ? "UTC" : "") + t](n, e.month(), at(n, e.month())) + } else e._d["set" + (e._isUTC ? "UTC" : "") + t](n) + } + + function Re(e) { + e = m(e); + if (f(this[e])) return this[e](); + return this + } + + function Ae(e, t) { + if (typeof e === "object") { + e = we(e); + var n = Te(e), i, r = n.length; + for (i = 0; i < r; i++) this[n[i].unit](e[n[i].unit]) + } else { + e = m(e); + if (f(this[e])) return this[e](t) + } + return this + } + + var xe = /\d/, r = /\d\d/, Oe = /\d{3}/, Ie = /\d{4}/, We = /[+-]?\d{6}/, v = /\d\d?/, He = /\d\d\d\d?/, + je = /\d\d\d\d\d\d?/, Fe = /\d{1,3}/, Be = /\d{1,4}/, Ne = /[+-]?\d{1,6}/, ze = /\d+/, + Ue = /[+-]?\d+/, Ve = /Z|[+-]\d\d:?\d\d/gi, Ge = /Z|[+-]\d\d(?::?\d\d)?/gi, + Je = /[+-]?\d+(\.\d{1,3})?/, + qe = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, + Ke; + + function g(e, n, i) { + Ke[e] = f(n) ? n : function (e, t) { + return e && i ? i : n + } + } + + function Xe(e, t) { + if (!u(Ke, e)) return new RegExp(Ze(e)); + return Ke[e](t._strict, t._locale) + } + + function Ze(e) { + return M(e.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (e, t, n, i, r) { + return t || n || i || r + })) + } + + function M(e) { + return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") + } + + var Ke = {}, $e = {}; + + function L(e, n) { + var t, i = n, r; + if (typeof e === "string") e = [e]; + if (d(n)) i = function (e, t) { + t[n] = y(e) + }; + r = e.length; + for (t = 0; t < r; t++) $e[e[t]] = i + } + + function Qe(e, r) { + L(e, function (e, t, n, i) { + n._w = n._w || {}; + r(e, n._w, n, i) + }) + } + + function et(e, t, n) { + if (t != null && u($e, e)) $e[e](t, n._a, n, e) + } + + var S = 0, k = 1, b = 2, w = 3, D = 4, T = 5, tt = 6, nt = 7, it = 8, E; + + function rt(e, t) { + return (e % t + t) % t + } + + if (Array.prototype.indexOf) E = Array.prototype.indexOf; else E = function (e) { + var t; + for (t = 0; t < this.length; ++t) if (this[t] === e) return t; + return -1 + }; + + function at(e, t) { + if (isNaN(e) || isNaN(t)) return NaN; + var n = rt(t, 12); + e += (t - n) / 12; + return n === 1 ? Ee(e) ? 29 : 28 : 31 - n % 7 % 2 + } + + i("M", ["MM", 2], "Mo", function () { + return this.month() + 1 + }), i("MMM", 0, 0, function (e) { + return this.localeData().monthsShort(this, e) + }), i("MMMM", 0, 0, function (e) { + return this.localeData().months(this, e) + }), t("month", "M"), n("month", 8), g("M", v), g("MM", v, r), g("MMM", function (e, t) { + return t.monthsShortRegex(e) + }), g("MMMM", function (e, t) { + return t.monthsRegex(e) + }), L(["M", "MM"], function (e, t) { + t[k] = y(e) - 1 + }), L(["MMM", "MMMM"], function (e, t, n, i) { + var r = n._locale.monthsParse(e, i, n._strict); + if (r != null) t[k] = r; else c(n).invalidMonth = e + }); + var st = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), + ot = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), + ut = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, dt = qe, lt = qe; + + function ht(e, t) { + if (!e) return s(this._months) ? this._months : this._months["standalone"]; + return s(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || ut).test(t) ? "format" : "standalone"][e.month()] + } + + function ct(e, t) { + if (!e) return s(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"]; + return s(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[ut.test(t) ? "format" : "standalone"][e.month()] + } + + function _t(e, t, n) { + var i, r, a, s = e.toLocaleLowerCase(); + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + a = l([2e3, i]); + this._shortMonthsParse[i] = this.monthsShort(a, "").toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(a, "").toLocaleLowerCase() + } + } + if (n) if (t === "MMM") { + r = E.call(this._shortMonthsParse, s); + return r !== -1 ? r : null + } else { + r = E.call(this._longMonthsParse, s); + return r !== -1 ? r : null + } else if (t === "MMM") { + r = E.call(this._shortMonthsParse, s); + if (r !== -1) return r; + r = E.call(this._longMonthsParse, s); + return r !== -1 ? r : null + } else { + r = E.call(this._longMonthsParse, s); + if (r !== -1) return r; + r = E.call(this._shortMonthsParse, s); + return r !== -1 ? r : null + } + } + + function ft(e, t, n) { + var i, r, a; + if (this._monthsParseExact) return _t.call(this, e, t, n); + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = [] + } + for (i = 0; i < 12; i++) { + r = l([2e3, i]); + if (n && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp("^" + this.months(r, "").replace(".", "") + "$", "i"); + this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(r, "").replace(".", "") + "$", "i") + } + if (!n && !this._monthsParse[i]) { + a = "^" + this.months(r, "") + "|^" + this.monthsShort(r, ""); + this._monthsParse[i] = new RegExp(a.replace(".", ""), "i") + } + if (n && t === "MMMM" && this._longMonthsParse[i].test(e)) return i; else if (n && t === "MMM" && this._shortMonthsParse[i].test(e)) return i; else if (!n && this._monthsParse[i].test(e)) return i + } + } + + function mt(e, t) { + var n; + if (!e.isValid()) return e; + if (typeof t === "string") if (/^\d+$/.test(t)) t = y(t); else { + t = e.localeData().monthsParse(t); + if (!d(t)) return e + } + n = Math.min(e.date(), at(e.year(), t)); + e._d["set" + (e._isUTC ? "UTC" : "") + "Month"](t, n); + return e + } + + function pt(e) { + if (e != null) { + mt(this, e); + h.updateOffset(this, true); + return this + } else return Pe(this, "Month") + } + + function yt() { + return at(this.year(), this.month()) + } + + function vt(e) { + if (this._monthsParseExact) { + if (!u(this, "_monthsRegex")) Mt.call(this); + if (e) return this._monthsShortStrictRegex; else return this._monthsShortRegex + } else { + if (!u(this, "_monthsShortRegex")) this._monthsShortRegex = dt; + return this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex + } + } + + function gt(e) { + if (this._monthsParseExact) { + if (!u(this, "_monthsRegex")) Mt.call(this); + if (e) return this._monthsStrictRegex; else return this._monthsRegex + } else { + if (!u(this, "_monthsRegex")) this._monthsRegex = lt; + return this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex + } + } + + function Mt() { + function e(e, t) { + return t.length - e.length + } + + var t = [], n = [], i = [], r, a; + for (r = 0; r < 12; r++) { + a = l([2e3, r]); + t.push(this.monthsShort(a, "")); + n.push(this.months(a, "")); + i.push(this.months(a, "")); + i.push(this.monthsShort(a, "")) + } + t.sort(e); + n.sort(e); + i.sort(e); + for (r = 0; r < 12; r++) { + t[r] = M(t[r]); + n[r] = M(n[r]) + } + for (r = 0; r < 24; r++) i[r] = M(i[r]); + this._monthsRegex = new RegExp("^(" + i.join("|") + ")", "i"); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp("^(" + n.join("|") + ")", "i"); + this._monthsShortStrictRegex = new RegExp("^(" + t.join("|") + ")", "i") + } + + function Lt(e) { + return Ee(e) ? 366 : 365 + } + + i("Y", 0, 0, function () { + var e = this.year(); + return e <= 9999 ? a(e, 4) : "+" + e + }), i(0, ["YY", 2], 0, function () { + return this.year() % 100 + }), i(0, ["YYYY", 4], 0, "year"), i(0, ["YYYYY", 5], 0, "year"), i(0, ["YYYYYY", 6, true], 0, "year"), t("year", "y"), n("year", 1), g("Y", Ue), g("YY", v, r), g("YYYY", Be, Ie), g("YYYYY", Ne, We), g("YYYYYY", Ne, We), L(["YYYYY", "YYYYYY"], S), L("YYYY", function (e, t) { + t[S] = e.length === 2 ? h.parseTwoDigitYear(e) : y(e) + }), L("YY", function (e, t) { + t[S] = h.parseTwoDigitYear(e) + }), L("Y", function (e, t) { + t[S] = parseInt(e, 10) + }), h.parseTwoDigitYear = function (e) { + return y(e) + (y(e) > 68 ? 1900 : 2e3) + }; + var St = Ye("FullYear", true); + + function kt() { + return Ee(this.year()) + } + + function bt(e, t, n, i, r, a, s) { + var o; + if (e < 100 && e >= 0) { + o = new Date(e + 400, t, n, i, r, a, s); + if (isFinite(o.getFullYear())) o.setFullYear(e) + } else o = new Date(e, t, n, i, r, a, s); + return o + } + + function wt(e) { + var t, n; + if (e < 100 && e >= 0) { + n = Array.prototype.slice.call(arguments); + n[0] = e + 400; + t = new Date(Date.UTC.apply(null, n)); + if (isFinite(t.getUTCFullYear())) t.setUTCFullYear(e) + } else t = new Date(Date.UTC.apply(null, arguments)); + return t + } + + function Dt(e, t, n) { + var i = 7 + t - n, r = (7 + wt(e, 0, i).getUTCDay() - t) % 7; + return -r + i - 1 + } + + function Tt(e, t, n, i, r) { + var a = (7 + n - i) % 7, s = Dt(e, i, r), o = 1 + 7 * (t - 1) + a + s, u, d; + if (o <= 0) { + u = e - 1; + d = Lt(u) + o + } else if (o > Lt(e)) { + u = e + 1; + d = o - Lt(e) + } else { + u = e; + d = o + } + return {year: u, dayOfYear: d} + } + + function Et(e, t, n) { + var i = Dt(e.year(), t, n), r = Math.floor((e.dayOfYear() - i - 1) / 7) + 1, a, s; + if (r < 1) { + s = e.year() - 1; + a = r + Y(s, t, n) + } else if (r > Y(e.year(), t, n)) { + a = r - Y(e.year(), t, n); + s = e.year() + 1 + } else { + s = e.year(); + a = r + } + return {week: a, year: s} + } + + function Y(e, t, n) { + var i = Dt(e, t, n), r = Dt(e + 1, t, n); + return (Lt(e) - i + r) / 7 + } + + function Yt(e) { + return Et(e, this._week.dow, this._week.doy).week + } + + i("w", ["ww", 2], "wo", "week"), i("W", ["WW", 2], "Wo", "isoWeek"), t("week", "w"), t("isoWeek", "W"), n("week", 5), n("isoWeek", 5), g("w", v), g("ww", v, r), g("W", v), g("WW", v, r), Qe(["w", "ww", "W", "WW"], function (e, t, n, i) { + t[i.substr(0, 1)] = y(e) + }); + var Pt = {dow: 0, doy: 6}; + + function Ct() { + return this._week.dow + } + + function Rt() { + return this._week.doy + } + + function At(e) { + var t = this.localeData().week(this); + return e == null ? t : this.add((e - t) * 7, "d") + } + + function xt(e) { + var t = Et(this, 1, 4).week; + return e == null ? t : this.add((e - t) * 7, "d") + } + + function Ot(e, t) { + if (typeof e !== "string") return e; + if (!isNaN(e)) return parseInt(e, 10); + e = t.weekdaysParse(e); + if (typeof e === "number") return e; + return null + } + + function It(e, t) { + if (typeof e === "string") return t.weekdaysParse(e) % 7 || 7; + return isNaN(e) ? null : e + } + + function Wt(e, t) { + return e.slice(t, 7).concat(e.slice(0, t)) + } + + i("d", 0, "do", "day"), i("dd", 0, 0, function (e) { + return this.localeData().weekdaysMin(this, e) + }), i("ddd", 0, 0, function (e) { + return this.localeData().weekdaysShort(this, e) + }), i("dddd", 0, 0, function (e) { + return this.localeData().weekdays(this, e) + }), i("e", 0, 0, "weekday"), i("E", 0, 0, "isoWeekday"), t("day", "d"), t("weekday", "e"), t("isoWeekday", "E"), n("day", 11), n("weekday", 11), n("isoWeekday", 11), g("d", v), g("e", v), g("E", v), g("dd", function (e, t) { + return t.weekdaysMinRegex(e) + }), g("ddd", function (e, t) { + return t.weekdaysShortRegex(e) + }), g("dddd", function (e, t) { + return t.weekdaysRegex(e) + }), Qe(["dd", "ddd", "dddd"], function (e, t, n, i) { + var r = n._locale.weekdaysParse(e, i, n._strict); + if (r != null) t.d = r; else c(n).invalidWeekday = e + }), Qe(["d", "e", "E"], function (e, t, n, i) { + t[i] = y(e) + }); + var Ht = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), + jt = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), Ft = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), Bt = qe, + Nt = qe, zt = qe; + + function Ut(e, t) { + var n = s(this._weekdays) ? this._weekdays : this._weekdays[e && e !== true && this._weekdays.isFormat.test(t) ? "format" : "standalone"]; + return e === true ? Wt(n, this._week.dow) : e ? n[e.day()] : n + } + + function Vt(e) { + return e === true ? Wt(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort + } + + function Gt(e) { + return e === true ? Wt(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin + } + + function Jt(e, t, n) { + var i, r, a, s = e.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + for (i = 0; i < 7; ++i) { + a = l([2e3, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(a, "").toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(a, "").toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(a, "").toLocaleLowerCase() + } + } + if (n) if (t === "dddd") { + r = E.call(this._weekdaysParse, s); + return r !== -1 ? r : null + } else if (t === "ddd") { + r = E.call(this._shortWeekdaysParse, s); + return r !== -1 ? r : null + } else { + r = E.call(this._minWeekdaysParse, s); + return r !== -1 ? r : null + } else if (t === "dddd") { + r = E.call(this._weekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._shortWeekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._minWeekdaysParse, s); + return r !== -1 ? r : null + } else if (t === "ddd") { + r = E.call(this._shortWeekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._weekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._minWeekdaysParse, s); + return r !== -1 ? r : null + } else { + r = E.call(this._minWeekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._weekdaysParse, s); + if (r !== -1) return r; + r = E.call(this._shortWeekdaysParse, s); + return r !== -1 ? r : null + } + } + + function qt(e, t, n) { + var i, r, a; + if (this._weekdaysParseExact) return Jt.call(this, e, t, n); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = [] + } + for (i = 0; i < 7; i++) { + r = l([2e3, 1]).day(i); + if (n && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp("^" + this.weekdays(r, "").replace(".", "\\.?") + "$", "i"); + this._shortWeekdaysParse[i] = new RegExp("^" + this.weekdaysShort(r, "").replace(".", "\\.?") + "$", "i"); + this._minWeekdaysParse[i] = new RegExp("^" + this.weekdaysMin(r, "").replace(".", "\\.?") + "$", "i") + } + if (!this._weekdaysParse[i]) { + a = "^" + this.weekdays(r, "") + "|^" + this.weekdaysShort(r, "") + "|^" + this.weekdaysMin(r, ""); + this._weekdaysParse[i] = new RegExp(a.replace(".", ""), "i") + } + if (n && t === "dddd" && this._fullWeekdaysParse[i].test(e)) return i; else if (n && t === "ddd" && this._shortWeekdaysParse[i].test(e)) return i; else if (n && t === "dd" && this._minWeekdaysParse[i].test(e)) return i; else if (!n && this._weekdaysParse[i].test(e)) return i + } + } + + function Kt(e) { + if (!this.isValid()) return e != null ? this : NaN; + var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (e != null) { + e = Ot(e, this.localeData()); + return this.add(e - t, "d") + } else return t + } + + function Xt(e) { + if (!this.isValid()) return e != null ? this : NaN; + var t = (this.day() + 7 - this.localeData()._week.dow) % 7; + return e == null ? t : this.add(e - t, "d") + } + + function Zt(e) { + if (!this.isValid()) return e != null ? this : NaN; + if (e != null) { + var t = It(e, this.localeData()); + return this.day(this.day() % 7 ? t : t - 7) + } else return this.day() || 7 + } + + function $t(e) { + if (this._weekdaysParseExact) { + if (!u(this, "_weekdaysRegex")) tn.call(this); + if (e) return this._weekdaysStrictRegex; else return this._weekdaysRegex + } else { + if (!u(this, "_weekdaysRegex")) this._weekdaysRegex = Bt; + return this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex + } + } + + function Qt(e) { + if (this._weekdaysParseExact) { + if (!u(this, "_weekdaysRegex")) tn.call(this); + if (e) return this._weekdaysShortStrictRegex; else return this._weekdaysShortRegex + } else { + if (!u(this, "_weekdaysShortRegex")) this._weekdaysShortRegex = Nt; + return this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex + } + } + + function en(e) { + if (this._weekdaysParseExact) { + if (!u(this, "_weekdaysRegex")) tn.call(this); + if (e) return this._weekdaysMinStrictRegex; else return this._weekdaysMinRegex + } else { + if (!u(this, "_weekdaysMinRegex")) this._weekdaysMinRegex = zt; + return this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex + } + } + + function tn() { + function e(e, t) { + return t.length - e.length + } + + var t = [], n = [], i = [], r = [], a, s, o, u, d; + for (a = 0; a < 7; a++) { + s = l([2e3, 1]).day(a); + o = M(this.weekdaysMin(s, "")); + u = M(this.weekdaysShort(s, "")); + d = M(this.weekdays(s, "")); + t.push(o); + n.push(u); + i.push(d); + r.push(o); + r.push(u); + r.push(d) + } + t.sort(e); + n.sort(e); + i.sort(e); + r.sort(e); + this._weekdaysRegex = new RegExp("^(" + r.join("|") + ")", "i"); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + this._weekdaysStrictRegex = new RegExp("^(" + i.join("|") + ")", "i"); + this._weekdaysShortStrictRegex = new RegExp("^(" + n.join("|") + ")", "i"); + this._weekdaysMinStrictRegex = new RegExp("^(" + t.join("|") + ")", "i") + } + + function nn() { + return this.hours() % 12 || 12 + } + + function rn() { + return this.hours() || 24 + } + + function an(e, t) { + i(e, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), t) + }) + } + + function sn(e, t) { + return t._meridiemParse + } + + function on(e) { + return (e + "").toLowerCase().charAt(0) === "p" + } + + i("H", ["HH", 2], 0, "hour"), i("h", ["hh", 2], 0, nn), i("k", ["kk", 2], 0, rn), i("hmm", 0, 0, function () { + return "" + nn.apply(this) + a(this.minutes(), 2) + }), i("hmmss", 0, 0, function () { + return "" + nn.apply(this) + a(this.minutes(), 2) + a(this.seconds(), 2) + }), i("Hmm", 0, 0, function () { + return "" + this.hours() + a(this.minutes(), 2) + }), i("Hmmss", 0, 0, function () { + return "" + this.hours() + a(this.minutes(), 2) + a(this.seconds(), 2) + }), an("a", true), an("A", false), t("hour", "h"), n("hour", 13), g("a", sn), g("A", sn), g("H", v), g("h", v), g("k", v), g("HH", v, r), g("hh", v, r), g("kk", v, r), g("hmm", He), g("hmmss", je), g("Hmm", He), g("Hmmss", je), L(["H", "HH"], w), L(["k", "kk"], function (e, t, n) { + var i = y(e); + t[w] = i === 24 ? 0 : i + }), L(["a", "A"], function (e, t, n) { + n._isPm = n._locale.isPM(e); + n._meridiem = e + }), L(["h", "hh"], function (e, t, n) { + t[w] = y(e); + c(n).bigHour = true + }), L("hmm", function (e, t, n) { + var i = e.length - 2; + t[w] = y(e.substr(0, i)); + t[D] = y(e.substr(i)); + c(n).bigHour = true + }), L("hmmss", function (e, t, n) { + var i = e.length - 4, r = e.length - 2; + t[w] = y(e.substr(0, i)); + t[D] = y(e.substr(i, 2)); + t[T] = y(e.substr(r)); + c(n).bigHour = true + }), L("Hmm", function (e, t, n) { + var i = e.length - 2; + t[w] = y(e.substr(0, i)); + t[D] = y(e.substr(i)) + }), L("Hmmss", function (e, t, n) { + var i = e.length - 4, r = e.length - 2; + t[w] = y(e.substr(0, i)); + t[D] = y(e.substr(i, 2)); + t[T] = y(e.substr(r)) + }); + var un, dn = Ye("Hours", true); + + function ln(e, t, n) { + if (e > 11) return n ? "pm" : "PM"; else return n ? "am" : "AM" + } + + var hn = { + calendar: re, + longDateFormat: fe, + invalidDate: pe, + ordinal: ve, + dayOfMonthOrdinalParse: ge, + relativeTime: Le, + months: st, + monthsShort: ot, + week: Pt, + weekdays: Ht, + weekdaysMin: Ft, + weekdaysShort: jt, + meridiemParse: /[ap]\.?m?\.?/i + }, P = {}, cn = {}, _n; + + function fn(e, t) { + var n, i = Math.min(e.length, t.length); + for (n = 0; n < i; n += 1) if (e[n] !== t[n]) return n; + return i + } + + function mn(e) { + return e ? e.toLowerCase().replace("_", "-") : e + } + + function pn(e) { + var t = 0, n, i, r, a; + while (t < e.length) { + a = mn(e[t]).split("-"); + n = a.length; + i = mn(e[t + 1]); + i = i ? i.split("-") : null; + while (n > 0) { + r = vn(a.slice(0, n).join("-")); + if (r) return r; + if (i && i.length >= n && fn(a, i) >= n - 1) break; + n-- + } + t++ + } + return _n + } + + function yn(e) { + return e.match("^[^/\\\\]*$") != null + } + + function vn(t) { + var e = null, n; + if (P[t] === undefined && typeof ds !== "undefined" && ds && ds.exports && yn(t)) try { + e = _n._abbr; + n = ls; + hs(284)("./" + t); + gn(e) + } catch (e) { + P[t] = null + } + return P[t] + } + + function gn(e, t) { + var n; + if (e) { + if (o(t)) n = Sn(e); else n = Mn(e, t); + if (n) _n = n; else if (typeof console !== "undefined" && console.warn) console.warn("Locale " + e + " not found. Did you forget to load it?") + } + return _n._abbr + } + + function Mn(e, t) { + if (t !== null) { + var n, i = hn; + t.abbr = e; + if (P[e] != null) { + ee("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change " + "an existing locale. moment.defineLocale(localeName, " + "config) should only be used for creating a new locale " + "See http://momentjs.com/guides/#/warnings/define-locale/ for more info."); + i = P[e]._config + } else if (t.parentLocale != null) if (P[t.parentLocale] != null) i = P[t.parentLocale]._config; else { + n = vn(t.parentLocale); + if (n != null) i = n._config; else { + if (!cn[t.parentLocale]) cn[t.parentLocale] = []; + cn[t.parentLocale].push({name: e, config: t}); + return null + } + } + P[e] = new ie(ne(i, t)); + if (cn[e]) cn[e].forEach(function (e) { + Mn(e.name, e.config) + }); + gn(e); + return P[e] + } else { + delete P[e]; + return null + } + } + + function Ln(e, t) { + if (t != null) { + var n, i, r = hn; + if (P[e] != null && P[e].parentLocale != null) P[e].set(ne(P[e]._config, t)); else { + i = vn(e); + if (i != null) r = i._config; + t = ne(r, t); + if (i == null) t.abbr = e; + n = new ie(t); + n.parentLocale = P[e]; + P[e] = n + } + gn(e) + } else if (P[e] != null) if (P[e].parentLocale != null) { + P[e] = P[e].parentLocale; + if (e === gn()) gn(e) + } else if (P[e] != null) delete P[e]; + return P[e] + } + + function Sn(e) { + var t; + if (e && e._locale && e._locale._abbr) e = e._locale._abbr; + if (!e) return _n; + if (!s(e)) { + t = vn(e); + if (t) return t; + e = [e] + } + return pn(e) + } + + function kn() { + return Q(P) + } + + function bn(e) { + var t, n = e._a; + if (n && c(e).overflow === -2) { + t = n[k] < 0 || n[k] > 11 ? k : n[b] < 1 || n[b] > at(n[S], n[k]) ? b : n[w] < 0 || n[w] > 24 || n[w] === 24 && (n[D] !== 0 || n[T] !== 0 || n[tt] !== 0) ? w : n[D] < 0 || n[D] > 59 ? D : n[T] < 0 || n[T] > 59 ? T : n[tt] < 0 || n[tt] > 999 ? tt : -1; + if (c(e)._overflowDayOfYear && (t < S || t > b)) t = b; + if (c(e)._overflowWeeks && t === -1) t = nt; + if (c(e)._overflowWeekday && t === -1) t = it; + c(e).overflow = t + } + return e + } + + var wn = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, + Dn = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, + Tn = /Z|[+-]\d\d(?::?\d\d)?/, + En = [["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, false], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, false], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, false], ["YYYYDDD", /\d{7}/], ["YYYYMM", /\d{6}/, false], ["YYYY", /\d{4}/, false]], + Yn = [["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/]], + Pn = /^\/?Date\((-?\d+)/i, + Cn = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, + Rn = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + + function An(e) { + var t, n, i = e._i, r = wn.exec(i) || Dn.exec(i), a, s, o, u, d = En.length, l = Yn.length; + if (r) { + c(e).iso = true; + for (t = 0, n = d; t < n; t++) if (En[t][1].exec(r[1])) { + s = En[t][0]; + a = En[t][2] !== false; + break + } + if (s == null) { + e._isValid = false; + return + } + if (r[3]) { + for (t = 0, n = l; t < n; t++) if (Yn[t][1].exec(r[3])) { + o = (r[2] || " ") + Yn[t][0]; + break + } + if (o == null) { + e._isValid = false; + return + } + } + if (!a && o != null) { + e._isValid = false; + return + } + if (r[4]) if (Tn.exec(r[4])) u = "Z"; else { + e._isValid = false; + return + } + e._f = s + (o || "") + (u || ""); + Vn(e) + } else e._isValid = false + } + + function xn(e, t, n, i, r, a) { + var s = [On(e), ot.indexOf(t), parseInt(n, 10), parseInt(i, 10), parseInt(r, 10)]; + if (a) s.push(parseInt(a, 10)); + return s + } + + function On(e) { + var t = parseInt(e, 10); + if (t <= 49) return 2e3 + t; else if (t <= 999) return 1900 + t; + return t + } + + function In(e) { + return e.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "") + } + + function Wn(e, t, n) { + if (e) { + var i = jt.indexOf(e), r = new Date(t[0], t[1], t[2]).getDay(); + if (i !== r) { + c(n).weekdayMismatch = true; + n._isValid = false; + return false + } + } + return true + } + + function Hn(e, t, n) { + if (e) return Rn[e]; else if (t) return 0; else { + var i = parseInt(n, 10), r = i % 100, a = (i - r) / 100; + return a * 60 + r + } + } + + function jn(e) { + var t = Cn.exec(In(e._i)), n; + if (t) { + n = xn(t[4], t[3], t[2], t[5], t[6], t[7]); + if (!Wn(t[1], n, e)) return; + e._a = n; + e._tzm = Hn(t[8], t[9], t[10]); + e._d = wt.apply(null, e._a); + e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm); + c(e).rfc2822 = true + } else e._isValid = false + } + + function Fn(e) { + var t = Pn.exec(e._i); + if (t !== null) { + e._d = new Date(+t[1]); + return + } + An(e); + if (e._isValid === false) delete e._isValid; else return; + jn(e); + if (e._isValid === false) delete e._isValid; else return; + if (e._strict) e._isValid = false; else h.createFromInputFallback(e) + } + + function Bn(e, t, n) { + if (e != null) return e; + if (t != null) return t; + return n + } + + function Nn(e) { + var t = new Date(h.now()); + if (e._useUTC) return [t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()]; + return [t.getFullYear(), t.getMonth(), t.getDate()] + } + + function zn(e) { + var t, n, i = [], r, a, s; + if (e._d) return; + r = Nn(e); + if (e._w && e._a[b] == null && e._a[k] == null) Un(e); + if (e._dayOfYear != null) { + s = Bn(e._a[S], r[S]); + if (e._dayOfYear > Lt(s) || e._dayOfYear === 0) c(e)._overflowDayOfYear = true; + n = wt(s, 0, e._dayOfYear); + e._a[k] = n.getUTCMonth(); + e._a[b] = n.getUTCDate() + } + for (t = 0; t < 3 && e._a[t] == null; ++t) e._a[t] = i[t] = r[t]; + for (; t < 7; t++) e._a[t] = i[t] = e._a[t] == null ? t === 2 ? 1 : 0 : e._a[t]; + if (e._a[w] === 24 && e._a[D] === 0 && e._a[T] === 0 && e._a[tt] === 0) { + e._nextDay = true; + e._a[w] = 0 + } + e._d = (e._useUTC ? wt : bt).apply(null, i); + a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(); + if (e._tzm != null) e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm); + if (e._nextDay) e._a[w] = 24; + if (e._w && typeof e._w.d !== "undefined" && e._w.d !== a) c(e).weekdayMismatch = true + } + + function Un(e) { + var t, n, i, r, a, s, o, u, d; + t = e._w; + if (t.GG != null || t.W != null || t.E != null) { + a = 1; + s = 4; + n = Bn(t.GG, e._a[S], Et(C(), 1, 4).year); + i = Bn(t.W, 1); + r = Bn(t.E, 1); + if (r < 1 || r > 7) u = true + } else { + a = e._locale._week.dow; + s = e._locale._week.doy; + d = Et(C(), a, s); + n = Bn(t.gg, e._a[S], d.year); + i = Bn(t.w, d.week); + if (t.d != null) { + r = t.d; + if (r < 0 || r > 6) u = true + } else if (t.e != null) { + r = t.e + a; + if (t.e < 0 || t.e > 6) u = true + } else r = a + } + if (i < 1 || i > Y(n, a, s)) c(e)._overflowWeeks = true; else if (u != null) c(e)._overflowWeekday = true; else { + o = Tt(n, i, r, a, s); + e._a[S] = o.year; + e._dayOfYear = o.dayOfYear + } + } + + function Vn(e) { + if (e._f === h.ISO_8601) { + An(e); + return + } + if (e._f === h.RFC_2822) { + jn(e); + return + } + e._a = []; + c(e).empty = true; + var t = "" + e._i, n, i, r, a, s, o = t.length, u = 0, d, l; + r = _e(e._f, e._locale).match(se) || []; + l = r.length; + for (n = 0; n < l; n++) { + a = r[n]; + i = (t.match(Xe(a, e)) || [])[0]; + if (i) { + s = t.substr(0, t.indexOf(i)); + if (s.length > 0) c(e).unusedInput.push(s); + t = t.slice(t.indexOf(i) + i.length); + u += i.length + } + if (de[a]) { + if (i) c(e).empty = false; else c(e).unusedTokens.push(a); + et(a, i, e) + } else if (e._strict && !i) c(e).unusedTokens.push(a) + } + c(e).charsLeftOver = o - u; + if (t.length > 0) c(e).unusedInput.push(t); + if (e._a[w] <= 12 && c(e).bigHour === true && e._a[w] > 0) c(e).bigHour = undefined; + c(e).parsedDateParts = e._a.slice(0); + c(e).meridiem = e._meridiem; + e._a[w] = Gn(e._locale, e._a[w], e._meridiem); + d = c(e).era; + if (d !== null) e._a[S] = e._locale.erasConvertYear(d, e._a[S]); + zn(e); + bn(e) + } + + function Gn(e, t, n) { + var i; + if (n == null) return t; + if (e.meridiemHour != null) return e.meridiemHour(t, n); else if (e.isPM != null) { + i = e.isPM(n); + if (i && t < 12) t += 12; + if (!i && t === 12) t = 0; + return t + } else return t + } + + function Jn(e) { + var t, n, i, r, a, s, o = false, u = e._f.length; + if (u === 0) { + c(e).invalidFormat = true; + e._d = new Date(NaN); + return + } + for (r = 0; r < u; r++) { + a = 0; + s = false; + t = K({}, e); + if (e._useUTC != null) t._useUTC = e._useUTC; + t._f = e._f[r]; + Vn(t); + if (V(t)) s = true; + a += c(t).charsLeftOver; + a += c(t).unusedTokens.length * 10; + c(t).score = a; + if (!o) { + if (i == null || a < i || s) { + i = a; + n = t; + if (s) o = true + } + } else if (a < i) { + i = a; + n = t + } + } + z(e, n || t) + } + + function qn(e) { + if (e._d) return; + var t = we(e._i), n = t.day === undefined ? t.date : t.day; + e._a = N([t.year, t.month, n, t.hour, t.minute, t.second, t.millisecond], function (e) { + return e && parseInt(e, 10) + }); + zn(e) + } + + function Kn(e) { + var t = new X(bn(Xn(e))); + if (t._nextDay) { + t.add(1, "d"); + t._nextDay = undefined + } + return t + } + + function Xn(e) { + var t = e._i, n = e._f; + e._locale = e._locale || Sn(e._l); + if (t === null || n === undefined && t === "") return G({nullInput: true}); + if (typeof t === "string") e._i = t = e._locale.preparse(t); + if (_(t)) return new X(bn(t)); else if (B(t)) e._d = t; else if (s(n)) Jn(e); else if (n) Vn(e); else Zn(e); + if (!V(e)) e._d = null; + return e + } + + function Zn(e) { + var t = e._i; + if (o(t)) e._d = new Date(h.now()); else if (B(t)) e._d = new Date(t.valueOf()); else if (typeof t === "string") Fn(e); else if (s(t)) { + e._a = N(t.slice(0), function (e) { + return parseInt(e, 10) + }); + zn(e) + } else if (j(t)) qn(e); else if (d(t)) e._d = new Date(t); else h.createFromInputFallback(e) + } + + function $n(e, t, n, i, r) { + var a = {}; + if (t === true || t === false) { + i = t; + t = undefined + } + if (n === true || n === false) { + i = n; + n = undefined + } + if (j(e) && F(e) || s(e) && e.length === 0) e = undefined; + a._isAMomentObject = true; + a._useUTC = a._isUTC = r; + a._l = n; + a._i = e; + a._f = t; + a._strict = i; + return Kn(a) + } + + function C(e, t, n, i) { + return $n(e, t, n, i, false) + } + + h.createFromInputFallback = e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), " + "which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are " + "discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (e) { + e._d = new Date(e._i + (e._useUTC ? " UTC" : "")) + }), h.ISO_8601 = function () { + }, h.RFC_2822 = function () { + }; + var Qn = e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function () { + var e = C.apply(null, arguments); + if (this.isValid() && e.isValid()) return e < this ? this : e; else return G() + }), + ei = e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function () { + var e = C.apply(null, arguments); + if (this.isValid() && e.isValid()) return e > this ? this : e; else return G() + }); + + function ti(e, t) { + var n, i; + if (t.length === 1 && s(t[0])) t = t[0]; + if (!t.length) return C(); + n = t[0]; + for (i = 1; i < t.length; ++i) if (!t[i].isValid() || t[i][e](n)) n = t[i]; + return n + } + + function ni() { + var e = [].slice.call(arguments, 0); + return ti("isBefore", e) + } + + function ii() { + var e = [].slice.call(arguments, 0); + return ti("isAfter", e) + } + + var ri = function () { + return Date.now ? Date.now() : +new Date + }, ai = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond"]; + + function si(e) { + var t, n = false, i, r = ai.length; + for (t in e) if (u(e, t) && !(E.call(ai, t) !== -1 && (e[t] == null || !isNaN(e[t])))) return false; + for (i = 0; i < r; ++i) if (e[ai[i]]) { + if (n) return false; + if (parseFloat(e[ai[i]]) !== y(e[ai[i]])) n = true + } + return true + } + + function oi() { + return this._isValid + } + + function ui() { + return R(NaN) + } + + function di(e) { + var t = we(e), n = t.year || 0, i = t.quarter || 0, r = t.month || 0, a = t.week || t.isoWeek || 0, + s = t.day || 0, o = t.hour || 0, u = t.minute || 0, d = t.second || 0, l = t.millisecond || 0; + this._isValid = si(t); + this._milliseconds = +l + d * 1e3 + u * 6e4 + o * 1e3 * 60 * 60; + this._days = +s + a * 7; + this._months = +r + i * 3 + n * 12; + this._data = {}; + this._locale = Sn(); + this._bubble() + } + + function li(e) { + return e instanceof di + } + + function hi(e) { + if (e < 0) return Math.round(-1 * e) * -1; else return Math.round(e) + } + + function ci(e, t, n) { + var i = Math.min(e.length, t.length), r = Math.abs(e.length - t.length), a = 0, s; + for (s = 0; s < i; s++) if (n && e[s] !== t[s] || !n && y(e[s]) !== y(t[s])) a++; + return a + r + } + + function _i(e, n) { + i(e, 0, 0, function () { + var e = this.utcOffset(), t = "+"; + if (e < 0) { + e = -e; + t = "-" + } + return t + a(~~(e / 60), 2) + n + a(~~e % 60, 2) + }) + } + + _i("Z", ":"), _i("ZZ", ""), g("Z", Ge), g("ZZ", Ge), L(["Z", "ZZ"], function (e, t, n) { + n._useUTC = true; + n._tzm = mi(Ge, e) + }); + var fi = /([\+\-]|\d\d)/gi; + + function mi(e, t) { + var n = (t || "").match(e), i, r, a; + if (n === null) return null; + i = n[n.length - 1] || []; + r = (i + "").match(fi) || ["-", 0, 0]; + a = +(r[1] * 60) + y(r[2]); + return a === 0 ? 0 : r[0] === "+" ? a : -a + } + + function pi(e, t) { + var n, i; + if (t._isUTC) { + n = t.clone(); + i = (_(e) || B(e) ? e.valueOf() : C(e).valueOf()) - n.valueOf(); + n._d.setTime(n._d.valueOf() + i); + h.updateOffset(n, false); + return n + } else return C(e).local() + } + + function yi(e) { + return -Math.round(e._d.getTimezoneOffset()) + } + + function vi(e, t, n) { + var i = this._offset || 0, r; + if (!this.isValid()) return e != null ? this : NaN; + if (e != null) { + if (typeof e === "string") { + e = mi(Ge, e); + if (e === null) return this + } else if (Math.abs(e) < 16 && !n) e = e * 60; + if (!this._isUTC && t) r = yi(this); + this._offset = e; + this._isUTC = true; + if (r != null) this.add(r, "m"); + if (i !== e) if (!t || this._changeInProgress) Oi(this, R(e - i, "m"), 1, false); else if (!this._changeInProgress) { + this._changeInProgress = true; + h.updateOffset(this, true); + this._changeInProgress = null + } + return this + } else return this._isUTC ? i : yi(this) + } + + function gi(e, t) { + if (e != null) { + if (typeof e !== "string") e = -e; + this.utcOffset(e, t); + return this + } else return -this.utcOffset() + } + + function Mi(e) { + return this.utcOffset(0, e) + } + + function Li(e) { + if (this._isUTC) { + this.utcOffset(0, e); + this._isUTC = false; + if (e) this.subtract(yi(this), "m") + } + return this + } + + function Si() { + if (this._tzm != null) this.utcOffset(this._tzm, false, true); else if (typeof this._i === "string") { + var e = mi(Ve, this._i); + if (e != null) this.utcOffset(e); else this.utcOffset(0, true) + } + return this + } + + function ki(e) { + if (!this.isValid()) return false; + e = e ? C(e).utcOffset() : 0; + return (this.utcOffset() - e) % 60 === 0 + } + + function bi() { + return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() + } + + function wi() { + if (!o(this._isDSTShifted)) return this._isDSTShifted; + var e = {}, t; + K(e, this); + e = Xn(e); + if (e._a) { + t = e._isUTC ? l(e._a) : C(e._a); + this._isDSTShifted = this.isValid() && ci(e._a, t.toArray()) > 0 + } else this._isDSTShifted = false; + return this._isDSTShifted + } + + function Di() { + return this.isValid() ? !this._isUTC : false + } + + function Ti() { + return this.isValid() ? this._isUTC : false + } + + function Ei() { + return this.isValid() ? this._isUTC && this._offset === 0 : false + } + + h.updateOffset = function () { + }; + var Yi = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, + Pi = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; + + function R(e, t) { + var n = e, i = null, r, a, s; + if (li(e)) n = {ms: e._milliseconds, d: e._days, M: e._months}; else if (d(e) || !isNaN(+e)) { + n = {}; + if (t) n[t] = +e; else n.milliseconds = +e + } else if (i = Yi.exec(e)) { + r = i[1] === "-" ? -1 : 1; + n = { + y: 0, + d: y(i[b]) * r, + h: y(i[w]) * r, + m: y(i[D]) * r, + s: y(i[T]) * r, + ms: y(hi(i[tt] * 1e3)) * r + } + } else if (i = Pi.exec(e)) { + r = i[1] === "-" ? -1 : 1; + n = { + y: Ci(i[2], r), + M: Ci(i[3], r), + w: Ci(i[4], r), + d: Ci(i[5], r), + h: Ci(i[6], r), + m: Ci(i[7], r), + s: Ci(i[8], r) + } + } else if (n == null) n = {}; else if (typeof n === "object" && ("from" in n || "to" in n)) { + s = Ai(C(n.from), C(n.to)); + n = {}; + n.ms = s.milliseconds; + n.M = s.months + } + a = new di(n); + if (li(e) && u(e, "_locale")) a._locale = e._locale; + if (li(e) && u(e, "_isValid")) a._isValid = e._isValid; + return a + } + + function Ci(e, t) { + var n = e && parseFloat(e.replace(",", ".")); + return (isNaN(n) ? 0 : n) * t + } + + function Ri(e, t) { + var n = {}; + n.months = t.month() - e.month() + (t.year() - e.year()) * 12; + if (e.clone().add(n.months, "M").isAfter(t)) --n.months; + n.milliseconds = +t - +e.clone().add(n.months, "M"); + return n + } + + function Ai(e, t) { + var n; + if (!(e.isValid() && t.isValid())) return {milliseconds: 0, months: 0}; + t = pi(t, e); + if (e.isBefore(t)) n = Ri(e, t); else { + n = Ri(t, e); + n.milliseconds = -n.milliseconds; + n.months = -n.months + } + return n + } + + function xi(r, a) { + return function (e, t) { + var n, i; + if (t !== null && !isNaN(+t)) { + ee(a, "moment()." + a + "(period, number) is deprecated. Please use moment()." + a + "(number, period). " + "See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."); + i = e; + e = t; + t = i + } + n = R(e, t); + Oi(this, n, r); + return this + } + } + + function Oi(e, t, n, i) { + var r = t._milliseconds, a = hi(t._days), s = hi(t._months); + if (!e.isValid()) return; + i = i == null ? true : i; + if (s) mt(e, Pe(e, "Month") + s * n); + if (a) Ce(e, "Date", Pe(e, "Date") + a * n); + if (r) e._d.setTime(e._d.valueOf() + r * n); + if (i) h.updateOffset(e, a || s) + } + + R.fn = di.prototype, R.invalid = ui; + var Ii = xi(1, "add"), Wi = xi(-1, "subtract"); + + function Hi(e) { + return typeof e === "string" || e instanceof String + } + + function ji(e) { + return _(e) || B(e) || Hi(e) || d(e) || Bi(e) || Fi(e) || e === null || e === undefined + } + + function Fi(e) { + var t = j(e) && !F(e), n = false, + i = ["years", "year", "y", "months", "month", "M", "days", "day", "d", "dates", "date", "D", "hours", "hour", "h", "minutes", "minute", "m", "seconds", "second", "s", "milliseconds", "millisecond", "ms"], + r, a, s = i.length; + for (r = 0; r < s; r += 1) { + a = i[r]; + n = n || u(e, a) + } + return t && n + } + + function Bi(t) { + var e = s(t), n = false; + if (e) n = t.filter(function (e) { + return !d(e) && Hi(t) + }).length === 0; + return e && n + } + + function Ni(e) { + var t = j(e) && !F(e), n = false, + i = ["sameDay", "nextDay", "lastDay", "nextWeek", "lastWeek", "sameElse"], r, a; + for (r = 0; r < i.length; r += 1) { + a = i[r]; + n = n || u(e, a) + } + return t && n + } + + function zi(e, t) { + var n = e.diff(t, "days", true); + return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse" + } + + function Ui(e, t) { + if (arguments.length === 1) if (!arguments[0]) { + e = undefined; + t = undefined + } else if (ji(arguments[0])) { + e = arguments[0]; + t = undefined + } else if (Ni(arguments[0])) { + t = arguments[0]; + e = undefined + } + var n = e || C(), i = pi(n, this).startOf("day"), r = h.calendarFormat(this, i) || "sameElse", + a = t && (f(t[r]) ? t[r].call(this, n) : t[r]); + return this.format(a || this.localeData().calendar(r, this, C(n))) + } + + function Vi() { + return new X(this) + } + + function Gi(e, t) { + var n = _(e) ? e : C(e); + if (!(this.isValid() && n.isValid())) return false; + t = m(t) || "millisecond"; + if (t === "millisecond") return this.valueOf() > n.valueOf(); else return n.valueOf() < this.clone().startOf(t).valueOf() + } + + function Ji(e, t) { + var n = _(e) ? e : C(e); + if (!(this.isValid() && n.isValid())) return false; + t = m(t) || "millisecond"; + if (t === "millisecond") return this.valueOf() < n.valueOf(); else return this.clone().endOf(t).valueOf() < n.valueOf() + } + + function qi(e, t, n, i) { + var r = _(e) ? e : C(e), a = _(t) ? t : C(t); + if (!(this.isValid() && r.isValid() && a.isValid())) return false; + i = i || "()"; + return (i[0] === "(" ? this.isAfter(r, n) : !this.isBefore(r, n)) && (i[1] === ")" ? this.isBefore(a, n) : !this.isAfter(a, n)) + } + + function Ki(e, t) { + var n = _(e) ? e : C(e), i; + if (!(this.isValid() && n.isValid())) return false; + t = m(t) || "millisecond"; + if (t === "millisecond") return this.valueOf() === n.valueOf(); else { + i = n.valueOf(); + return this.clone().startOf(t).valueOf() <= i && i <= this.clone().endOf(t).valueOf() + } + } + + function Xi(e, t) { + return this.isSame(e, t) || this.isAfter(e, t) + } + + function Zi(e, t) { + return this.isSame(e, t) || this.isBefore(e, t) + } + + function $i(e, t, n) { + var i, r, a; + if (!this.isValid()) return NaN; + i = pi(e, this); + if (!i.isValid()) return NaN; + r = (i.utcOffset() - this.utcOffset()) * 6e4; + t = m(t); + switch (t) { + case"year": + a = Qi(this, i) / 12; + break; + case"month": + a = Qi(this, i); + break; + case"quarter": + a = Qi(this, i) / 3; + break; + case"second": + a = (this - i) / 1e3; + break; + case"minute": + a = (this - i) / 6e4; + break; + case"hour": + a = (this - i) / 36e5; + break; + case"day": + a = (this - i - r) / 864e5; + break; + case"week": + a = (this - i - r) / 6048e5; + break; + default: + a = this - i + } + return n ? a : p(a) + } + + function Qi(e, t) { + if (e.date() < t.date()) return -Qi(t, e); + var n = (t.year() - e.year()) * 12 + (t.month() - e.month()), i = e.clone().add(n, "months"), r, a; + if (t - i < 0) { + r = e.clone().add(n - 1, "months"); + a = (t - i) / (i - r) + } else { + r = e.clone().add(n + 1, "months"); + a = (t - i) / (r - i) + } + return -(n + a) || 0 + } + + function er() { + return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ") + } + + function tr(e) { + if (!this.isValid()) return null; + var t = e !== true, n = t ? this.clone().utc() : this; + if (n.year() < 0 || n.year() > 9999) return ce(n, t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"); + if (f(Date.prototype.toISOString)) if (t) return this.toDate().toISOString(); else return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", ce(n, "Z")); + return ce(n, t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ") + } + + function nr() { + if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)"; + var e = "moment", t = "", n, i, r, a; + if (!this.isLocal()) { + e = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone"; + t = "Z" + } + n = "[" + e + '("]'; + i = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY"; + r = "-MM-DD[T]HH:mm:ss.SSS"; + a = t + '[")]'; + return this.format(n + i + r + a) + } + + function ir(e) { + if (!e) e = this.isUtc() ? h.defaultFormatUtc : h.defaultFormat; + var t = ce(this, e); + return this.localeData().postformat(t) + } + + function rr(e, t) { + if (this.isValid() && (_(e) && e.isValid() || C(e).isValid())) return R({ + to: this, + from: e + }).locale(this.locale()).humanize(!t); else return this.localeData().invalidDate() + } + + function ar(e) { + return this.from(C(), e) + } + + function sr(e, t) { + if (this.isValid() && (_(e) && e.isValid() || C(e).isValid())) return R({ + from: this, + to: e + }).locale(this.locale()).humanize(!t); else return this.localeData().invalidDate() + } + + function or(e) { + return this.to(C(), e) + } + + function ur(e) { + var t; + if (e === undefined) return this._locale._abbr; else { + t = Sn(e); + if (t != null) this._locale = t; + return this + } + } + + h.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", h.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]"; + var dr = e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (e) { + if (e === undefined) return this.localeData(); else return this.locale(e) + }); + + function lr() { + return this._locale + } + + var hr = 1e3, cr = 60 * hr, _r = 60 * cr, fr = (365 * 400 + 97) * 24 * _r; + + function mr(e, t) { + return (e % t + t) % t + } + + function pr(e, t, n) { + if (e < 100 && e >= 0) return new Date(e + 400, t, n) - fr; else return new Date(e, t, n).valueOf() + } + + function yr(e, t, n) { + if (e < 100 && e >= 0) return Date.UTC(e + 400, t, n) - fr; else return Date.UTC(e, t, n) + } + + function vr(e) { + var t, n; + e = m(e); + if (e === undefined || e === "millisecond" || !this.isValid()) return this; + n = this._isUTC ? yr : pr; + switch (e) { + case"year": + t = n(this.year(), 0, 1); + break; + case"quarter": + t = n(this.year(), this.month() - this.month() % 3, 1); + break; + case"month": + t = n(this.year(), this.month(), 1); + break; + case"week": + t = n(this.year(), this.month(), this.date() - this.weekday()); + break; + case"isoWeek": + t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + case"day": + case"date": + t = n(this.year(), this.month(), this.date()); + break; + case"hour": + t = this._d.valueOf(); + t -= mr(t + (this._isUTC ? 0 : this.utcOffset() * cr), _r); + break; + case"minute": + t = this._d.valueOf(); + t -= mr(t, cr); + break; + case"second": + t = this._d.valueOf(); + t -= mr(t, hr); + break + } + this._d.setTime(t); + h.updateOffset(this, true); + return this + } + + function gr(e) { + var t, n; + e = m(e); + if (e === undefined || e === "millisecond" || !this.isValid()) return this; + n = this._isUTC ? yr : pr; + switch (e) { + case"year": + t = n(this.year() + 1, 0, 1) - 1; + break; + case"quarter": + t = n(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + case"month": + t = n(this.year(), this.month() + 1, 1) - 1; + break; + case"week": + t = n(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + case"isoWeek": + t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + case"day": + case"date": + t = n(this.year(), this.month(), this.date() + 1) - 1; + break; + case"hour": + t = this._d.valueOf(); + t += _r - mr(t + (this._isUTC ? 0 : this.utcOffset() * cr), _r) - 1; + break; + case"minute": + t = this._d.valueOf(); + t += cr - mr(t, cr) - 1; + break; + case"second": + t = this._d.valueOf(); + t += hr - mr(t, hr) - 1; + break + } + this._d.setTime(t); + h.updateOffset(this, true); + return this + } + + function Mr() { + return this._d.valueOf() - (this._offset || 0) * 6e4 + } + + function Lr() { + return Math.floor(this.valueOf() / 1e3) + } + + function Sr() { + return new Date(this.valueOf()) + } + + function kr() { + var e = this; + return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()] + } + + function br() { + var e = this; + return { + years: e.year(), + months: e.month(), + date: e.date(), + hours: e.hours(), + minutes: e.minutes(), + seconds: e.seconds(), + milliseconds: e.milliseconds() + } + } + + function wr() { + return this.isValid() ? this.toISOString() : null + } + + function Dr() { + return V(this) + } + + function Tr() { + return z({}, c(this)) + } + + function Er() { + return c(this).overflow + } + + function Yr() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + } + } + + function Pr(e, t) { + var n, i, r, a = this._eras || Sn("en")._eras; + for (n = 0, i = a.length; n < i; ++n) { + switch (typeof a[n].since) { + case"string": + r = h(a[n].since).startOf("day"); + a[n].since = r.valueOf(); + break + } + switch (typeof a[n].until) { + case"undefined": + a[n].until = +Infinity; + break; + case"string": + r = h(a[n].until).startOf("day").valueOf(); + a[n].until = r.valueOf(); + break + } + } + return a + } + + function Cr(e, t, n) { + var i, r, a = this.eras(), s, o, u; + e = e.toUpperCase(); + for (i = 0, r = a.length; i < r; ++i) { + s = a[i].name.toUpperCase(); + o = a[i].abbr.toUpperCase(); + u = a[i].narrow.toUpperCase(); + if (n) switch (t) { + case"N": + case"NN": + case"NNN": + if (o === e) return a[i]; + break; + case"NNNN": + if (s === e) return a[i]; + break; + case"NNNNN": + if (u === e) return a[i]; + break + } else if ([s, o, u].indexOf(e) >= 0) return a[i] + } + } + + function Rr(e, t) { + var n = e.since <= e.until ? +1 : -1; + if (t === undefined) return h(e.since).year(); else return h(e.since).year() + (t - e.offset) * n + } + + function Ar() { + var e, t, n, i = this.localeData().eras(); + for (e = 0, t = i.length; e < t; ++e) { + n = this.clone().startOf("day").valueOf(); + if (i[e].since <= n && n <= i[e].until) return i[e].name; + if (i[e].until <= n && n <= i[e].since) return i[e].name + } + return "" + } + + function xr() { + var e, t, n, i = this.localeData().eras(); + for (e = 0, t = i.length; e < t; ++e) { + n = this.clone().startOf("day").valueOf(); + if (i[e].since <= n && n <= i[e].until) return i[e].narrow; + if (i[e].until <= n && n <= i[e].since) return i[e].narrow + } + return "" + } + + function Or() { + var e, t, n, i = this.localeData().eras(); + for (e = 0, t = i.length; e < t; ++e) { + n = this.clone().startOf("day").valueOf(); + if (i[e].since <= n && n <= i[e].until) return i[e].abbr; + if (i[e].until <= n && n <= i[e].since) return i[e].abbr + } + return "" + } + + function Ir() { + var e, t, n, i, r = this.localeData().eras(); + for (e = 0, t = r.length; e < t; ++e) { + n = r[e].since <= r[e].until ? +1 : -1; + i = this.clone().startOf("day").valueOf(); + if (r[e].since <= i && i <= r[e].until || r[e].until <= i && i <= r[e].since) return (this.year() - h(r[e].since).year()) * n + r[e].offset + } + return this.year() + } + + function Wr(e) { + if (!u(this, "_erasNameRegex")) Ur.call(this); + return e ? this._erasNameRegex : this._erasRegex + } + + function Hr(e) { + if (!u(this, "_erasAbbrRegex")) Ur.call(this); + return e ? this._erasAbbrRegex : this._erasRegex + } + + function jr(e) { + if (!u(this, "_erasNarrowRegex")) Ur.call(this); + return e ? this._erasNarrowRegex : this._erasRegex + } + + function Fr(e, t) { + return t.erasAbbrRegex(e) + } + + function Br(e, t) { + return t.erasNameRegex(e) + } + + function Nr(e, t) { + return t.erasNarrowRegex(e) + } + + function zr(e, t) { + return t._eraYearOrdinalRegex || ze + } + + function Ur() { + var e = [], t = [], n = [], i = [], r, a, s = this.eras(); + for (r = 0, a = s.length; r < a; ++r) { + t.push(M(s[r].name)); + e.push(M(s[r].abbr)); + n.push(M(s[r].narrow)); + i.push(M(s[r].name)); + i.push(M(s[r].abbr)); + i.push(M(s[r].narrow)) + } + this._erasRegex = new RegExp("^(" + i.join("|") + ")", "i"); + this._erasNameRegex = new RegExp("^(" + t.join("|") + ")", "i"); + this._erasAbbrRegex = new RegExp("^(" + e.join("|") + ")", "i"); + this._erasNarrowRegex = new RegExp("^(" + n.join("|") + ")", "i") + } + + function Vr(e, t) { + i(0, [e, e.length], 0, t) + } + + function Gr(e) { + return $r.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy) + } + + function Jr(e) { + return $r.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4) + } + + function qr() { + return Y(this.year(), 1, 4) + } + + function Kr() { + return Y(this.isoWeekYear(), 1, 4) + } + + function Xr() { + var e = this.localeData()._week; + return Y(this.year(), e.dow, e.doy) + } + + function Zr() { + var e = this.localeData()._week; + return Y(this.weekYear(), e.dow, e.doy) + } + + function $r(e, t, n, i, r) { + var a; + if (e == null) return Et(this, i, r).year; else { + a = Y(e, i, r); + if (t > a) t = a; + return Qr.call(this, e, t, n, i, r) + } + } + + function Qr(e, t, n, i, r) { + var a = Tt(e, t, n, i, r), s = wt(a.year, 0, a.dayOfYear); + this.year(s.getUTCFullYear()); + this.month(s.getUTCMonth()); + this.date(s.getUTCDate()); + return this + } + + function ea(e) { + return e == null ? Math.ceil((this.month() + 1) / 3) : this.month((e - 1) * 3 + this.month() % 3) + } + + i("N", 0, 0, "eraAbbr"), i("NN", 0, 0, "eraAbbr"), i("NNN", 0, 0, "eraAbbr"), i("NNNN", 0, 0, "eraName"), i("NNNNN", 0, 0, "eraNarrow"), i("y", ["y", 1], "yo", "eraYear"), i("y", ["yy", 2], 0, "eraYear"), i("y", ["yyy", 3], 0, "eraYear"), i("y", ["yyyy", 4], 0, "eraYear"), g("N", Fr), g("NN", Fr), g("NNN", Fr), g("NNNN", Br), g("NNNNN", Nr), L(["N", "NN", "NNN", "NNNN", "NNNNN"], function (e, t, n, i) { + var r = n._locale.erasParse(e, i, n._strict); + if (r) c(n).era = r; else c(n).invalidEra = e + }), g("y", ze), g("yy", ze), g("yyy", ze), g("yyyy", ze), g("yo", zr), L(["y", "yy", "yyy", "yyyy"], S), L(["yo"], function (e, t, n, i) { + var r; + if (n._locale._eraYearOrdinalRegex) r = e.match(n._locale._eraYearOrdinalRegex); + if (n._locale.eraYearOrdinalParse) t[S] = n._locale.eraYearOrdinalParse(e, r); else t[S] = parseInt(e, 10) + }), i(0, ["gg", 2], 0, function () { + return this.weekYear() % 100 + }), i(0, ["GG", 2], 0, function () { + return this.isoWeekYear() % 100 + }), Vr("gggg", "weekYear"), Vr("ggggg", "weekYear"), Vr("GGGG", "isoWeekYear"), Vr("GGGGG", "isoWeekYear"), t("weekYear", "gg"), t("isoWeekYear", "GG"), n("weekYear", 1), n("isoWeekYear", 1), g("G", Ue), g("g", Ue), g("GG", v, r), g("gg", v, r), g("GGGG", Be, Ie), g("gggg", Be, Ie), g("GGGGG", Ne, We), g("ggggg", Ne, We), Qe(["gggg", "ggggg", "GGGG", "GGGGG"], function (e, t, n, i) { + t[i.substr(0, 2)] = y(e) + }), Qe(["gg", "GG"], function (e, t, n, i) { + t[i] = h.parseTwoDigitYear(e) + }), i("Q", 0, "Qo", "quarter"), t("quarter", "Q"), n("quarter", 7), g("Q", xe), L("Q", function (e, t) { + t[k] = (y(e) - 1) * 3 + }), i("D", ["DD", 2], "Do", "date"), t("date", "D"), n("date", 9), g("D", v), g("DD", v, r), g("Do", function (e, t) { + return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient + }), L(["D", "DD"], b), L("Do", function (e, t) { + t[b] = y(e.match(v)[0]) + }); + var ta = Ye("Date", true); + + function na(e) { + var t = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; + return e == null ? t : this.add(e - t, "d") + } + + i("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), t("dayOfYear", "DDD"), n("dayOfYear", 4), g("DDD", Fe), g("DDDD", Oe), L(["DDD", "DDDD"], function (e, t, n) { + n._dayOfYear = y(e) + }), i("m", ["mm", 2], 0, "minute"), t("minute", "m"), n("minute", 14), g("m", v), g("mm", v, r), L(["m", "mm"], D); + var ia = Ye("Minutes", false), + ra = (i("s", ["ss", 2], 0, "second"), t("second", "s"), n("second", 15), g("s", v), g("ss", v, r), L(["s", "ss"], T), Ye("Seconds", false)), + aa, sa; + for (i("S", 0, 0, function () { + return ~~(this.millisecond() / 100) + }), i(0, ["SS", 2], 0, function () { + return ~~(this.millisecond() / 10) + }), i(0, ["SSS", 3], 0, "millisecond"), i(0, ["SSSS", 4], 0, function () { + return this.millisecond() * 10 + }), i(0, ["SSSSS", 5], 0, function () { + return this.millisecond() * 100 + }), i(0, ["SSSSSS", 6], 0, function () { + return this.millisecond() * 1e3 + }), i(0, ["SSSSSSS", 7], 0, function () { + return this.millisecond() * 1e4 + }), i(0, ["SSSSSSSS", 8], 0, function () { + return this.millisecond() * 1e5 + }), i(0, ["SSSSSSSSS", 9], 0, function () { + return this.millisecond() * 1e6 + }), t("millisecond", "ms"), n("millisecond", 16), g("S", Fe, xe), g("SS", Fe, r), g("SSS", Fe, Oe), aa = "SSSS"; aa.length <= 9; aa += "S") g(aa, ze); + + function oa(e, t) { + t[tt] = y(("0." + e) * 1e3) + } + + for (aa = "S"; aa.length <= 9; aa += "S") L(aa, oa); + + function ua() { + return this._isUTC ? "UTC" : "" + } + + function da() { + return this._isUTC ? "Coordinated Universal Time" : "" + } + + sa = Ye("Milliseconds", false), i("z", 0, 0, "zoneAbbr"), i("zz", 0, 0, "zoneName"); + var A = X.prototype; + if (A.add = Ii, A.calendar = Ui, A.clone = Vi, A.diff = $i, A.endOf = gr, A.format = ir, A.from = rr, A.fromNow = ar, A.to = sr, A.toNow = or, A.get = Re, A.invalidAt = Er, A.isAfter = Gi, A.isBefore = Ji, A.isBetween = qi, A.isSame = Ki, A.isSameOrAfter = Xi, A.isSameOrBefore = Zi, A.isValid = Dr, A.lang = dr, A.locale = ur, A.localeData = lr, A.max = ei, A.min = Qn, A.parsingFlags = Tr, A.set = Ae, A.startOf = vr, A.subtract = Wi, A.toArray = kr, A.toObject = br, A.toDate = Sr, A.toISOString = tr, A.inspect = nr, typeof Symbol !== "undefined" && Symbol.for != null) A[Symbol.for("nodejs.util.inspect.custom")] = function () { + return "Moment<" + this.format() + ">" + }; + + function la(e) { + return C(e * 1e3) + } + + function ha() { + return C.apply(null, arguments).parseZone() + } + + function ca(e) { + return e + } + + A.toJSON = wr, A.toString = er, A.unix = Lr, A.valueOf = Mr, A.creationData = Yr, A.eraName = Ar, A.eraNarrow = xr, A.eraAbbr = Or, A.eraYear = Ir, A.year = St, A.isLeapYear = kt, A.weekYear = Gr, A.isoWeekYear = Jr, A.quarter = A.quarters = ea, A.month = pt, A.daysInMonth = yt, A.week = A.weeks = At, A.isoWeek = A.isoWeeks = xt, A.weeksInYear = Xr, A.weeksInWeekYear = Zr, A.isoWeeksInYear = qr, A.isoWeeksInISOWeekYear = Kr, A.date = ta, A.day = A.days = Kt, A.weekday = Xt, A.isoWeekday = Zt, A.dayOfYear = na, A.hour = A.hours = dn, A.minute = A.minutes = ia, A.second = A.seconds = ra, A.millisecond = A.milliseconds = sa, A.utcOffset = vi, A.utc = Mi, A.local = Li, A.parseZone = Si, A.hasAlignedHourOffset = ki, A.isDST = bi, A.isLocal = Di, A.isUtcOffset = Ti, A.isUtc = Ei, A.isUTC = Ei, A.zoneAbbr = ua, A.zoneName = da, A.dates = e("dates accessor is deprecated. Use date instead.", ta), A.months = e("months accessor is deprecated. Use month instead", pt), A.years = e("years accessor is deprecated. Use year instead", St), A.zone = e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", gi), A.isDSTShifted = e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", wi); + var x = ie.prototype; + + function _a(e, t, n, i) { + var r = Sn(), a = l().set(i, t); + return r[n](a, e) + } + + function fa(e, t, n) { + if (d(e)) { + t = e; + e = undefined + } + e = e || ""; + if (t != null) return _a(e, t, n, "month"); + var i, r = []; + for (i = 0; i < 12; i++) r[i] = _a(e, i, n, "month"); + return r + } + + function ma(e, t, n, i) { + if (typeof e === "boolean") { + if (d(t)) { + n = t; + t = undefined + } + t = t || "" + } else { + t = e; + n = t; + e = false; + if (d(t)) { + n = t; + t = undefined + } + t = t || "" + } + var r = Sn(), a = e ? r._week.dow : 0, s, o = []; + if (n != null) return _a(t, (n + a) % 7, i, "day"); + for (s = 0; s < 7; s++) o[s] = _a(t, (s + a) % 7, i, "day"); + return o + } + + function pa(e, t) { + return fa(e, t, "months") + } + + function ya(e, t) { + return fa(e, t, "monthsShort") + } + + function va(e, t, n) { + return ma(e, t, n, "weekdays") + } + + function ga(e, t, n) { + return ma(e, t, n, "weekdaysShort") + } + + function Ma(e, t, n) { + return ma(e, t, n, "weekdaysMin") + } + + x.calendar = ae, x.longDateFormat = me, x.invalidDate = ye, x.ordinal = Me, x.preparse = ca, x.postformat = ca, x.relativeTime = Se, x.pastFuture = ke, x.set = te, x.eras = Pr, x.erasParse = Cr, x.erasConvertYear = Rr, x.erasAbbrRegex = Hr, x.erasNameRegex = Wr, x.erasNarrowRegex = jr, x.months = ht, x.monthsShort = ct, x.monthsParse = ft, x.monthsRegex = gt, x.monthsShortRegex = vt, x.week = Yt, x.firstDayOfYear = Rt, x.firstDayOfWeek = Ct, x.weekdays = Ut, x.weekdaysMin = Gt, x.weekdaysShort = Vt, x.weekdaysParse = qt, x.weekdaysRegex = $t, x.weekdaysShortRegex = Qt, x.weekdaysMinRegex = en, x.isPM = on, x.meridiem = ln, gn("en", { + eras: [{ + since: "0001-01-01", + until: +Infinity, + offset: 1, + name: "Anno Domini", + narrow: "AD", + abbr: "AD" + }, { + since: "0000-12-31", + until: -Infinity, + offset: 1, + name: "Before Christ", + narrow: "BC", + abbr: "BC" + }], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (e) { + var t = e % 10, + n = y(e % 100 / 10) === 1 ? "th" : t === 1 ? "st" : t === 2 ? "nd" : t === 3 ? "rd" : "th"; + return e + n + } + }), h.lang = e("moment.lang is deprecated. Use moment.locale instead.", gn), h.langData = e("moment.langData is deprecated. Use moment.localeData instead.", Sn); + var La = Math.abs; + + function Sa() { + var e = this._data; + this._milliseconds = La(this._milliseconds); + this._days = La(this._days); + this._months = La(this._months); + e.milliseconds = La(e.milliseconds); + e.seconds = La(e.seconds); + e.minutes = La(e.minutes); + e.hours = La(e.hours); + e.months = La(e.months); + e.years = La(e.years); + return this + } + + function ka(e, t, n, i) { + var r = R(t, n); + e._milliseconds += i * r._milliseconds; + e._days += i * r._days; + e._months += i * r._months; + return e._bubble() + } + + function ba(e, t) { + return ka(this, e, t, 1) + } + + function wa(e, t) { + return ka(this, e, t, -1) + } + + function Da(e) { + if (e < 0) return Math.floor(e); else return Math.ceil(e) + } + + function Ta() { + var e = this._milliseconds, t = this._days, n = this._months, i = this._data, r, a, s, o, u; + if (!(e >= 0 && t >= 0 && n >= 0 || e <= 0 && t <= 0 && n <= 0)) { + e += Da(Ya(n) + t) * 864e5; + t = 0; + n = 0 + } + i.milliseconds = e % 1e3; + r = p(e / 1e3); + i.seconds = r % 60; + a = p(r / 60); + i.minutes = a % 60; + s = p(a / 60); + i.hours = s % 24; + t += p(s / 24); + u = p(Ea(t)); + n += u; + t -= Da(Ya(u)); + o = p(n / 12); + n %= 12; + i.days = t; + i.months = n; + i.years = o; + return this + } + + function Ea(e) { + return e * 4800 / 146097 + } + + function Ya(e) { + return e * 146097 / 4800 + } + + function Pa(e) { + if (!this.isValid()) return NaN; + var t, n, i = this._milliseconds; + e = m(e); + if (e === "month" || e === "quarter" || e === "year") { + t = this._days + i / 864e5; + n = this._months + Ea(t); + switch (e) { + case"month": + return n; + case"quarter": + return n / 3; + case"year": + return n / 12 + } + } else { + t = this._days + Math.round(Ya(this._months)); + switch (e) { + case"week": + return t / 7 + i / 6048e5; + case"day": + return t + i / 864e5; + case"hour": + return t * 24 + i / 36e5; + case"minute": + return t * 1440 + i / 6e4; + case"second": + return t * 86400 + i / 1e3; + case"millisecond": + return Math.floor(t * 864e5) + i; + default: + throw new Error("Unknown unit " + e) + } + } + } + + function Ca() { + if (!this.isValid()) return NaN; + return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + y(this._months / 12) * 31536e6 + } + + function Ra(e) { + return function () { + return this.as(e) + } + } + + var Aa = Ra("ms"), xa = Ra("s"), Oa = Ra("m"), Ia = Ra("h"), Wa = Ra("d"), Ha = Ra("w"), ja = Ra("M"), + Fa = Ra("Q"), Ba = Ra("y"); + + function Na() { + return R(this) + } + + function za(e) { + e = m(e); + return this.isValid() ? this[e + "s"]() : NaN + } + + function Ua(e) { + return function () { + return this.isValid() ? this._data[e] : NaN + } + } + + var Va = Ua("milliseconds"), Ga = Ua("seconds"), Ja = Ua("minutes"), qa = Ua("hours"), Ka = Ua("days"), + Xa = Ua("months"), Za = Ua("years"); + + function $a() { + return p(this.days() / 7) + } + + var Qa = Math.round, es = {ss: 44, s: 45, m: 45, h: 22, d: 26, w: null, M: 11}; + + function ts(e, t, n, i, r) { + return r.relativeTime(t || 1, !!n, e, i) + } + + function ns(e, t, n, i) { + var r = R(e).abs(), a = Qa(r.as("s")), s = Qa(r.as("m")), o = Qa(r.as("h")), u = Qa(r.as("d")), + d = Qa(r.as("M")), l = Qa(r.as("w")), h = Qa(r.as("y")), + c = a <= n.ss && ["s", a] || a < n.s && ["ss", a] || s <= 1 && ["m"] || s < n.m && ["mm", s] || o <= 1 && ["h"] || o < n.h && ["hh", o] || u <= 1 && ["d"] || u < n.d && ["dd", u]; + if (n.w != null) c = c || l <= 1 && ["w"] || l < n.w && ["ww", l]; + c = c || d <= 1 && ["M"] || d < n.M && ["MM", d] || h <= 1 && ["y"] || ["yy", h]; + c[2] = t; + c[3] = +e > 0; + c[4] = i; + return ts.apply(null, c) + } + + function is(e) { + if (e === undefined) return Qa; + if (typeof e === "function") { + Qa = e; + return true + } + return false + } + + function rs(e, t) { + if (es[e] === undefined) return false; + if (t === undefined) return es[e]; + es[e] = t; + if (e === "s") es.ss = t - 1; + return true + } + + function as(e, t) { + if (!this.isValid()) return this.localeData().invalidDate(); + var n = false, i = es, r, a; + if (typeof e === "object") { + t = e; + e = false + } + if (typeof e === "boolean") n = e; + if (typeof t === "object") { + i = Object.assign({}, es, t); + if (t.s != null && t.ss == null) i.ss = t.s - 1 + } + r = this.localeData(); + a = ns(this, !n, i, r); + if (n) a = r.pastFuture(+this, a); + return r.postformat(a) + } + + var ss = Math.abs; + + function os(e) { + return (e > 0) - (e < 0) || +e + } + + function us() { + if (!this.isValid()) return this.localeData().invalidDate(); + var e = ss(this._milliseconds) / 1e3, t = ss(this._days), n = ss(this._months), i, r, a, s, + o = this.asSeconds(), u, d, l, h; + if (!o) return "P0D"; + i = p(e / 60); + r = p(i / 60); + e %= 60; + i %= 60; + a = p(n / 12); + n %= 12; + s = e ? e.toFixed(3).replace(/\.?0+$/, "") : ""; + u = o < 0 ? "-" : ""; + d = os(this._months) !== os(o) ? "-" : ""; + l = os(this._days) !== os(o) ? "-" : ""; + h = os(this._milliseconds) !== os(o) ? "-" : ""; + return u + "P" + (a ? d + a + "Y" : "") + (n ? d + n + "M" : "") + (t ? l + t + "D" : "") + (r || i || e ? "T" : "") + (r ? h + r + "H" : "") + (i ? h + i + "M" : "") + (e ? h + s + "S" : "") + } + + var O = di.prototype; + return O.isValid = oi, O.abs = Sa, O.add = ba, O.subtract = wa, O.as = Pa, O.asMilliseconds = Aa, O.asSeconds = xa, O.asMinutes = Oa, O.asHours = Ia, O.asDays = Wa, O.asWeeks = Ha, O.asMonths = ja, O.asQuarters = Fa, O.asYears = Ba, O.valueOf = Ca, O._bubble = Ta, O.clone = Na, O.get = za, O.milliseconds = Va, O.seconds = Ga, O.minutes = Ja, O.hours = qa, O.days = Ka, O.weeks = $a, O.months = Xa, O.years = Za, O.humanize = as, O.toISOString = us, O.toString = us, O.toJSON = us, O.locale = ur, O.localeData = lr, O.toIsoString = e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", us), O.lang = dr, i("X", 0, 0, "unix"), i("x", 0, 0, "valueOf"), g("x", Ue), g("X", Je), L("X", function (e, t, n) { + n._d = new Date(parseFloat(e) * 1e3) + }), L("x", function (e, t, n) { + n._d = new Date(y(e)) + }), +//! moment.js + h.version = "2.29.4", H(C), h.fn = A, h.min = ni, h.max = ii, h.now = ri, h.utc = l, h.unix = la, h.months = pa, h.isDate = B, h.locale = gn, h.invalid = G, h.duration = R, h.isMoment = _, h.weekdays = va, h.parseZone = ha, h.localeData = Sn, h.isDuration = li, h.monthsShort = ya, h.weekdaysMin = Ma, h.defineLocale = Mn, h.updateLocale = Ln, h.locales = kn, h.weekdaysShort = ga, h.normalizeUnits = m, h.relativeTimeRounding = is, h.relativeTimeThreshold = rs, h.calendarFormat = zi, h.prototype = A, h.HTML5_FMT = { + DATETIME_LOCAL: "YYYY-MM-DDTHH:mm", + DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss", + DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS", + DATE: "YYYY-MM-DD", + TIME: "HH:mm", + TIME_SECONDS: "HH:mm:ss", + TIME_MS: "HH:mm:ss.SSS", + WEEK: "GGGG-[W]WW", + MONTH: "YYYY-MM" + }, h + }() + }.call(this, hs(283)(e)) + }, function (e, t, n) { + "use strict"; + t.__esModule = !0, t.default = function (e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") + } + }, function (e, t, n) { + "use strict"; + t.__esModule = !0; + var n = n(259), r = (n = n) && n.__esModule ? n : {default: n}; + + function i(e, t) { + for (var n = 0; n < t.length; n++) { + var i = t[n]; + i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), (0, r.default)(e, i.key, i) + } + } + + t.default = function (e, t, n) { + return t && i(e.prototype, t), n && i(e, n), e + } + }, function (e, t) { + e = e.exports = {version: "2.6.12"}; + "number" == typeof __e && (__e = e) + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}); + var i = a(n(1)), r = a(n(2)), n = a(n(10)); + + function a(e) { + return e && e.__esModule ? e : {default: e} + } + + (0, r.default)(s, null, [{ + key: "e", value: function (e, t) { + e = "[" + (e = e && !s.FORCE_GLOBAL_TAG ? e : s.GLOBAL_TAG) + "] > " + t; + s.ENABLE_CALLBACK && s.emitter.emit("log", "error", e), s.ENABLE_ERROR && (console.error ? console.error(e) : console.warn ? console.warn(e) : console.log(e)) + } + }, { + key: "i", value: function (e, t) { + e = "[" + (e = e && !s.FORCE_GLOBAL_TAG ? e : s.GLOBAL_TAG) + "] > " + t; + s.ENABLE_CALLBACK && s.emitter.emit("log", "info", e), s.ENABLE_INFO && (console.info ? console.info(e) : console.log(e)) + } + }, { + key: "w", value: function (e, t) { + e = "[" + (e = e && !s.FORCE_GLOBAL_TAG ? e : s.GLOBAL_TAG) + "] > " + t; + s.ENABLE_CALLBACK && s.emitter.emit("log", "warn", e), s.ENABLE_WARN && (console.warn ? console.warn(e) : console.log(e)) + } + }, { + key: "d", value: function (e, t) { + e = "[" + (e = e && !s.FORCE_GLOBAL_TAG ? e : s.GLOBAL_TAG) + "] > " + t; + s.ENABLE_CALLBACK && s.emitter.emit("log", "debug", e), s.ENABLE_DEBUG && (console.debug ? console.debug(e) : console.log(e)) + } + }, { + key: "v", value: function (e, t) { + e = "[" + (e = e && !s.FORCE_GLOBAL_TAG ? e : s.GLOBAL_TAG) + "] > " + t; + s.ENABLE_CALLBACK && s.emitter.emit("log", "verbose", e), s.ENABLE_VERBOSE && console.log(e) + } + }]); + r = s; + + function s() { + (0, i.default)(this, s) + } + + r.GLOBAL_TAG = "flv.js", r.FORCE_GLOBAL_TAG = !1, r.ENABLE_ERROR = !0, r.ENABLE_INFO = !0, r.ENABLE_WARN = !0, r.ENABLE_DEBUG = !0, r.ENABLE_VERBOSE = !0, r.ENABLE_CALLBACK = !1, r.emitter = new n.default, t.default = r + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}), t.NotImplementedException = t.InvalidArgumentException = t.IllegalStateException = t.RuntimeException = void 0; + var i = o(n(21)), r = o(n(25)), a = o(n(26)), s = o(n(1)), n = o(n(2)); + + function o(e) { + return e && e.__esModule ? e : {default: e} + } + + var u = t.RuntimeException = ((0, n.default)(d, [{ + key: "toString", value: function () { + return this.name + ": " + this.message + } + }, { + key: "name", get: function () { + return "RuntimeException" + } + }, { + key: "message", get: function () { + return this._message + } + }]), d); + + function d(e) { + (0, s.default)(this, d), this._message = e + } + + t.IllegalStateException = ((0, a.default)(l, u), (0, n.default)(l, [{ + key: "name", get: function () { + return "IllegalStateException" + } + }]), l); + + function l(e) { + return (0, s.default)(this, l), (0, r.default)(this, (l.__proto__ || (0, i.default)(l)).call(this, e)) + } + + t.InvalidArgumentException = ((0, a.default)(h, u), (0, n.default)(h, [{ + key: "name", get: function () { + return "InvalidArgumentException" + } + }]), h); + + function h(e) { + return (0, s.default)(this, h), (0, r.default)(this, (h.__proto__ || (0, i.default)(h)).call(this, e)) + } + + t.NotImplementedException = ((0, a.default)(c, u), (0, n.default)(c, [{ + key: "name", get: function () { + return "NotImplementedException" + } + }]), c); + + function c(e) { + return (0, s.default)(this, c), (0, r.default)(this, (c.__proto__ || (0, i.default)(c)).call(this, e)) + } + }, function (e, t) { + e = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); + "number" == typeof __g && (__g = e) + }, function (e, t, n) { + var i = n(49)("wks"), r = n(35), a = n(6).Symbol, s = "function" == typeof a; + (e.exports = function (e) { + return i[e] || (i[e] = s && a[e] || (s ? a : r)("Symbol." + e)) + }).store = i + }, function (e, t, n) { + function m(e, t, n) { + var i, r, a, s = e & m.F, o = e & m.G, u = e & m.S, d = e & m.P, l = e & m.B, h = e & m.W, + c = o ? y : y[t] || (y[t] = {}), _ = c[L], f = o ? p : u ? p[t] : (p[t] || {})[L]; + for (i in n = o ? t : n) (r = !s && f && void 0 !== f[i]) && M(c, i) || (a = (r ? f : n)[i], c[i] = o && "function" != typeof f[i] ? n[i] : l && r ? v(a, p) : h && f[i] == a ? function (i) { + function e(e, t, n) { + if (this instanceof i) { + switch (arguments.length) { + case 0: + return new i; + case 1: + return new i(e); + case 2: + return new i(e, t) + } + return new i(e, t, n) + } + return i.apply(this, arguments) + } + + return e[L] = i[L], e + }(a) : d && "function" == typeof a ? v(Function.call, a) : a, d && ((c.virtual || (c.virtual = {}))[i] = a, e & m.R && _ && !_[i] && g(_, i, a))) + } + + var p = n(6), y = n(3), v = n(22), g = n(17), M = n(18), L = "prototype"; + m.F = 1, m.G = 2, m.S = 4, m.P = 8, m.B = 16, m.W = 32, m.U = 64, m.R = 128, e.exports = m + }, function (e, t, n) { + "use strict"; + t.__esModule = !0; + var i = s(n(270)), r = s(n(272)), + a = "function" == typeof r.default && "symbol" == typeof i.default ? function (e) { + return typeof e + } : function (e) { + return e && "function" == typeof r.default && e.constructor === r.default && e !== r.default.prototype ? "symbol" : typeof e + }; + + function s(e) { + return e && e.__esModule ? e : {default: e} + } + + t.default = "function" == typeof r.default && "symbol" === a(i.default) ? function (e) { + return void 0 === e ? "undefined" : a(e) + } : function (e) { + return e && "function" == typeof r.default && e.constructor === r.default && e !== r.default.prototype ? "symbol" : void 0 === e ? "undefined" : a(e) + } + }, function (e, t, n) { + "use strict"; + var i = "object" == typeof Reflect ? Reflect : null, + u = i && "function" == typeof i.apply ? i.apply : function (e, t, n) { + return Function.prototype.apply.call(e, t, n) + }; + var r = i && "function" == typeof i.ownKeys ? i.ownKeys : Object.getOwnPropertySymbols ? function (e) { + return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)) + } : function (e) { + return Object.getOwnPropertyNames(e) + }, a = Number.isNaN || function (e) { + return e != e + }; + + function s() { + s.init.call(this) + } + + e.exports = s, e.exports.once = function (o, u) { + return new Promise(function (e, t) { + function n(e) { + o.removeListener(u, i), t(e) + } + + function i() { + "function" == typeof o.removeListener && o.removeListener("error", n), e([].slice.call(arguments)) + } + + var r, a, s; + p(o, u, i, {once: !0}), "error" !== u && (a = n, s = {once: !0}, "function" == typeof (r = o).on && p(r, "error", a, s)) + }) + }, (s.EventEmitter = s).prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0; + var o = 10; + + function d(e) { + if ("function" != typeof e) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e) + } + + function l(e) { + return void 0 === e._maxListeners ? s.defaultMaxListeners : e._maxListeners + } + + function h(e, t, n, i) { + var r, a; + return d(n), void 0 === (r = e._events) ? (r = e._events = Object.create(null), e._eventsCount = 0) : (void 0 !== r.newListener && (e.emit("newListener", t, n.listener || n), r = e._events), a = r[t]), void 0 === a ? (a = r[t] = n, ++e._eventsCount) : ("function" == typeof a ? a = r[t] = i ? [n, a] : [a, n] : i ? a.unshift(n) : a.push(n), 0 < (r = l(e)) && a.length > r && !a.warned && (a.warned = !0, (i = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit")).name = "MaxListenersExceededWarning", i.emitter = e, i.type = t, i.count = a.length, n = i, console && console.warn && console.warn(n))), e + } + + function c(e, t, n) { + e = {fired: !1, wrapFn: void 0, target: e, type: t, listener: n}, t = function () { + if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments) + }.bind(e); + return t.listener = n, e.wrapFn = t + } + + function _(e, t, n) { + e = e._events; + if (void 0 === e) return []; + e = e[t]; + { + if (void 0 === e) return []; + if ("function" == typeof e) return n ? [e.listener || e] : [e]; + if (n) { + for (var i = e, r = new Array(i.length), a = 0; a < r.length; ++a) r[a] = i[a].listener || i[a]; + return r + } + return m(e, e.length) + } + } + + function f(e) { + var t = this._events; + if (void 0 !== t) { + t = t[e]; + if ("function" == typeof t) return 1; + if (void 0 !== t) return t.length + } + return 0 + } + + function m(e, t) { + for (var n = new Array(t), i = 0; i < t; ++i) n[i] = e[i]; + return n + } + + function p(n, i, r, a) { + if ("function" == typeof n.on) a.once ? n.once(i, r) : n.on(i, r); else { + if ("function" != typeof n.addEventListener) throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof n); + n.addEventListener(i, function e(t) { + a.once && n.removeEventListener(i, e), r(t) + }) + } + } + + Object.defineProperty(s, "defaultMaxListeners", { + enumerable: !0, get: function () { + return o + }, set: function (e) { + if ("number" != typeof e || e < 0 || a(e)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e + "."); + o = e + } + }), s.init = function () { + void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0 + }, s.prototype.setMaxListeners = function (e) { + if ("number" != typeof e || e < 0 || a(e)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + "."); + return this._maxListeners = e, this + }, s.prototype.getMaxListeners = function () { + return l(this) + }, s.prototype.emit = function (e) { + for (var t = [], n = 1; n < arguments.length; n++) t.push(arguments[n]); + var i = "error" === e, r = this._events; + if (void 0 !== r) i = i && void 0 === r.error; else if (!i) return !1; + if (i) { + if ((a = 0 < t.length ? t[0] : a) instanceof Error) throw a; + i = new Error("Unhandled error." + (a ? " (" + a.message + ")" : "")); + throw i.context = a, i + } + var a = r[e]; + if (void 0 === a) return !1; + if ("function" == typeof a) u(a, this, t); else for (var s = a.length, o = m(a, s), n = 0; n < s; ++n) u(o[n], this, t); + return !0 + }, s.prototype.on = s.prototype.addListener = function (e, t) { + return h(this, e, t, !1) + }, s.prototype.prependListener = function (e, t) { + return h(this, e, t, !0) + }, s.prototype.once = function (e, t) { + return d(t), this.on(e, c(this, e, t)), this + }, s.prototype.prependOnceListener = function (e, t) { + return d(t), this.prependListener(e, c(this, e, t)), this + }, s.prototype.off = s.prototype.removeListener = function (e, t) { + var n, i, r, a, s; + if (d(t), void 0 !== (i = this._events) && void 0 !== (n = i[e])) if (n === t || n.listener === t) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, n.listener || t)); else if ("function" != typeof n) { + for (r = -1, a = n.length - 1; 0 <= a; a--) if (n[a] === t || n[a].listener === t) { + s = n[a].listener, r = a; + break + } + if (r < 0) return this; + if (0 === r) n.shift(); else { + for (var o = n, u = r; u + 1 < o.length; u++) o[u] = o[u + 1]; + o.pop() + } + 1 === n.length && (i[e] = n[0]), void 0 !== i.removeListener && this.emit("removeListener", e, s || t) + } + return this + }, s.prototype.removeAllListeners = function (e) { + var t, n = this._events; + if (void 0 !== n) { + if (void 0 === n.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== n[e] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete n[e]), this; + if (0 === arguments.length) { + for (var i, r = Object.keys(n), a = 0; a < r.length; ++a) "removeListener" !== (i = r[a]) && this.removeAllListeners(i); + return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this + } + if ("function" == typeof (t = n[e])) this.removeListener(e, t); else if (void 0 !== t) for (a = t.length - 1; 0 <= a; a--) this.removeListener(e, t[a]) + } + return this + }, s.prototype.listeners = function (e) { + return _(this, e, !0) + }, s.prototype.rawListeners = function (e) { + return _(this, e, !1) + }, s.listenerCount = function (e, t) { + return "function" == typeof e.listenerCount ? e.listenerCount(t) : f.call(e, t) + }, s.prototype.listenerCount = f, s.prototype.eventNames = function () { + return 0 < this._eventsCount ? r(this._events) : [] + } + }, function (e, t, n) { + e.exports = {default: n(236), __esModule: !0} + }, function (e, t, n) { + var i = n(13), r = n(69), a = n(45), s = Object.defineProperty; + t.f = n(14) ? Object.defineProperty : function (e, t, n) { + if (i(e), t = a(t, !0), i(n), r) try { + return s(e, t, n) + } catch (e) { + } + if ("get" in n || "set" in n) throw TypeError("Accessors not supported!"); + return "value" in n && (e[t] = n.value), e + } + }, function (e, t, n) { + var i = n(16); + e.exports = function (e) { + if (i(e)) return e; + throw TypeError(e + " is not an object!") + } + }, function (e, t, n) { + e.exports = !n(23)(function () { + return 7 != Object.defineProperty({}, "a", { + get: function () { + return 7 + } + }).a + }) + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}), t.BaseLoader = t.LoaderErrors = t.LoaderStatus = void 0; + var i = s(n(1)), r = s(n(2)), a = n(5); + + function s(e) { + return e && e.__esModule ? e : {default: e} + } + + var o = t.LoaderStatus = {kIdle: 0, kConnecting: 1, kBuffering: 2, kError: 3, kComplete: 4}; + t.LoaderErrors = { + OK: "OK", + EXCEPTION: "Exception", + HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid", + CONNECTING_TIMEOUT: "ConnectingTimeout", + EARLY_EOF: "EarlyEof", + UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof" + }, t.BaseLoader = ((0, r.default)(u, [{ + key: "destroy", value: function () { + this._status = o.kIdle, this._onContentLengthKnown = null, this._onURLRedirect = null, this._onDataArrival = null, this._onError = null, this._onComplete = null + } + }, { + key: "isWorking", value: function () { + return this._status === o.kConnecting || this._status === o.kBuffering + } + }, { + key: "open", value: function (e, t) { + throw new a.NotImplementedException("Unimplemented abstract function!") + } + }, { + key: "abort", value: function () { + throw new a.NotImplementedException("Unimplemented abstract function!") + } + }, { + key: "type", get: function () { + return this._type + } + }, { + key: "status", get: function () { + return this._status + } + }, { + key: "needStashBuffer", get: function () { + return this._needStash + } + }, { + key: "onContentLengthKnown", get: function () { + return this._onContentLengthKnown + }, set: function (e) { + this._onContentLengthKnown = e + } + }, { + key: "onURLRedirect", get: function () { + return this._onURLRedirect + }, set: function (e) { + this._onURLRedirect = e + } + }, { + key: "onDataArrival", get: function () { + return this._onDataArrival + }, set: function (e) { + this._onDataArrival = e + } + }, { + key: "onError", get: function () { + return this._onError + }, set: function (e) { + this._onError = e + } + }, { + key: "onComplete", get: function () { + return this._onComplete + }, set: function (e) { + this._onComplete = e + } + }]), u); + + function u(e) { + (0, i.default)(this, u), this._type = e || "undefined", this._status = o.kIdle, this._needStash = !1, this._onContentLengthKnown = null, this._onURLRedirect = null, this._onDataArrival = null, this._onError = null, this._onComplete = null + } + }, function (e, t) { + e.exports = function (e) { + return "object" == typeof e ? null !== e : "function" == typeof e + } + }, function (e, t, n) { + var i = n(12), r = n(28); + e.exports = n(14) ? function (e, t, n) { + return i.f(e, t, r(1, n)) + } : function (e, t, n) { + return e[t] = n, e + } + }, function (e, t) { + var n = {}.hasOwnProperty; + e.exports = function (e, t) { + return n.call(e, t) + } + }, function (e, t, n) { + var i = n(72), r = n(43); + e.exports = function (e) { + return i(r(e)) + } + }, function (e, t, n) { + e.exports = {default: n(292), __esModule: !0} + }, function (e, t, n) { + e.exports = {default: n(302), __esModule: !0} + }, function (e, t, n) { + var a = n(34); + e.exports = function (i, r, e) { + if (a(i), void 0 === r) return i; + switch (e) { + case 1: + return function (e) { + return i.call(r, e) + }; + case 2: + return function (e, t) { + return i.call(r, e, t) + }; + case 3: + return function (e, t, n) { + return i.call(r, e, t, n) + } + } + return function () { + return i.apply(r, arguments) + } + } + }, function (e, t) { + e.exports = function (e) { + try { + return !!e() + } catch (e) { + return !0 + } + } + }, function (e, t, n) { + var i = n(43); + e.exports = function (e) { + return Object(i(e)) + } + }, function (e, t, n) { + "use strict"; + t.__esModule = !0; + var n = n(9), i = (n = n) && n.__esModule ? n : {default: n}; + t.default = function (e, t) { + if (e) return !t || "object" !== (void 0 === t ? "undefined" : (0, i.default)(t)) && "function" != typeof t ? e : t; + throw new ReferenceError("this hasn't been initialised - super() hasn't been called") + } + }, function (e, t, n) { + "use strict"; + t.__esModule = !0; + var i = s(n(38)), r = s(n(304)), a = s(n(9)); + + function s(e) { + return e && e.__esModule ? e : {default: e} + } + + t.default = function (e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : (0, a.default)(t))); + e.prototype = (0, r.default)(t && t.prototype, { + constructor: { + value: e, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), t && (i.default ? (0, i.default)(e, t) : e.__proto__ = t) + } + }, function (e, t) { + e.exports = !0 + }, function (e, t) { + e.exports = function (e, t) { + return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t} + } + }, function (e, t) { + e.exports = {} + }, function (e, t, n) { + var i = n(71), r = n(50); + e.exports = Object.keys || function (e) { + return i(e, r) + } + }, function (e, t) { + var n = {}.toString; + e.exports = function (e) { + return n.call(e).slice(8, -1) + } + }, function (e, t, n) { + "use strict"; + t.__esModule = !0; + var a = i(n(21)), s = i(n(308)); + + function i(e) { + return e && e.__esModule ? e : {default: e} + } + + t.default = function e(t, n, i) { + null === t && (t = Function.prototype); + var r = (0, s.default)(t, n); + if (void 0 !== r) { + if ("value" in r) return r.value; + r = r.get; + return void 0 !== r ? r.call(i) : void 0 + } + r = (0, a.default)(t); + if (null !== r) return e(r, n, i) + } + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}); + var n = n(20), n = (n = n) && n.__esModule ? n : {default: n}; + var i = {}; + var r, a, s = self.navigator.userAgent.toLowerCase(), + o = /(edge)\/([\w.]+)/.exec(s) || /(opr)[\/]([\w.]+)/.exec(s) || /(chrome)[ \/]([\w.]+)/.exec(s) || /(iemobile)[\/]([\w.]+)/.exec(s) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(s) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(s) || /(webkit)[ \/]([\w.]+)/.exec(s) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(s) || /(msie) ([\w.]+)/.exec(s) || 0 <= s.indexOf("trident") && /(rv)(?::| )([\w.]+)/.exec(s) || s.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(s) || [], + s = /(ipad)/.exec(s) || /(ipod)/.exec(s) || /(windows phone)/.exec(s) || /(iphone)/.exec(s) || /(kindle)/.exec(s) || /(android)/.exec(s) || /(windows)/.exec(s) || /(mac)/.exec(s) || /(linux)/.exec(s) || /(cros)/.exec(s) || [], + o = { + browser: o[5] || o[3] || o[1] || "", + version: o[2] || o[4] || "0", + majorVersion: o[4] || o[2] || "0", + platform: s[0] || "" + }, s = {}; + for (a in o.browser && (s[o.browser] = !0, r = o.majorVersion.split("."), s.version = { + major: parseInt(o.majorVersion, 10), + string: o.version + }, 1 < r.length && (s.version.minor = parseInt(r[1], 10)), 2 < r.length && (s.version.build = parseInt(r[2], 10))), o.platform && (s[o.platform] = !0), (s.chrome || s.opr || s.safari) && (s.webkit = !0), (s.rv || s.iemobile) && (s.rv && delete s.rv, o.browser = "msie", s.msie = !0), s.edge && (delete s.edge, o.browser = "msedge", s.msedge = !0), s.opr && (o.browser = "opera", s.opera = !0), s.safari && s.android && (s[o.browser = "android"] = !0), s.name = o.browser, s.platform = o.platform, i) i.hasOwnProperty(a) && delete i[a]; + (0, n.default)(i, s), t.default = i + }, function (e, t) { + e.exports = function (e) { + if ("function" != typeof e) throw TypeError(e + " is not a function!"); + return e + } + }, function (e, t) { + var n = 0, i = Math.random(); + e.exports = function (e) { + return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++n + i).toString(36)) + } + }, function (e, t, n) { + var i = n(12).f, r = n(18), a = n(7)("toStringTag"); + e.exports = function (e, t, n) { + e && !r(e = n ? e : e.prototype, a) && i(e, a, {configurable: !0, value: t}) + } + }, function (e, t) { + t.f = {}.propertyIsEnumerable + }, function (e, t, n) { + e.exports = {default: n(295), __esModule: !0} + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}); + t.default = { + ERROR: "error", + LOADING_COMPLETE: "loading_complete", + RECOVERED_EARLY_EOF: "recovered_early_eof", + MEDIA_INFO: "media_info", + METADATA_ARRIVED: "metadata_arrived", + SCRIPTDATA_ARRIVED: "scriptdata_arrived", + STATISTICS_INFO: "statistics_info", + VIDEO_RESOLUTION_CHANGED: "video_resolution_changed", + MEDIA_SOURCE_ENDED: "media_source_ended", + MEDIA_SOURCE_CLOSE: "media_source_close", + VIDEO_FROZEN: "video_decoded_frame_frozen", + MS_BUFFER_FULL: "media_source_buffer_full", + LOADED_META_DATA: "loaded_meta_data" + } + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", {value: !0}); + t.default = { + IO_ERROR: "io_error", + DEMUX_ERROR: "demux_error", + INIT_SEGMENT: "init_segment", + MEDIA_SEGMENT: "media_segment", + LOADING_COMPLETE: "loading_complete", + RECOVERED_EARLY_EOF: "recovered_early_eof", + MEDIA_INFO: "media_info", + METADATA_ARRIVED: "metadata_arrived", + SCRIPTDATA_ARRIVED: "scriptdata_arrived", + STATISTICS_INFO: "statistics_info", + RECOMMEND_SEEKPOINT: "recommend_seekpoint", + VIDEO_RESOLUTION_CHANGED: "video_resolution_changed", + PARSEDDATA_ARRIVED: "parseddata_arrived" + } + }, function (e, t, n) { + "use strict"; + var i = n(237)(!0); + n(68)(String, "String", function (e) { + this._t = String(e), this._i = 0 + }, function () { + var e = this._t, t = this._i; + return t >= e.length ? {value: void 0, done: !0} : (e = i(e, t), this._i += e.length, {value: e, done: !1}) + }) + }, function (e, t) { + var n = Math.ceil, i = Math.floor; + e.exports = function (e) { + return isNaN(e = +e) ? 0 : (0 < e ? i : n)(e) + } + }, function (e, t) { + e.exports = function (e) { + if (null == e) throw TypeError("Can't call method on " + e); + return e + } + }, function (e, t, n) { + var i = n(16), r = n(6).document, a = i(r) && i(r.createElement); + e.exports = function (e) { + return a ? r.createElement(e) : {} + } + }, function (e, t, n) { + var r = n(16); + e.exports = function (e, t) { + if (!r(e)) return e; + var n, i; + if (t && "function" == typeof (n = e.toString) && !r(i = n.call(e)) || "function" == typeof (n = e.valueOf) && !r(i = n.call(e)) || !t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i; + throw TypeError("Can't convert object to primitive value") + } + }, function (e, t, n) { + function i() { + } + + var r = n(13), a = n(239), s = n(50), o = n(48)("IE_PROTO"), u = "prototype", d = function () { + var e = n(44)("iframe"), t = s.length; + for (e.style.display = "none", n(73).appendChild(e), e.src = "javascript:", (e = e.contentWindow.document).open(), e.write("