首次提交

main
gaoshuguang 5 months ago
commit c3b59c306e

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="1988a420-6503-4d08-b4e3-879a2b2e7503" />
</component>
</module>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AnalysisProjectProfileManager">
<option name="PROJECT_PROFILE" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
<list size="0" />
</component>
<component name="SuppressionsComponent">
<option name="suppComments" value="[]" />
</component>
</project>

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="GetDataInterface" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="GetDataInterface" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,42 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AlibabaVarargsParameter" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="69" name="Java" />
</Languages>
</inspection_tool>
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="Author,Date,Description,Author:,Date:,Description:,,Param:,return:,date,author:,date:,description:" />
</inspection_tool>
</profile>
</component>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
</component>
</project>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FindBugsConfigurable">
<option name="make" value="true" />
<option name="effort" value="default" />
<option name="priority" value="Medium" />
<option name="excludeFilter" value="" />
</component>
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectType">
<option name="id" value="jpab" />
</component>
<component name="SuppressionsComponent">
<option name="suppComments" value="[]" />
</component>
</project>

@ -0,0 +1,465 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AnalysisProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
<scopes />
<profiles>
<profile profile_name="Project Default" version="1.0" is_locked="false">
<coding_rule class="AM_CREATES_EMPTY_JAR_FILE_ENTRY" level="MAJOR" enabled="true" />
<coding_rule class="AM_CREATES_EMPTY_ZIP_FILE_ENTRY" level="MAJOR" enabled="true" />
<coding_rule class="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION" level="CRITICAL" enabled="false" />
<coding_rule class="BAC_BAD_APPLET_CONSTRUCTOR" level="MAJOR" enabled="false" />
<coding_rule class="BC_BAD_CAST_TO_ABSTRACT_COLLECTION" level="MAJOR" enabled="true" />
<coding_rule class="BC_BAD_CAST_TO_CONCRETE_COLLECTION" level="CRITICAL" enabled="true" />
<coding_rule class="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS" level="CRITICAL" enabled="true" />
<coding_rule class="BC_IMPOSSIBLE_CAST" level="BLOCKER" enabled="true" />
<coding_rule class="BC_IMPOSSIBLE_DOWNCAST" level="MAJOR" enabled="false" />
<coding_rule class="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY" level="MAJOR" enabled="false" />
<coding_rule class="BC_IMPOSSIBLE_INSTANCEOF" level="CRITICAL" enabled="true" />
<coding_rule class="BC_UNCONFIRMED_CAST" level="CRITICAL" enabled="true" />
<coding_rule class="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" level="CRITICAL" enabled="false" />
<coding_rule class="BC_VACUOUS_INSTANCEOF" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_ADD_OF_SIGNED_BYTE" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_AND" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_AND_ZZ" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_IOR" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_IOR_OF_SIGNED_BYTE" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_SIGNED_CHECK" level="CRITICAL" enabled="true" />
<coding_rule class="BIT_SIGNED_CHECK_HIGH_BIT" level="CRITICAL" enabled="true" />
<coding_rule class="BOA_BADLY_OVERRIDDEN_ADAPTER" level="CRITICAL" enabled="true" />
<coding_rule class="BSHIFT_WRONG_ADD_PRIORITY" level="MAJOR" enabled="false" />
<coding_rule class="BX_BOXING_IMMEDIATELY_UNBOXED" level="MAJOR" enabled="true" />
<coding_rule class="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION" level="MAJOR" enabled="true" />
<coding_rule class="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR" level="MAJOR" enabled="true" />
<coding_rule class="BX_UNBOXING_IMMEDIATELY_REBOXED" level="CRITICAL" enabled="false" />
<coding_rule class="CAA_COVARIANT_ARRAY_ELEMENT_STORE" level="MAJOR" enabled="false" />
<coding_rule class="CAA_COVARIANT_ARRAY_FIELD" level="MAJOR" enabled="false" />
<coding_rule class="CAA_COVARIANT_ARRAY_LOCAL" level="MAJOR" enabled="false" />
<coding_rule class="CAA_COVARIANT_ARRAY_RETURN" level="MAJOR" enabled="false" />
<coding_rule class="CD_CIRCULAR_DEPENDENCY" level="MAJOR" enabled="false" />
<coding_rule class="CI_CONFUSED_INHERITANCE" level="MINOR" enabled="true" />
<coding_rule class="CNT_ROUGH_CONSTANT_VALUE" level="MAJOR" enabled="false" />
<coding_rule class="CN_IDIOM" level="MAJOR" enabled="true" />
<coding_rule class="CN_IDIOM_NO_SUPER_CALL" level="MAJOR" enabled="true" />
<coding_rule class="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" level="MAJOR" enabled="true" />
<coding_rule class="CO_ABSTRACT_SELF" level="MAJOR" enabled="true" />
<coding_rule class="CO_COMPARETO_INCORRECT_FLOATING" level="MAJOR" enabled="false" />
<coding_rule class="CO_COMPARETO_RESULTS_MIN_VALUE" level="CRITICAL" enabled="false" />
<coding_rule class="CO_SELF_NO_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="DB_DUPLICATE_BRANCHES" level="CRITICAL" enabled="true" />
<coding_rule class="DB_DUPLICATE_SWITCH_CLAUSES" level="CRITICAL" enabled="true" />
<coding_rule class="DC_DOUBLECHECK" level="MAJOR" enabled="true" />
<coding_rule class="DC_PARTIALLY_CONSTRUCTED" level="MAJOR" enabled="false" />
<coding_rule class="DE_MIGHT_DROP" level="MAJOR" enabled="true" />
<coding_rule class="DE_MIGHT_IGNORE" level="MAJOR" enabled="true" />
<coding_rule class="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN" level="MAJOR" enabled="false" />
<coding_rule class="DLS_DEAD_LOCAL_STORE" level="CRITICAL" enabled="true" />
<coding_rule class="DLS_DEAD_LOCAL_STORE_IN_RETURN" level="CRITICAL" enabled="true" />
<coding_rule class="DLS_DEAD_LOCAL_STORE_OF_NULL" level="CRITICAL" enabled="true" />
<coding_rule class="DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="DLS_DEAD_STORE_OF_CLASS_LITERAL" level="CRITICAL" enabled="true" />
<coding_rule class="DLS_OVERWRITTEN_INCREMENT" level="CRITICAL" enabled="true" />
<coding_rule class="DL_SYNCHRONIZATION_ON_BOOLEAN" level="CRITICAL" enabled="true" />
<coding_rule class="DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE" level="CRITICAL" enabled="true" />
<coding_rule class="DL_SYNCHRONIZATION_ON_SHARED_CONSTANT" level="CRITICAL" enabled="true" />
<coding_rule class="DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION" level="MAJOR" enabled="true" />
<coding_rule class="DMI_ARGUMENTS_WRONG_ORDER" level="CRITICAL" enabled="false" />
<coding_rule class="DMI_BAD_MONTH" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE" level="CRITICAL" enabled="false" />
<coding_rule class="DMI_BLOCKING_METHODS_ON_URL" level="BLOCKER" enabled="true" />
<coding_rule class="DMI_CALLING_NEXT_FROM_HASNEXT" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_COLLECTION_OF_URLS" level="BLOCKER" enabled="true" />
<coding_rule class="DMI_CONSTANT_DB_PASSWORD" level="BLOCKER" enabled="true" />
<coding_rule class="DMI_DOH" level="CRITICAL" enabled="false" />
<coding_rule class="DMI_EMPTY_DB_PASSWORD" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS" level="CRITICAL" enabled="false" />
<coding_rule class="DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR" level="MINOR" enabled="true" />
<coding_rule class="DMI_HARDCODED_ABSOLUTE_FILENAME" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_INVOKING_HASHCODE_ON_ARRAY" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_INVOKING_TOSTRING_ON_ARRAY" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_NONSERIALIZABLE_OBJECT_WRITTEN" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_RANDOM_USED_ONLY_ONCE" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS" level="MINOR" enabled="true" />
<coding_rule class="DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED" level="MAJOR" enabled="true" />
<coding_rule class="DMI_UNSUPPORTED_METHOD" level="MAJOR" enabled="true" />
<coding_rule class="DMI_USELESS_SUBSTRING" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION" level="CRITICAL" enabled="true" />
<coding_rule class="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD" level="MINOR" enabled="true" />
<coding_rule class="DMI_VACUOUS_SELF_COLLECTION_CALL" level="CRITICAL" enabled="true" />
<coding_rule class="DM_BOOLEAN_CTOR" level="MAJOR" enabled="true" />
<coding_rule class="DM_BOXED_PRIMITIVE_FOR_COMPARE" level="MAJOR" enabled="false" />
<coding_rule class="DM_BOXED_PRIMITIVE_FOR_PARSING" level="MAJOR" enabled="false" />
<coding_rule class="DM_BOXED_PRIMITIVE_TOSTRING" level="MAJOR" enabled="true" />
<coding_rule class="DM_CONVERT_CASE" level="INFO" enabled="true" />
<coding_rule class="DM_DEFAULT_ENCODING" level="CRITICAL" enabled="false" />
<coding_rule class="DM_EXIT" level="MAJOR" enabled="true" />
<coding_rule class="DM_FP_NUMBER_CTOR" level="MAJOR" enabled="true" />
<coding_rule class="DM_GC" level="MAJOR" enabled="true" />
<coding_rule class="DM_INVALID_MIN_MAX" level="MAJOR" enabled="false" />
<coding_rule class="DM_MONITOR_WAIT_ON_CONDITION" level="MAJOR" enabled="true" />
<coding_rule class="DM_NEW_FOR_GETCLASS" level="MAJOR" enabled="true" />
<coding_rule class="DM_NEXTINT_VIA_NEXTDOUBLE" level="MAJOR" enabled="true" />
<coding_rule class="DM_NUMBER_CTOR" level="CRITICAL" enabled="true" />
<coding_rule class="DM_RUN_FINALIZERS_ON_EXIT" level="MAJOR" enabled="true" />
<coding_rule class="DM_STRING_CTOR" level="MAJOR" enabled="true" />
<coding_rule class="DM_STRING_TOSTRING" level="INFO" enabled="true" />
<coding_rule class="DM_STRING_VOID_CTOR" level="MAJOR" enabled="true" />
<coding_rule class="DM_USELESS_THREAD" level="MAJOR" enabled="true" />
<coding_rule class="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED" level="MAJOR" enabled="true" />
<coding_rule class="DP_DO_INSIDE_DO_PRIVILEGED" level="MAJOR" enabled="true" />
<coding_rule class="EC_ARRAY_AND_NONARRAY" level="CRITICAL" enabled="true" />
<coding_rule class="EC_BAD_ARRAY_COMPARE" level="CRITICAL" enabled="true" />
<coding_rule class="EC_INCOMPATIBLE_ARRAY_COMPARE" level="MAJOR" enabled="false" />
<coding_rule class="EC_NULL_ARG" level="CRITICAL" enabled="true" />
<coding_rule class="EC_UNRELATED_CLASS_AND_INTERFACE" level="CRITICAL" enabled="true" />
<coding_rule class="EC_UNRELATED_INTERFACES" level="CRITICAL" enabled="true" />
<coding_rule class="EC_UNRELATED_TYPES" level="CRITICAL" enabled="true" />
<coding_rule class="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY" level="CRITICAL" enabled="true" />
<coding_rule class="EI_EXPOSE_REP" level="MAJOR" enabled="true" />
<coding_rule class="EI_EXPOSE_REP2" level="MAJOR" enabled="true" />
<coding_rule class="EI_EXPOSE_STATIC_REP2" level="MAJOR" enabled="true" />
<coding_rule class="EQ_ABSTRACT_SELF" level="MAJOR" enabled="true" />
<coding_rule class="EQ_ALWAYS_FALSE" level="BLOCKER" enabled="true" />
<coding_rule class="EQ_ALWAYS_TRUE" level="BLOCKER" enabled="true" />
<coding_rule class="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS" level="MAJOR" enabled="true" />
<coding_rule class="EQ_COMPARETO_USE_OBJECT_EQUALS" level="CRITICAL" enabled="true" />
<coding_rule class="EQ_COMPARING_CLASS_NAMES" level="MAJOR" enabled="true" />
<coding_rule class="EQ_DOESNT_OVERRIDE_EQUALS" level="MAJOR" enabled="false" />
<coding_rule class="EQ_DONT_DEFINE_EQUALS_FOR_ENUM" level="MAJOR" enabled="true" />
<coding_rule class="EQ_GETCLASS_AND_CLASS_CONSTANT" level="CRITICAL" enabled="true" />
<coding_rule class="EQ_OTHER_NO_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="EQ_OTHER_USE_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC" level="MAJOR" enabled="true" />
<coding_rule class="EQ_SELF_NO_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="EQ_SELF_USE_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="EQ_UNUSUAL" level="MINOR" enabled="true" />
<coding_rule class="ES_COMPARING_PARAMETER_STRING_WITH_EQ" level="MAJOR" enabled="true" />
<coding_rule class="ES_COMPARING_STRINGS_WITH_EQ" level="MAJOR" enabled="true" />
<coding_rule class="ESync_EMPTY_SYNC" level="MAJOR" enabled="true" />
<coding_rule class="FB_MISSING_EXPECTED_WARNING" level="CRITICAL" enabled="false" />
<coding_rule class="FB_UNEXPECTED_WARNING" level="CRITICAL" enabled="false" />
<coding_rule class="FE_FLOATING_POINT_EQUALITY" level="CRITICAL" enabled="true" />
<coding_rule class="FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER" level="CRITICAL" enabled="true" />
<coding_rule class="FI_EMPTY" level="MAJOR" enabled="true" />
<coding_rule class="FI_EXPLICIT_INVOCATION" level="MAJOR" enabled="true" />
<coding_rule class="FI_FINALIZER_NULLS_FIELDS" level="MAJOR" enabled="true" />
<coding_rule class="FI_FINALIZER_ONLY_NULLS_FIELDS" level="MAJOR" enabled="true" />
<coding_rule class="FI_MISSING_SUPER_CALL" level="MAJOR" enabled="true" />
<coding_rule class="FI_NULLIFY_SUPER" level="CRITICAL" enabled="true" />
<coding_rule class="FI_PUBLIC_SHOULD_BE_PROTECTED" level="MAJOR" enabled="true" />
<coding_rule class="FI_USELESS" level="MINOR" enabled="true" />
<coding_rule class="FL_MATH_USING_FLOAT_PRECISION" level="CRITICAL" enabled="true" />
<coding_rule class="GC_UNCHECKED_TYPE_IN_GENERIC_CALL" level="CRITICAL" enabled="true" />
<coding_rule class="GC_UNRELATED_TYPES" level="CRITICAL" enabled="true" />
<coding_rule class="HE_EQUALS_NO_HASHCODE" level="MAJOR" enabled="true" />
<coding_rule class="HE_EQUALS_USE_HASHCODE" level="CRITICAL" enabled="true" />
<coding_rule class="HE_HASHCODE_NO_EQUALS" level="CRITICAL" enabled="true" />
<coding_rule class="HE_HASHCODE_USE_OBJECT_EQUALS" level="CRITICAL" enabled="true" />
<coding_rule class="HE_INHERITS_EQUALS_USE_HASHCODE" level="CRITICAL" enabled="true" />
<coding_rule class="HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS" level="CRITICAL" enabled="true" />
<coding_rule class="HE_USE_OF_UNHASHABLE_CLASS" level="CRITICAL" enabled="true" />
<coding_rule class="HRS_REQUEST_PARAMETER_TO_COOKIE" level="MAJOR" enabled="true" />
<coding_rule class="HRS_REQUEST_PARAMETER_TO_HTTP_HEADER" level="MAJOR" enabled="true" />
<coding_rule class="HSC_HUGE_SHARED_STRING_CONSTANT" level="CRITICAL" enabled="true" />
<coding_rule class="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD" level="MAJOR" enabled="true" />
<coding_rule class="ICAST_BAD_SHIFT_AMOUNT" level="CRITICAL" enabled="true" />
<coding_rule class="ICAST_IDIV_CAST_TO_DOUBLE" level="CRITICAL" enabled="true" />
<coding_rule class="ICAST_INTEGER_MULTIPLY_CAST_TO_LONG" level="CRITICAL" enabled="true" />
<coding_rule class="ICAST_INT_2_LONG_AS_INSTANT" level="CRITICAL" enabled="false" />
<coding_rule class="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL" level="CRITICAL" enabled="true" />
<coding_rule class="ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND" level="CRITICAL" enabled="true" />
<coding_rule class="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT" level="CRITICAL" enabled="true" />
<coding_rule class="IC_INIT_CIRCULARITY" level="CRITICAL" enabled="true" />
<coding_rule class="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION" level="MAJOR" enabled="true" />
<coding_rule class="IIL_ELEMENTS_GET_LENGTH_IN_LOOP" level="MAJOR" enabled="false" />
<coding_rule class="IIL_PATTERN_COMPILE_IN_LOOP" level="MAJOR" enabled="false" />
<coding_rule class="IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT" level="MAJOR" enabled="false" />
<coding_rule class="IIL_PREPARE_STATEMENT_IN_LOOP" level="MAJOR" enabled="false" />
<coding_rule class="IIO_INEFFICIENT_INDEX_OF" level="MAJOR" enabled="false" />
<coding_rule class="IIO_INEFFICIENT_LAST_INDEX_OF" level="MAJOR" enabled="false" />
<coding_rule class="IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD" level="CRITICAL" enabled="true" />
<coding_rule class="IJU_BAD_SUITE_METHOD" level="CRITICAL" enabled="true" />
<coding_rule class="IJU_NO_TESTS" level="CRITICAL" enabled="true" />
<coding_rule class="IJU_SETUP_NO_SUPER" level="CRITICAL" enabled="true" />
<coding_rule class="IJU_SUITE_NOT_STATIC" level="CRITICAL" enabled="true" />
<coding_rule class="IJU_TEARDOWN_NO_SUPER" level="CRITICAL" enabled="true" />
<coding_rule class="IL_CONTAINER_ADDED_TO_ITSELF" level="CRITICAL" enabled="true" />
<coding_rule class="IL_INFINITE_LOOP" level="CRITICAL" enabled="true" />
<coding_rule class="IL_INFINITE_RECURSIVE_LOOP" level="CRITICAL" enabled="true" />
<coding_rule class="IMA_INEFFICIENT_MEMBER_ACCESS" level="MAJOR" enabled="false" />
<coding_rule class="IMSE_DONT_CATCH_IMSE" level="MAJOR" enabled="true" />
<coding_rule class="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW" level="CRITICAL" enabled="true" />
<coding_rule class="IM_BAD_CHECK_FOR_ODD" level="CRITICAL" enabled="true" />
<coding_rule class="IM_MULTIPLYING_RESULT_OF_IREM" level="CRITICAL" enabled="true" />
<coding_rule class="INT_BAD_COMPARISON_WITH_INT_VALUE" level="CRITICAL" enabled="false" />
<coding_rule class="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="INT_BAD_COMPARISON_WITH_SIGNED_BYTE" level="CRITICAL" enabled="true" />
<coding_rule class="INT_BAD_REM_BY_1" level="CRITICAL" enabled="true" />
<coding_rule class="INT_VACUOUS_BIT_OPERATION" level="CRITICAL" enabled="true" />
<coding_rule class="INT_VACUOUS_COMPARISON" level="CRITICAL" enabled="true" />
<coding_rule class="IO_APPENDING_TO_OBJECT_OUTPUT_STREAM" level="CRITICAL" enabled="true" />
<coding_rule class="IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN" level="CRITICAL" enabled="true" />
<coding_rule class="IS2_INCONSISTENT_SYNC" level="CRITICAL" enabled="true" />
<coding_rule class="ISC_INSTANTIATE_STATIC_CLASS" level="MAJOR" enabled="true" />
<coding_rule class="IS_FIELD_NOT_GUARDED" level="CRITICAL" enabled="true" />
<coding_rule class="ITA_INEFFICIENT_TO_ARRAY" level="CRITICAL" enabled="true" />
<coding_rule class="IT_NO_SUCH_ELEMENT" level="MINOR" enabled="true" />
<coding_rule class="J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION" level="CRITICAL" enabled="true" />
<coding_rule class="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS" level="MINOR" enabled="true" />
<coding_rule class="JLM_JSR166_LOCK_MONITORENTER" level="CRITICAL" enabled="true" />
<coding_rule class="JLM_JSR166_UTILCONCURRENT_MONITORENTER" level="CRITICAL" enabled="false" />
<coding_rule class="JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT" level="CRITICAL" enabled="false" />
<coding_rule class="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE" level="MAJOR" enabled="false" />
<coding_rule class="LI_LAZY_INIT_STATIC" level="CRITICAL" enabled="true" />
<coding_rule class="LI_LAZY_INIT_UPDATE_STATIC" level="CRITICAL" enabled="true" />
<coding_rule class="ME_ENUM_FIELD_SETTER" level="MAJOR" enabled="false" />
<coding_rule class="ME_MUTABLE_ENUM_FIELD" level="MAJOR" enabled="false" />
<coding_rule class="MF_CLASS_MASKS_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="MF_METHOD_MASKS_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="ML_SYNC_ON_UPDATED_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="MSF_MUTABLE_SERVLET_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="MS_CANNOT_BE_FINAL" level="MAJOR" enabled="true" />
<coding_rule class="MS_EXPOSE_REP" level="CRITICAL" enabled="true" />
<coding_rule class="MS_FINAL_PKGPROTECT" level="MAJOR" enabled="true" />
<coding_rule class="MS_MUTABLE_ARRAY" level="MAJOR" enabled="true" />
<coding_rule class="MS_MUTABLE_COLLECTION" level="MAJOR" enabled="false" />
<coding_rule class="MS_MUTABLE_COLLECTION_PKGPROTECT" level="MAJOR" enabled="false" />
<coding_rule class="MS_MUTABLE_HASHTABLE" level="MAJOR" enabled="true" />
<coding_rule class="MS_OOI_PKGPROTECT" level="MAJOR" enabled="true" />
<coding_rule class="MS_PKGPROTECT" level="MAJOR" enabled="true" />
<coding_rule class="MS_SHOULD_BE_FINAL" level="MAJOR" enabled="true" />
<coding_rule class="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL" level="CRITICAL" enabled="false" />
<coding_rule class="MTIA_SUSPECT_SERVLET_INSTANCE_FIELD" level="CRITICAL" enabled="true" />
<coding_rule class="MTIA_SUSPECT_STRUTS_INSTANCE_FIELD" level="CRITICAL" enabled="true" />
<coding_rule class="MWN_MISMATCHED_NOTIFY" level="CRITICAL" enabled="true" />
<coding_rule class="MWN_MISMATCHED_WAIT" level="CRITICAL" enabled="true" />
<coding_rule class="NM_BAD_EQUAL" level="MAJOR" enabled="false" />
<coding_rule class="NM_CLASS_NAMING_CONVENTION" level="MAJOR" enabled="false" />
<coding_rule class="NM_CLASS_NOT_EXCEPTION" level="MAJOR" enabled="true" />
<coding_rule class="NM_CONFUSING" level="MAJOR" enabled="true" />
<coding_rule class="NM_FIELD_NAMING_CONVENTION" level="MAJOR" enabled="false" />
<coding_rule class="NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER" level="MAJOR" enabled="true" />
<coding_rule class="NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER" level="MAJOR" enabled="true" />
<coding_rule class="NM_LCASE_HASHCODE" level="MAJOR" enabled="false" />
<coding_rule class="NM_LCASE_TOSTRING" level="MAJOR" enabled="false" />
<coding_rule class="NM_METHOD_CONSTRUCTOR_CONFUSION" level="MAJOR" enabled="true" />
<coding_rule class="NM_METHOD_NAMING_CONVENTION" level="MAJOR" enabled="false" />
<coding_rule class="NM_SAME_SIMPLE_NAME_AS_INTERFACE" level="MAJOR" enabled="true" />
<coding_rule class="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" level="MAJOR" enabled="true" />
<coding_rule class="NM_VERY_CONFUSING" level="MAJOR" enabled="true" />
<coding_rule class="NM_VERY_CONFUSING_INTENTIONAL" level="MAJOR" enabled="true" />
<coding_rule class="NM_WRONG_PACKAGE" level="MAJOR" enabled="true" />
<coding_rule class="NM_WRONG_PACKAGE_INTENTIONAL" level="MAJOR" enabled="true" />
<coding_rule class="NN_NAKED_NOTIFY" level="CRITICAL" enabled="true" />
<coding_rule class="NOISE_FIELD_REFERENCE" level="MAJOR" enabled="false" />
<coding_rule class="NOISE_METHOD_CALL" level="MAJOR" enabled="false" />
<coding_rule class="NOISE_NULL_DEREFERENCE" level="MAJOR" enabled="false" />
<coding_rule class="NOISE_OPERATION" level="MAJOR" enabled="false" />
<coding_rule class="NO_NOTIFY_NOT_NOTIFYALL" level="CRITICAL" enabled="true" />
<coding_rule class="NP_ALWAYS_NULL" level="CRITICAL" enabled="true" />
<coding_rule class="NP_ALWAYS_NULL_EXCEPTION" level="CRITICAL" enabled="true" />
<coding_rule class="NP_ARGUMENT_MIGHT_BE_NULL" level="MAJOR" enabled="true" />
<coding_rule class="NP_BOOLEAN_RETURN_NULL" level="MAJOR" enabled="true" />
<coding_rule class="NP_CLONE_COULD_RETURN_NULL" level="CRITICAL" enabled="true" />
<coding_rule class="NP_CLOSING_NULL" level="MAJOR" enabled="false" />
<coding_rule class="NP_DEREFERENCE_OF_READLINE_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT" level="CRITICAL" enabled="true" />
<coding_rule class="NP_GUARANTEED_DEREF" level="BLOCKER" enabled="true" />
<coding_rule class="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH" level="CRITICAL" enabled="true" />
<coding_rule class="NP_IMMEDIATE_DEREFERENCE_OF_READLINE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_LOAD_OF_KNOWN_NULL_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION" level="MAJOR" enabled="false" />
<coding_rule class="NP_METHOD_RETURN_RELAXING_ANNOTATION" level="MAJOR" enabled="false" />
<coding_rule class="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" level="CRITICAL" enabled="false" />
<coding_rule class="NP_NONNULL_PARAM_VIOLATION" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NONNULL_RETURN_VIOLATION" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_INSTANCEOF" level="BLOCKER" enabled="true" />
<coding_rule class="NP_NULL_ON_SOME_PATH" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_ON_SOME_PATH_EXCEPTION" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_PARAM_DEREF" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS" level="CRITICAL" enabled="true" />
<coding_rule class="NP_NULL_PARAM_DEREF_NONVIRTUAL" level="CRITICAL" enabled="true" />
<coding_rule class="NP_OPTIONAL_RETURN_NULL" level="MAJOR" enabled="false" />
<coding_rule class="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" level="CRITICAL" enabled="true" />
<coding_rule class="NP_STORE_INTO_NONNULL_FIELD" level="CRITICAL" enabled="true" />
<coding_rule class="NP_SYNC_AND_NULL_CHECK_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="NP_TOSTRING_COULD_RETURN_NULL" level="CRITICAL" enabled="true" />
<coding_rule class="NP_UNWRITTEN_FIELD" level="MAJOR" enabled="false" />
<coding_rule class="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="NS_DANGEROUS_NON_SHORT_CIRCUIT" level="CRITICAL" enabled="true" />
<coding_rule class="NS_NON_SHORT_CIRCUIT" level="MAJOR" enabled="true" />
<coding_rule class="OBL_UNSATISFIED_OBLIGATION" level="CRITICAL" enabled="false" />
<coding_rule class="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE" level="CRITICAL" enabled="false" />
<coding_rule class="ODR_OPEN_DATABASE_RESOURCE" level="CRITICAL" enabled="true" />
<coding_rule class="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH" level="CRITICAL" enabled="true" />
<coding_rule class="OS_OPEN_STREAM" level="CRITICAL" enabled="true" />
<coding_rule class="OS_OPEN_STREAM_EXCEPTION_PATH" level="CRITICAL" enabled="true" />
<coding_rule class="PS_PUBLIC_SEMAPHORES" level="CRITICAL" enabled="true" />
<coding_rule class="PT_ABSOLUTE_PATH_TRAVERSAL" level="CRITICAL" enabled="false" />
<coding_rule class="PT_RELATIVE_PATH_TRAVERSAL" level="CRITICAL" enabled="false" />
<coding_rule class="PZLA_PREFER_ZERO_LENGTH_ARRAYS" level="MAJOR" enabled="true" />
<coding_rule class="PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS" level="CRITICAL" enabled="false" />
<coding_rule class="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT" level="CRITICAL" enabled="true" />
<coding_rule class="QF_QUESTIONABLE_FOR_LOOP" level="CRITICAL" enabled="true" />
<coding_rule class="RANGE_ARRAY_INDEX" level="MAJOR" enabled="false" />
<coding_rule class="RANGE_ARRAY_LENGTH" level="MAJOR" enabled="false" />
<coding_rule class="RANGE_ARRAY_OFFSET" level="MAJOR" enabled="false" />
<coding_rule class="RANGE_STRING_INDEX" level="MAJOR" enabled="false" />
<coding_rule class="RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES" level="CRITICAL" enabled="true" />
<coding_rule class="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" level="CRITICAL" enabled="true" />
<coding_rule class="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" level="CRITICAL" enabled="true" />
<coding_rule class="RC_REF_COMPARISON" level="CRITICAL" enabled="true" />
<coding_rule class="RC_REF_COMPARISON_BAD_PRACTICE" level="MAJOR" enabled="false" />
<coding_rule class="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN" level="MAJOR" enabled="false" />
<coding_rule class="REC_CATCH_EXCEPTION" level="MAJOR" enabled="true" />
<coding_rule class="RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION" level="CRITICAL" enabled="true" />
<coding_rule class="RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION" level="CRITICAL" enabled="true" />
<coding_rule class="RE_POSSIBLE_UNINTENDED_PATTERN" level="CRITICAL" enabled="true" />
<coding_rule class="RI_REDUNDANT_INTERFACES" level="MAJOR" enabled="true" />
<coding_rule class="RR_NOT_CHECKED" level="MAJOR" enabled="true" />
<coding_rule class="RS_READOBJECT_SYNC" level="CRITICAL" enabled="true" />
<coding_rule class="RU_INVOKE_RUN" level="MAJOR" enabled="true" />
<coding_rule class="RV_01_TO_INT" level="MAJOR" enabled="true" />
<coding_rule class="RV_ABSOLUTE_VALUE_OF_HASHCODE" level="CRITICAL" enabled="true" />
<coding_rule class="RV_ABSOLUTE_VALUE_OF_RANDOM_INT" level="CRITICAL" enabled="true" />
<coding_rule class="RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE" level="CRITICAL" enabled="false" />
<coding_rule class="RV_CHECK_FOR_POSITIVE_INDEXOF" level="MINOR" enabled="true" />
<coding_rule class="RV_DONT_JUST_NULL_CHECK_READLINE" level="MAJOR" enabled="true" />
<coding_rule class="RV_EXCEPTION_NOT_THROWN" level="CRITICAL" enabled="true" />
<coding_rule class="RV_NEGATING_RESULT_OF_COMPARETO" level="CRITICAL" enabled="false" />
<coding_rule class="RV_REM_OF_HASHCODE" level="CRITICAL" enabled="true" />
<coding_rule class="RV_REM_OF_RANDOM_INT" level="CRITICAL" enabled="true" />
<coding_rule class="RV_RETURN_VALUE_IGNORED" level="MINOR" enabled="true" />
<coding_rule class="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" level="MAJOR" enabled="true" />
<coding_rule class="RV_RETURN_VALUE_IGNORED_INFERRED" level="CRITICAL" enabled="false" />
<coding_rule class="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" level="MAJOR" enabled="false" />
<coding_rule class="RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED" level="MAJOR" enabled="false" />
<coding_rule class="RpC_REPEATED_CONDITIONAL_TEST" level="MAJOR" enabled="true" />
<coding_rule class="SA_FIELD_DOUBLE_ASSIGNMENT" level="CRITICAL" enabled="true" />
<coding_rule class="SA_FIELD_SELF_ASSIGNMENT" level="CRITICAL" enabled="true" />
<coding_rule class="SA_FIELD_SELF_COMPARISON" level="CRITICAL" enabled="true" />
<coding_rule class="SA_FIELD_SELF_COMPUTATION" level="CRITICAL" enabled="true" />
<coding_rule class="SA_LOCAL_DOUBLE_ASSIGNMENT" level="CRITICAL" enabled="true" />
<coding_rule class="SA_LOCAL_SELF_ASSIGNMENT" level="CRITICAL" enabled="true" />
<coding_rule class="SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="SA_LOCAL_SELF_COMPARISON" level="CRITICAL" enabled="true" />
<coding_rule class="SA_LOCAL_SELF_COMPUTATION" level="CRITICAL" enabled="true" />
<coding_rule class="SBSC_USE_STRINGBUFFER_CONCATENATION" level="CRITICAL" enabled="true" />
<coding_rule class="SC_START_IN_CTOR" level="CRITICAL" enabled="true" />
<coding_rule class="SE_BAD_FIELD" level="MINOR" enabled="false" />
<coding_rule class="SE_BAD_FIELD_INNER_CLASS" level="MINOR" enabled="true" />
<coding_rule class="SE_BAD_FIELD_STORE" level="CRITICAL" enabled="true" />
<coding_rule class="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" level="MAJOR" enabled="true" />
<coding_rule class="SE_INNER_CLASS" level="MAJOR" enabled="true" />
<coding_rule class="SE_METHOD_MUST_BE_PRIVATE" level="MAJOR" enabled="true" />
<coding_rule class="SE_NONFINAL_SERIALVERSIONID" level="CRITICAL" enabled="true" />
<coding_rule class="SE_NONLONG_SERIALVERSIONID" level="MAJOR" enabled="true" />
<coding_rule class="SE_NONSTATIC_SERIALVERSIONID" level="MAJOR" enabled="true" />
<coding_rule class="SE_NO_SERIALVERSIONID" level="MAJOR" enabled="true" />
<coding_rule class="SE_NO_SUITABLE_CONSTRUCTOR" level="MAJOR" enabled="true" />
<coding_rule class="SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION" level="MAJOR" enabled="true" />
<coding_rule class="SE_PRIVATE_READ_RESOLVE_NOT_INHERITED" level="MAJOR" enabled="true" />
<coding_rule class="SE_READ_RESOLVE_IS_STATIC" level="MAJOR" enabled="true" />
<coding_rule class="SE_READ_RESOLVE_MUST_RETURN_OBJECT" level="MAJOR" enabled="true" />
<coding_rule class="SE_TRANSIENT_FIELD_NOT_RESTORED" level="MAJOR" enabled="true" />
<coding_rule class="SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS" level="MAJOR" enabled="true" />
<coding_rule class="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH" level="MAJOR" enabled="false" />
<coding_rule class="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW" level="MAJOR" enabled="false" />
<coding_rule class="SF_SWITCH_FALLTHROUGH" level="MAJOR" enabled="false" />
<coding_rule class="SF_SWITCH_NO_DEFAULT" level="MAJOR" enabled="false" />
<coding_rule class="SIC_INNER_SHOULD_BE_STATIC" level="MAJOR" enabled="true" />
<coding_rule class="SIC_INNER_SHOULD_BE_STATIC_ANON" level="MAJOR" enabled="true" />
<coding_rule class="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS" level="MAJOR" enabled="true" />
<coding_rule class="SIC_THREADLOCAL_DEADLY_EMBRACE" level="MAJOR" enabled="false" />
<coding_rule class="SIO_SUPERFLUOUS_INSTANCEOF" level="CRITICAL" enabled="true" />
<coding_rule class="SI_INSTANCE_BEFORE_FINALS_ASSIGNED" level="CRITICAL" enabled="true" />
<coding_rule class="SP_SPIN_ON_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="SQL_BAD_PREPARED_STATEMENT_ACCESS" level="CRITICAL" enabled="true" />
<coding_rule class="SQL_BAD_RESULTSET_ACCESS" level="CRITICAL" enabled="true" />
<coding_rule class="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" level="CRITICAL" enabled="true" />
<coding_rule class="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING" level="CRITICAL" enabled="true" />
<coding_rule class="SR_NOT_CHECKED" level="MAJOR" enabled="true" />
<coding_rule class="SS_SHOULD_BE_STATIC" level="MAJOR" enabled="true" />
<coding_rule class="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE" level="CRITICAL" enabled="true" />
<coding_rule class="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE" level="CRITICAL" enabled="true" />
<coding_rule class="STCAL_STATIC_CALENDAR_INSTANCE" level="CRITICAL" enabled="true" />
<coding_rule class="STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE" level="CRITICAL" enabled="true" />
<coding_rule class="STI_INTERRUPTED_ON_CURRENTTHREAD" level="CRITICAL" enabled="true" />
<coding_rule class="STI_INTERRUPTED_ON_UNKNOWNTHREAD" level="CRITICAL" enabled="true" />
<coding_rule class="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" level="CRITICAL" enabled="true" />
<coding_rule class="SWL_SLEEP_WITH_LOCK_HELD" level="CRITICAL" enabled="true" />
<coding_rule class="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD" level="MAJOR" enabled="true" />
<coding_rule class="TLW_TWO_LOCK_WAIT" level="MAJOR" enabled="true" />
<coding_rule class="TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS" level="CRITICAL" enabled="false" />
<coding_rule class="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED" level="CRITICAL" enabled="true" />
<coding_rule class="TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED" level="CRITICAL" enabled="false" />
<coding_rule class="UCF_USELESS_CONTROL_FLOW" level="CRITICAL" enabled="true" />
<coding_rule class="UCF_USELESS_CONTROL_FLOW_NEXT_LINE" level="CRITICAL" enabled="true" />
<coding_rule class="UC_USELESS_CONDITION" level="MAJOR" enabled="false" />
<coding_rule class="UC_USELESS_CONDITION_TYPE" level="MAJOR" enabled="false" />
<coding_rule class="UC_USELESS_OBJECT" level="MAJOR" enabled="false" />
<coding_rule class="UC_USELESS_OBJECT_STACK" level="MAJOR" enabled="false" />
<coding_rule class="UC_USELESS_VOID_METHOD" level="MAJOR" enabled="false" />
<coding_rule class="UG_SYNC_SET_UNSYNC_GET" level="MAJOR" enabled="true" />
<coding_rule class="UI_INHERITANCE_UNSAFE_GETRESOURCE" level="MAJOR" enabled="true" />
<coding_rule class="UL_UNRELEASED_LOCK" level="CRITICAL" enabled="true" />
<coding_rule class="UL_UNRELEASED_LOCK_EXCEPTION_PATH" level="CRITICAL" enabled="true" />
<coding_rule class="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS" level="CRITICAL" enabled="true" />
<coding_rule class="UM_UNNECESSARY_MATH" level="CRITICAL" enabled="true" />
<coding_rule class="UPM_UNCALLED_PRIVATE_METHOD" level="CRITICAL" enabled="true" />
<coding_rule class="URF_UNREAD_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="UR_UNINIT_READ" level="MAJOR" enabled="true" />
<coding_rule class="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR" level="MAJOR" enabled="false" />
<coding_rule class="USM_USELESS_ABSTRACT_METHOD" level="MAJOR" enabled="false" />
<coding_rule class="USM_USELESS_SUBCLASS_METHOD" level="MAJOR" enabled="false" />
<coding_rule class="UUF_UNUSED_FIELD" level="MAJOR" enabled="true" />
<coding_rule class="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" level="MAJOR" enabled="false" />
<coding_rule class="UWF_NULL_FIELD" level="CRITICAL" enabled="true" />
<coding_rule class="UWF_UNWRITTEN_FIELD" level="MAJOR" enabled="false" />
<coding_rule class="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" level="CRITICAL" enabled="false" />
<coding_rule class="UW_UNCOND_WAIT" level="MAJOR" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_BAD_ARGUMENT" level="CRITICAL" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_BAD_CONVERSION" level="CRITICAL" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY" level="MAJOR" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN" level="MAJOR" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED" level="MAJOR" enabled="false" />
<coding_rule class="VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED" level="MAJOR" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_ILLEGAL" level="CRITICAL" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_MISSING_ARGUMENT" level="CRITICAL" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT" level="CRITICAL" enabled="true" />
<coding_rule class="VA_FORMAT_STRING_USES_NEWLINE" level="CRITICAL" enabled="false" />
<coding_rule class="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG" level="CRITICAL" enabled="true" />
<coding_rule class="VO_VOLATILE_INCREMENT" level="CRITICAL" enabled="false" />
<coding_rule class="VO_VOLATILE_REFERENCE_TO_ARRAY" level="MAJOR" enabled="true" />
<coding_rule class="VR_UNRESOLVABLE_REFERENCE" level="MAJOR" enabled="false" />
<coding_rule class="WA_AWAIT_NOT_IN_LOOP" level="CRITICAL" enabled="true" />
<coding_rule class="WA_NOT_IN_LOOP" level="CRITICAL" enabled="true" />
<coding_rule class="WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL" level="CRITICAL" enabled="true" />
<coding_rule class="WMI_WRONG_MAP_ITERATOR" level="CRITICAL" enabled="true" />
<coding_rule class="WS_WRITEOBJECT_SYNC" level="CRITICAL" enabled="true" />
<coding_rule class="XFB_XML_FACTORY_BYPASS" level="CRITICAL" enabled="true" />
<coding_rule class="XSS_REQUEST_PARAMETER_TO_JSP_WRITER" level="CRITICAL" enabled="true" />
<coding_rule class="XSS_REQUEST_PARAMETER_TO_SEND_ERROR" level="CRITICAL" enabled="true" />
<coding_rule class="XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER" level="CRITICAL" enabled="true" />
</profile>
</profiles>
<list size="0" />
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -0,0 +1,303 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nmggs</groupId>
<artifactId>GetDataInterface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>GetDataInterface</name>
<description>GetDataInterface</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.3.7.RELEASE</spring-boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.13.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- 内置tomcat-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-web</artifactId>-->
<!-- </dependency>-->
<!-- 外置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.1</version>
</dependency>
<!-- 外置依赖-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!--验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<!--JWT鉴权-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
<!-- session 配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<!--spring-session-->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>
<!-- 数据库链接包-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>druid</artifactId>-->
<!-- <version>1.2.11</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.microsoft</groupId>
<artifactId>sqljdbc4</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.12</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>
</dependency>
<!-- 密码加密-->
<dependency>
<groupId>com.enc</groupId>
<artifactId>EndPassJava</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!-- 解析HTML-->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.13</version>
</dependency>
<!-- goldendb驱动 -->
<dependency>
<groupId>com.zte.goldendb</groupId> <!-- 假设的groupId -->
<artifactId>gdb_mysql-connector-java</artifactId> <!-- 假设的artifactId -->
<version>5.1.46.67</version> <!-- 版本号 -->
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.3.1-jre</version>
</dependency>
<!-- 通过HttpClient实现请求发送、接收文件 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<!-- SM4加密依赖包 -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>GetDataInterface</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<!-- <configuration>-->
<!-- <packagingExcludes>-->
<!-- WEB-INF/classes/application.yml-->
<!-- WEB-INF\classes\application.yml-->
<!-- </packagingExcludes>-->
<!-- </configuration>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.nmggs.query.GetDataInterfaceApplication</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<!--打包时去除配置文件-->
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>*.properties</exclude>
</excludes>
<!-- <includes>-->
<!-- <include>static/*.properties</include>-->
<!-- </includes>-->
</resource>
</resources>
</build>
</project>

@ -0,0 +1,20 @@
package com.nmggs.query;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync;
@EnableAsync
@SpringBootApplication
public class GetDataInterfaceApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(GetDataInterfaceApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(GetDataInterfaceApplication.class, args);
}
}

@ -0,0 +1,102 @@
package com.nmggs.query.common.config;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
import static com.google.code.kaptcha.Constants.KAPTCHA_BORDER;
import static com.google.code.kaptcha.Constants.KAPTCHA_BORDER_COLOR;
import static com.google.code.kaptcha.Constants.KAPTCHA_IMAGE_HEIGHT;
import static com.google.code.kaptcha.Constants.KAPTCHA_IMAGE_WIDTH;
import static com.google.code.kaptcha.Constants.KAPTCHA_NOISE_COLOR;
import static com.google.code.kaptcha.Constants.KAPTCHA_NOISE_IMPL;
import static com.google.code.kaptcha.Constants.KAPTCHA_OBSCURIFICATOR_IMPL;
import static com.google.code.kaptcha.Constants.KAPTCHA_SESSION_CONFIG_KEY;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_CHAR_LENGTH;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_CHAR_SPACE;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_FONT_COLOR;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_FONT_NAMES;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_FONT_SIZE;
import static com.google.code.kaptcha.Constants.KAPTCHA_TEXTPRODUCER_IMPL;
/**
*
*
* @author ruoyi
*/
@Configuration
public class CaptchaConfig
{
@Bean(name = "captchaProducer")
public DefaultKaptcha getKaptchaBean()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
// 是否有边框 默认为true 我们可以自己设置yesno
properties.setProperty(KAPTCHA_BORDER, "yes");
// 验证码文本字符颜色 默认为Color.BLACK
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black");
// 验证码图片宽度 默认为200
properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
// 验证码图片高度 默认为50
properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
// 验证码文本字符大小 默认为40
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "38");
// KAPTCHA_SESSION_KEY
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCode");
// 验证码文本字符长度 默认为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");
// 图片样式 水纹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");
// // 设置无干扰线
// properties.setProperty("kaptcha.noise.impl","com.google.code.kaptcha.impl.NoNoise");
// 干扰实现类
properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
@Bean(name = "captchaProducerMath")
public DefaultKaptcha getKaptchaBeanMath()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
// 是否有边框 默认为true 我们可以自己设置yesno
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_CONFIG_KEY, "kaptchaCodeMath");
// 验证码文本生成器
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator");
// 验证码文本字符间距 默认为2
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
// 验证码文本字符长度 默认为5
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
// 验证码文本字体样式 默认为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;
}
}

@ -0,0 +1,66 @@
package com.nmggs.query.common.config;
/**
*
* SpringMVCConfig使FilterConfig
*
* @author Administrator
*/
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
@SuppressWarnings("deprecation")
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Resource
private FilterConfig filterconfig;
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 设置拦截类
registry.addInterceptor(filterconfig)
.addPathPatterns("/**")
// 是否允许证书
.excludePathPatterns(
"/recaptureDataByDate**",
"/getData**",
"/baseinfo/**",
"/ManualGetFeeEvasionInfo**",
"/ManualSendProBlackList**",
"/ReceptionProBlackList**"
);
}
/**
*
*/
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
// 设置容许跨域请求的域名
//config.addAllowedOriginPattern("*");
config.addAllowedOrigin("*");
// 设置容许的方法
config.addAllowedMethod("*");
// 容许任何头
config.addAllowedHeader("*");
config.addExposedHeader("token");
//是否支持cookie跨域
config.setAllowCredentials(true);
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
return new CorsFilter(configSource);
}
}

@ -0,0 +1,17 @@
package com.nmggs.query.common.config;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
@Component
public class ErrorConfig implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
registry.addErrorPages(error404Page);
}
}

@ -0,0 +1,71 @@
package com.nmggs.query.common.config;
/**
*
*
* @author Administrator
*/
import com.alibaba.fastjson2.JSONObject;
import com.nmggs.query.common.utils.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@Component
@Slf4j
public class FilterConfig implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));//支持跨域请求
response.setHeader("Access-Control-Allow-Credentials", "true");//是否支持cookie跨域
response.setHeader("Access-Control-Allow-Methods", "*");//X-forwared-port,X-forwarded-host,
response.setHeader("Access-Control-Allow-Headers", "Authorization,Origin, X-Requested-With, Content-Type, Accept,Access-Token");//Origin, X-Requested-With, Content-Type, Accept,Access-Token
String token = request.getHeader("token");
if (token == null) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
JSONObject res = new JSONObject();
res.put("status", "-2");
res.put("msg", "登录超时请重新登陆");
PrintWriter out;
out = response.getWriter();
out.write(res.toString());
out.flush();
out.close();
return false;
}
if(token.equals("test")){
return true;
}
try {
boolean result = TokenUtil.verify(token);
//判断绑定
if (result) {
//log.info("通过拦截器");
response.setHeader("token", TokenUtil.reToken(token, request));
return true;
}
} catch (Exception ignored) {
}
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
JSONObject res = new JSONObject();
res.put("status", "-1");
res.put("msg", "鉴权失败");
PrintWriter out;
out = response.getWriter();
out.write(res.toString());
out.flush();
out.close();
return false;
}
}

@ -0,0 +1,131 @@
package com.nmggs.query.common.config;
import com.nmggs.query.common.emnu.Constant;
import com.nmggs.query.common.utils.PathUtil;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.trkf.PasswordEncryption.PassWordUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertiesPropertySource;
import java.io.File;
import java.io.FileInputStream;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@Configuration
public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor {
@Override
public void postProcessEnvironment(ConfigurableEnvironment configurableEnvironment, SpringApplication application) {
System.out.println("GetDataInterface读取公用配置文件");
//公用配置文件路径
String path = PathUtil.applicationPath;
//本项目配置文件路径
String NewPath = PathUtil.projectApplicationPath;
System.out.println("Loading local settings from : " + path);
System.out.println("Loading local settings from : " + NewPath);
Properties properties = new Properties();
Properties Newproperties = new Properties();
try {
File fileproperties = new File(path);
File fileNewproperties = new File(NewPath);
// 判断文件夹是否存在
if (!fileproperties.exists()) {
fileproperties.createNewFile();
}
if (!fileNewproperties.exists()) {
fileNewproperties.createNewFile();
}
properties.load(new FileInputStream(path));
String DBType = properties.getProperty("DBType") == null ? "1" : properties.getProperty("DBType");
Newproperties.load(new FileInputStream(NewPath));
//获取是否是goldenDB数据库
String IsGolDen = properties.getProperty("IsGolDen") == null ? "0" : properties.getProperty("IsGolDen");
properties.setProperty("spring.logback.logPath", PathUtil.TomcatPath + "/logs");
properties.setProperty("spring.datasource.url", properties.getProperty("DBUrl"));
properties.setProperty("spring.datasource.username", properties.getProperty("DBUserName"));
properties.setProperty("spring.datasource.password", PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
if(Constant.STR_ONE.equals(IsGolDen)){
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("GoldenDBClassName"));
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("GoldenvalidationQuery"));
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("GoldenvalidationQuery"));
}else {
switch (DBType) {
case "1":
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("sqlClassName"));
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("sqlvalidationQuery"));
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("sqlvalidationQuery"));
break;
case "3":
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("DMClassName"));
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("DMvalidationQuery"));
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("DMvalidationQuery"));
break;
case "4":
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("MySQLClassName"));
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("MySQLvalidationQuery"));
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("MySQLvalidationQuery"));
break;
case "2":
default:
properties.setProperty("spring.datasource.driver-class-name", Newproperties.getProperty("OracleClassName"));
properties.setProperty("spring.datasource.validationQuery", Newproperties.getProperty("OraclevalidationQuery"));
properties.setProperty("spring.datasource.hikari.connection-test-query", Newproperties.getProperty("OraclevalidationQuery"));
}
}
System.out.println("--------------------------GetDataInterface-本次载入数据库----------------------");
System.out.println(" server.port : " + properties.getProperty("server.port"));
System.out.println(" url : " + properties.getProperty("spring.datasource.url"));
System.out.println(" username : " + properties.getProperty("spring.datasource.username"));
System.out.println(" password : " + properties.getProperty("spring.datasource.password"));
String appName=Newproperties.getProperty("spring.logback.appName");
String versionPath =PathUtil.versionPath;
File resourceDir = new File(versionPath);
String version = getVersionFileName(resourceDir);
new PropertiesUtil(PathUtil.applicationTextPath).set(appName+"Version",version);
System.out.println(" version : "+appName+"--->"+version);
//环境名称随意取,但尽量不能和其他环境名称相同,避免不生效
PropertiesPropertySource propertySource = new PropertiesPropertySource("environmentPostProcessor", properties);
PropertiesPropertySource newPropertySource = new PropertiesPropertySource("newEnvironmentPostProcessor", Newproperties);
//外部的文件是最先导入的
configurableEnvironment.getPropertySources().addFirst(propertySource);
//如果公用配置文件没有配置的则使用本项目的配置文件
configurableEnvironment.getPropertySources().addLast(newPropertySource);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws UnknownHostException {
String s = "123456";
String decrypt = PassWordUtils.encrypt(s);
System.out.println(decrypt);
String decrypt2 = PassWordUtils.decrypt("Kzo+eTY8OC47WWN1OSw9VTR6V2VCcF03");
System.out.println(decrypt2);
}
private static String getVersionFileName(File dir) {
String version="";
List<String> fileNames = new ArrayList<>();
if (dir == null || !dir.exists() || !dir.isDirectory()) {
return version;
}
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".txt")) {
fileNames.add(file.getName());
}
}
}
if (!fileNames.isEmpty()) {
version = fileNames.get(0).replace(".txt", "");
}
return version;
}
}

@ -0,0 +1,43 @@
package com.nmggs.query.common.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.nmggs.query.common.emnu.Constant;
import com.nmggs.query.common.utils.PropertiesUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
String dbType = PropertiesUtil.getValue("DBType");
if (Constant.STR_ONE.equals(dbType)) {
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.SQL_SERVER2005));
} else if (Constant.STR_TWO.equals(dbType)) {
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.ORACLE));
} else if (Constant.STR_THREE.equals(dbType)) {
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.DM));
} else if (Constant.STR_FOUR.equals(dbType)) {
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
}
return interceptor;
}
/**
*
*
*/
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// // 设置请求的页面大于最大页后操作, true调回到首页false 继续请求 默认false
// // paginationInterceptor.setOverflow(false);
// // 设置最大单页限制数量,默认 500 条,-1 不受限制
// // paginationInterceptor.setLimit(500);
// // 开启 count 的 join 优化,只针对部分 left join
// paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
// return paginationInterceptor;
// }
}

@ -0,0 +1,34 @@
package com.nmggs.query.common.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
@Configuration
//当spring.redis.enable为false时或为空时 不启用redis
//prefix = "rest"application.properties配置文件中有关本配置项的前缀。
//name = "auth-open"application.properties配置文件中本次配置项的key
//havingValue = "true"从配置文件读取的值跟havingValue中设置的值做比较如果一样则返回true否则返回false。如果返回值为false则该configuration不生效为true才生效。
//matchIfMissing = true表示如果没有在application.properties匹配到该属性参数时默认返回true即不配置时也满足条件。
@ConditionalOnProperty(prefix = "spring.redis", name = "enable")
@EnableRedisHttpSession
public class RedisSessionConfig {
// 下面都是自定义配置默认为spingboot默认使用redis
// private String host;
// private String password;
// private String port;
// private String timeout;
// private String database;
//
// @Bean
// public JedisConnectionFactory redisConnectionFactory() {
// JedisConnectionFactory factory = new JedisConnectionFactory();
// factory.setHostName(host);
// factory.setPassword(password);
// factory.setPort(Integer.parseInt(port));
//// 设置连接超时时间
// factory.setTimeout(Integer.parseInt(timeout));
// factory.setDatabase(Integer.parseInt(database));
// return factory;
// }
}

@ -0,0 +1,32 @@
package com.nmggs.query.common.emnu;
import java.util.Arrays;
import java.util.List;
/**
* @author: shuguang
* @date: 20221010 17:13
* @description:
*/
public class Constant {
/**
* 1-sqlserver 2-oracle3-4-mysql
*/
public static final String STR_ONE = "1";
public static final String STR_TWO = "2";
public static final String STR_THREE = "3";
public static final String STR_FOUR = "4";
public static final String STR_ZERO = "0";
public static final String STR_TEN = "10";
public static final Integer INT_10000 = 10000;
public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static final String YYYYMMDD = "yyyyMMdd";
public static final String YYYYMMDDHH = "yyyyMMddHH";
public static final String YYMMDD = "yyMMdd";
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static final String YYYY_MM_DD = "yyyy-MM-dd";
public static final String APP_KEY = "2Z6hOpl5kNYWAzr8PeA5";
public static final String APP_SECRET = "sM}[(1H|EW!x&,GE8_]:[TaN8GOl10vQ}iN1s~hW";
public static final String UTF_8 = "UTF-8";
}

@ -0,0 +1,68 @@
package com.nmggs.query.common.emnu;
/**
* @author: shuguang
* @date: 20221016 17:24
* @description:
*/
public enum MessageEnum {
/**
*
*/
("0", "成功"),
/**
*
*/
("701", "鉴权码不存在"),
md5("702", "md5校验失败"),
POST("703", "POST参数校验失败"),
("704", "请求文件名参数校验失败"),
("705", "请求数据不存在"),
("706", "当前数据已为最新"),
("707", "最小费额文件不存在"),
/**
*
*/
("20001", "复制文件失败"),
("20002", "文件移动重命名失败"),
("20003", "返回数据格式错误"),
("20004", "查询数据失败"),
("20005", "插入数据失败"),
("20006", "登录鉴权失败"),
("20007", "数据库连接异常"),
sql("20008", "数据库执行sql失败"),
("20009", "推送省内黑名单数据失败"),
("20010", "获取逃费记录数据失败"),
("20011", "生成密钥失败"),
("20012", "加密失败"),
("20013", "解密失败"),
("20014", "请求接口失败"),
("99999","操作失败"),
;
private String code;
private String message;
MessageEnum(String code, String message) {
this.code = code;
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

@ -0,0 +1,49 @@
package com.nmggs.query.common.exception;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*/
/**
* @author: shuguang
* @date: 20221015 16:27
* @description:
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class PPException extends RuntimeException{
/**
*
*/
private String errorCode;
/**
*
*/
private String errorMessage;
public PPException(String errorCode, String errorMessage) {
super(errorCode);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
public PPException(String message, String errorCode, String errorMessage) {
super(message);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
public PPException(String message, Throwable cause, String errorCode, String errorMessage) {
super(message, cause);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
public PPException(Throwable cause, String errorCode, String errorMessage) {
super(cause);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
}

@ -0,0 +1,40 @@
package com.nmggs.query.common.exception;
import com.alibaba.fastjson2.JSON;
import com.nmggs.query.common.emnu.MessageEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* @author: shuguang
* @date: 20221011 16:27
* @description:
*/
@RestControllerAdvice
@Slf4j
public class PPExceptionHandler {
/**
*
*/
@ExceptionHandler(PPException.class)
public <T> T handlePPException(PPException e) {
Result res = Result.error(e.getErrorCode(), e.getErrorMessage());
log.error("异常处理模块出参:{}", JSON.toJSONString(res));
return (T) JSON.toJSONString(res);
}
/**
*
*/
@ExceptionHandler(Exception.class)
public <T> T handleException(Exception e) {
log.info(e.getMessage(),e);
Result res = Result.error(MessageEnum..getCode(), MessageEnum..getMessage());
log.error("异常处理模块出参:{}", JSON.toJSONString(res));
return (T) JSON.toJSONString(res);
}
}

@ -0,0 +1,43 @@
package com.nmggs.query.common.exception;
import com.nmggs.query.common.emnu.MessageEnum;
import lombok.Data;
/**
* @author: shuguang
* @date: 20221016 16:01
* @description:
*/
@Data
public class Result<T> {
private String code;
private String msg;
private T data;
public Result() {
}
public Result(T data) {
this.data = data;
}
public static Result success() {
Result result = new Result<>();
result.setCode(MessageEnum..getCode());
result.setMsg(MessageEnum..getMessage());
return result;
}
public static <T> Result<T> success(T data) {
Result<T> result = new Result<>(data);
result.setCode(MessageEnum..getCode());
result.setMsg(MessageEnum..getMessage());
return result;
}
public static Result error(String code, String msg) {
Result result = new Result();
result.setCode(code);
result.setMsg(msg);
return result;
}
}

@ -0,0 +1,85 @@
package com.nmggs.query.common.timetask;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author: shuguang
* @date: 20250627 10:35
* @description: 线
*/
@Configuration
@EnableScheduling // 开启定时任务
@EnableAsync //开启对异步定时任务的支持
public class TaskThreadPoolConfig {
@Bean("taskGdPayInfo") // bean的名称默认为首字母小写的方法名
public Executor taskGdPayInfo() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//线程前缀名
executor.setThreadNamePrefix("task-GdPayInfo-");
//最大线程数
executor.setMaxPoolSize(1);
//核心线程数
executor.setCorePoolSize(1);
//任务队列的大小
executor.setQueueCapacity(5);
//这种策略下,因为线程池已经无法接纳新的任务了,那么谁提交的这个任务,谁就去跑这个业务;
//
//比如,主线程向线程池提交了一个任务,线程池已经不能接纳这个任务了,那么此时就会让这个提交任务的主线程去执行这个任务;
//
//这种策略有两点好处1这种策略避免了业务损失2可以让任务提交的速度降低下来比如主线程提交的任务被打回来后主线程就必须执行完这个被打回来的任务后才能够向线程池提交下一个任务而这就相当于给了线程池一个缓冲的时间
//executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
//这种策略,会默默的把新来的这个任务给丢弃;我们不会得到通知;
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
//线程初始化
executor.initialize();
return executor;
}
@Bean("threadPoolSendProBlackList") // bean的名称默认为首字母小写的方法名
public Executor threadPoolSendProBlackList() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//线程前缀名
executor.setThreadNamePrefix("threadPoolSendProBlackList-thread-");
//最大线程数
executor.setMaxPoolSize(1);
//核心线程数
executor.setCorePoolSize(1);
//任务队列的大小
executor.setQueueCapacity(5);
//executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
//线程初始化
executor.initialize();
return executor;
}
@Bean("threadPoolGetFeeEvasionInfo") // bean的名称默认为首字母小写的方法名
public Executor threadPoolGetFeeEvasionInfo() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//线程前缀名
executor.setThreadNamePrefix("threadPoolGetFeeEvasionInf-thread-");
//最大线程数
executor.setMaxPoolSize(1);
//核心线程数
executor.setCorePoolSize(1);
//任务队列的大小
executor.setQueueCapacity(5);
//executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
//线程初始化
executor.initialize();
return executor;
}
}

@ -0,0 +1,151 @@
package com.nmggs.query.common.timetask;
import com.google.common.base.Stopwatch;
import com.nmggs.query.common.emnu.Constant;
import com.nmggs.query.common.utils.DateTimeUtil;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.nmggs.query.common.utils.UuidUtil;
import com.nmggs.query.service.RequestInterfaceService;
import com.nmggs.query.service.SendProBlackListService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* @author: shuguang
* @date: 20250627 10:35
* @description: 线
*/
@PropertySource(value = "classpath:static/timeTask.properties")
@Component
@EnableAsync
@Slf4j
public class TimeTaskInfo {
@Resource
private SendProBlackListService sendProBlackListService;
@Resource
private RequestInterfaceService requestInterfaceService;
/**
* CPC
*
* @author shuguang
* @date 2025-4-23 15:18
*/
@Async("taskGdPayInfo")
@Scheduled(cron = "${time.corn3}")
public void timeTaskGdPayInfo() {
String uuid = UuidUtil.getUuid();
log.info("[uuid:{}]-定时执行获取国道CPC对账文件进行入库操作,当前时间={}", uuid, LocalDateTime.now());
// 启动计时器
Stopwatch stopwatch = Stopwatch.createStarted();
try {
String isOpenDCPCTimeTask = PropertiesUtil.getValue("isOpenDCPCTimeTask");
if(StringUtils.isBlank(isOpenDCPCTimeTask) || !Constant.STR_ONE.equals(isOpenDCPCTimeTask.trim())){
log.info("[uuid:{}]-定时执行获取国道CPC对账文件进行入库操作未开启", uuid);
// 停止计时
stopwatch.stop();
return;
}
//获取前一天
String beforeDateString = DateTimeUtil.getFormateString(DateTimeUtil.addDateDays(new Date(), -1), Constant.YYYY_MM_DD);
requestInterfaceService.getRequestInterface(uuid,beforeDateString);
} catch (Exception e) {
log.error("[uuid:{}]-定时执行获取国道CPC对账文件进行入库操作服务异常", uuid, e);
}
finally {
stopwatch.stop();
log.info("[uuid:{}]-定时执行获取国道CPC对账文件进行入库操作服务执行完成耗时{}毫秒", uuid, stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
}
/**
*
*
* @author shuguang
* @date 2025-06-30 09:25
*/
@Async("threadPoolGetFeeEvasionInfo")
@Scheduled(cron = "${time.corn2}")
public void timeTaskGetFeeEvasionInfo() {
String uuid = UuidUtil.getUuid();
// 启动计时器
Stopwatch stopwatch = Stopwatch.createStarted();
//获取isSendProBlackList是否启用下发省内黑名单到指定接口 1-下发,其他值为不下发
String isSendProBlackList = PropertiesUtil.getValue("isSendProBlackList");
String loginAuthenticationAccount = PropertiesUtil.getValue("loginAuthenticationAccount");
String loginAuthenticationPassword = PropertiesUtil.getValue("loginAuthenticationPassword");
String loginAuthenticationUrl = PropertiesUtil.getValue("loginAuthenticationUrl");
String getFeeEvasionInfoUrl = PropertiesUtil.getValue("sendProBlackListUrl");
log.info("[uuid:{}]-定时执行获取逃费车辆信息,获取到的配置文件参数loginAuthenticationAccount={},loginAuthenticationPassword={},loginAuthenticationUrl={},sendProBlackListUrl={}"
, uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, getFeeEvasionInfoUrl);
try {
if (Constant.STR_ONE.equals(isSendProBlackList)
&& StringUtils.isNotBlank(loginAuthenticationAccount)
&& StringUtils.isNotBlank(loginAuthenticationPassword)
&& StringUtils.isNotBlank(loginAuthenticationUrl)
&& StringUtils.isNotBlank(getFeeEvasionInfoUrl)
) {
sendProBlackListService.getFeeEvasionInfo(uuid,loginAuthenticationAccount,loginAuthenticationPassword,loginAuthenticationUrl,getFeeEvasionInfoUrl);
} else {
log.info("[uuid:{}}]-暂停定时获取逃费车辆信息:{}",uuid, getFeeEvasionInfoUrl);
}
} catch (Exception e) {
log.error("[uuid:{}}]-定时执行获取逃费车辆信息:{}报错{}",uuid, getFeeEvasionInfoUrl, e);
} finally {
stopwatch.stop();
}
log.info("[uuid:{}}]-定时执行获取逃费车辆信息:{},耗时:{}毫秒", uuid, getFeeEvasionInfoUrl, stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
/**
*
*
* @author shuguang
* @date 2025-06-27 11:25
*/
@Async("threadPoolSendProBlackList")
@Scheduled(cron = "${time.corn1}")
public void timeTaskSendProBlackList() {
String uuid = UuidUtil.getUuid();
// 启动计时器
Stopwatch stopwatch = Stopwatch.createStarted();
//获取isSendProBlackList是否启用下发省内黑名单到指定接口 1-下发,其他值为不下发
String isSendProBlackList = PropertiesUtil.getValue("isSendProBlackList");
String loginAuthenticationAccount = PropertiesUtil.getValue("loginAuthenticationAccount");
String loginAuthenticationPassword = PropertiesUtil.getValue("loginAuthenticationPassword");
String loginAuthenticationUrl = PropertiesUtil.getValue("loginAuthenticationUrl");
String sendProBlackListUrl = PropertiesUtil.getValue("sendProBlackListUrl");
log.info("[uuid:{}]-定时执行下发省内黑名单,获取到的配置文件参数loginAuthenticationAccount={},loginAuthenticationPassword={},loginAuthenticationUrl={},sendProBlackListUrl={}"
, uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, sendProBlackListUrl);
try {
if (Constant.STR_ONE.equals(isSendProBlackList)
&& StringUtils.isNotBlank(loginAuthenticationAccount)
&& StringUtils.isNotBlank(loginAuthenticationPassword)
&& StringUtils.isNotBlank(loginAuthenticationUrl)
&& StringUtils.isNotBlank(sendProBlackListUrl)
) {
sendProBlackListService.sendProBlackListToInterface(uuid,loginAuthenticationAccount,loginAuthenticationPassword,loginAuthenticationUrl,sendProBlackListUrl);
} else {
log.info("[uuid:{}}]-暂停定时执行下发省内黑名单到指定接口:{}",uuid, sendProBlackListUrl);
}
} catch (Exception e) {
log.error("[uuid:{}}]-定时执行下发省内黑名单到指定接口:{}报错{}",uuid, sendProBlackListUrl, e);
} finally {
stopwatch.stop();
}
log.info("[uuid:{}}]-定时执行下发省内黑名单到指定接口:{},耗时:{}毫秒", uuid, sendProBlackListUrl, stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
}

@ -0,0 +1,48 @@
package com.nmggs.query.common.utils;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import org.apache.commons.lang3.ObjectUtils;
import java.util.Objects;
/**
* @author: shuguang
* @date: 20250421 9:51
* @description:
*/
public class CheckUtils {
public static void checkAddParams(String authKey, String reqAuthKey, String reqMd5, String verifyMd5) {
if (ObjectUtils.isEmpty(reqAuthKey)) {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
if (!Objects.equals(verifyMd5, reqMd5)) {
throw new PPException(MessageEnum.md5.getCode(), MessageEnum.md5.getMessage());
}
if (!authKey.equals(reqAuthKey)) {
throw new PPException(MessageEnum.POST.getCode(), MessageEnum.POST.getMessage());
}
}
public static void checkParams(String authKey, String reqAuthKey, String reqMd5, String fileName) {
if (ObjectUtils.isEmpty(reqAuthKey)) {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
if (ObjectUtils.isEmpty(fileName) || !fileName.contains("_REQ_15_") || !fileName.endsWith(".json")) {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
String md5 = MD5Util.md5(fileName + authKey);
if (!Objects.equals(md5, reqMd5)) {
throw new PPException(MessageEnum.md5.getCode(), MessageEnum.md5.getMessage());
}
if (!authKey.equals(reqAuthKey)) {
throw new PPException(MessageEnum.POST.getCode(), MessageEnum.POST.getMessage());
}
}
}

@ -0,0 +1,46 @@
package com.nmggs.query.common.utils;
import java.sql.Clob;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20240605 14:43
* @description:
*/
public class ClobUtils {
public static String clobToString(Clob clob){
String result="";
try {
if (clob instanceof Clob) {
result=(clob != null ? clob.getSubString(1, (int) clob.length()) : null);
}
} catch (Exception e) {
// TODO: handle exception
}
return result;
}
public static List<Map<String, Object>> clobToStringByList(List<Map<String, Object>> mapList){
if(mapList==null){
return mapList;
}
for (Map<String, Object> map : mapList) {
clobToStringByMap((HashMap<String, Object>) map);
}
return mapList;
}
public static HashMap<String,Object> clobToStringByMap(HashMap<String,Object> map){
if(map==null){
return map;
}
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object t1=entry.getValue();
if(t1 instanceof Clob){//将所有Clob类型的字段都转换为String类型
entry.setValue(clobToString((Clob)t1));
}
}
return map;
}
}

@ -0,0 +1,274 @@
package com.nmggs.query.common.utils;
import com.nmggs.query.common.emnu.Constant;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.Calendar;
import java.util.Date;
/**
* @author: shuguang
* @date: 20230112 15:14
* @description:
*/
public class DateTimeUtil {
/**
* date
*/
public static long getDiffSeconds(Date start , Date end) {
// 将Date转换为Instant
Instant instant1 = start.toInstant();
Instant instant2 = end.toInstant();
// 使用Duration计算两个Instant之间的秒数
Duration duration = Duration.between(instant1, instant2);
return duration.getSeconds();
}
/**
* Date
*/
public static Date getFirstDayOfYearDate() {
LocalDate today = LocalDate.now();
LocalDate firstDayOfYear = today.withMonth(1).withDayOfMonth(1);
return convertLocalDateToDate(firstDayOfYear);
}
/**
* Date
*/
public static Date getFirstDayOfQuarterDate() {
LocalDate today = LocalDate.now();
int month = today.getMonthValue();
// 计算本季度的第一个月
int firstMonthOfQuarter = (month - 1) / 3 * 3 + 1;
LocalDate firstDayOfQuarter = today.withMonth(firstMonthOfQuarter).with(TemporalAdjusters.firstDayOfMonth());
return convertLocalDateToDate(firstDayOfQuarter);
}
/**
* Date
*/
public static Date getFirstDayOfWeekDate() {
LocalDate today = LocalDate.now();
LocalDate firstDayOfWeekDate = today.with(TemporalAdjusters.firstDayOfMonth());
return convertLocalDateToDate(firstDayOfWeekDate);
}
/**
* Date
*/
public static Date getFirstDayOfMonthDate() {
LocalDate today = LocalDate.now();
LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth());
return convertLocalDateToDate(firstDayOfMonth);
}
private static Date convertLocalDateToDate(LocalDate localDate) {
return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
public static long getDifDateDay(String startStr, String endStr, String datePattern) {
// 定义日期格式
java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern(datePattern);
// 将字符串转换为LocalDate对象
LocalDate date1 = LocalDate.parse(startStr, formatter);
LocalDate date2 = LocalDate.parse(endStr, formatter);
// 计算两个日期之间的天数差
return ChronoUnit.DAYS.between(date1, date2);
}
/**
* TT 2022-09-30T10:15:302022-09-30 10:15:30
*
* @param dateWithT T
* @return java.lang.String
* @author shuguang
* @date 2024-08-19 16:56
*/
public static String conversionDateWithT(String dateWithT) {
// 将带有T的日期字符串解析为LocalDateTime对象
LocalDateTime dateTime = LocalDateTime.parse(dateWithT, java.time.format.DateTimeFormatter.ISO_LOCAL_DATE_TIME);
// 使用DateTimeFormatter将LocalDateTime对象格式化为指定格式的日期字符串
java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return dateTime.format(formatter);
}
/**
* YYYY-MM-DDTHH:mm:ssYYYY-MM-DD HH:mm:ss
*
* @param str YYYY-MM-DDTHH:mm:ss2011-03-10T11:54:30.207Z2011-3-10 19:54:30
* @return java.lang.String
* @author shuguang
* @date 2023-02-14 14:45
*/
public static String DateStringFormat(String str) {
DateTimeFormatter parser = ISODateTimeFormat.dateTime();
DateTime dt = parser.parseDateTime(str);
DateTimeFormatter formatter = DateTimeFormat.mediumDateTime();
return formatter.print(dt);
}
/**
* /
*
* @param date
* @param minute
* @return /
*/
public static Date addDateMinute(Date date, int minute) {
DateTime dateTime = new DateTime(date);
return dateTime.plusMinutes(minute).toDate();
}
/**
* /
*
* @param date
* @param hours
* @return /
*/
public static Date addDateHours(Date date, int hours) {
DateTime dateTime = new DateTime(date);
return dateTime.plusHours(hours).toDate();
}
/**
* /
*
* @param date
* @param days
* @return /
*/
public static Date addDateDays(Date date, int days) {
DateTime dateTime = new DateTime(date);
return dateTime.plusDays(days).toDate();
}
/**
*
*
* @param dateStr
* @param datePattern
* @return java.lang.String
* @author shuguang
* @date 2023-01-12 16:46
*/
public static String formatConversion(String dateStr, String datePattern) {
SimpleDateFormat sdf = null;
Date parse = null;
try {
sdf = new SimpleDateFormat(datePattern);
parse = sdf.parse(dateStr);
} catch (ParseException e) {
e.printStackTrace();
}
return sdf.format(parse);
}
/**
* @param date:datePattern:
* @return
* @Description:
* @author shuguang
* @date 2022117
*/
public static String getFormateString(Date date, String datePattern) {
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
return sdf.format(date);
}
/**
* @param date:datePattern:
* @return
* @throws ParseException
* @Description:
* @author shuguang
* @date 2022117
*/
public static Date getFormatDate(String date, String datePattern) {
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
try {
return sdf.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
/**
* yyyy-MM-ddyyyy-MM-dd HH:mm:ss
*
* @param sdf yyyy-MM-dd
* @return java.lang.String yyyy-MM-dd HH:mm:ss
* @author shuguang
* @date 2023-02-23 10:36
*/
public static Date getFormatStr(String sdf) {
SimpleDateFormat sdf1 = new SimpleDateFormat(Constant.YYYY_MM_DD);
Date date = null;
try {
date = sdf1.parse(sdf);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
/**
*
*/
public static Date getDateByDay(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
// 时
calendar.set(Calendar.HOUR_OF_DAY, 0);
// 分
calendar.set(Calendar.MINUTE, 0);
// 秒
calendar.set(Calendar.SECOND, 0);
// 毫秒
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
/**
* 0
*/
public static Date getDateByHour(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
// 分
calendar.set(Calendar.MINUTE, 0);
// 秒
calendar.set(Calendar.SECOND, 0);
// 毫秒
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
public static void main(String[] args) throws ParseException {
// 两个日期字符串
String dateString1 = "2024-07-31";
String dateString2 = "2024-08-21";
System.out.println(getDifDateDay(dateString1, dateString2, "yyyy-MM-dd"));
}
}

@ -0,0 +1,800 @@
package com.nmggs.query.common.utils;
import cn.hutool.core.util.StrUtil;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.AndFileFilter;
import org.apache.commons.io.filefilter.FileFileFilter;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
/**
* @author: shuguang
* @date: 20221013 10:52
* @description:
*/
@Slf4j
public class FileUtil {
/**
*
*
* @param folderPath
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2023-02-27 16:50
*/
public static List<Long> folderNames(String folderPath) {
List<Long> strings = new ArrayList<>();
// 获得指定文件对象
File file = new File(folderPath);
if (file.exists()) {
File[] array = file.listFiles();
if (null != array && array.length > 0) {
for (File file1 : array) {
if (file1.isDirectory()) {
strings.add(Long.parseLong(file1.getName()));
}
}
}
}
return strings;
}
/**
*
*
* @param filePath
* @param list
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2023-02-28 14:19
*/
public static List<String> obtainFileName(String filePath, List<String> list) {
// 获得指定文件对象
File file = new File(filePath);
//判断目录是否存在
if (file.exists()) {
// 获得该文件夹内的所有文件
File[] array = file.listFiles();
if (null != array && array.length > 0) {
for (File value : array) {
//如果是文件
if (value.isFile()) {
list.add(value.getName());
} else {
obtainFileName(value.getPath(), list);
}
}
}
}
return list;
}
/**
* str
*
* @param filePath
* @param str
* @return java.lang.String
* @author shuguang
* @date 2023-02-28 17:16
*/
public static String zlibFileName(String filePath, String str) {
//获取的文件名称
String fileName = "";
// 获得指定文件对象
File file = new File(filePath);
//判断目录是否存在
if (file.exists()) {
// 获得该文件夹内的所有文件
File[] array = file.listFiles();
if (null != array && array.length > 0) {
for (File value : array) {
//如果是文件
if (value.isFile() && value.getName().contains(str)) {
fileName = value.getName();
break;
}
}
}
}
return fileName;
}
public static void fileCopyReName(String oldFileNamePath, String newFileNamePath) {
try {
FileUtils.copyFile(new File(oldFileNamePath), new File(newFileNamePath));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
*/
public static boolean fileExists(String plainFilePath) {
File file = new File(plainFilePath);
return file.exists();
}
/**
*
*
* @param dirPath
* @param ms /
*/
public static void timeout(String dirPath, long ms) {
// 该日期之前的文件
Date pointDate = new Date(System.currentTimeMillis() - ms);
// 文件过滤条件
IOFileFilter timeFileFilter = FileFilterUtils.ageFileFilter(pointDate, true);
IOFileFilter fileFiles = new AndFileFilter(FileFileFilter.FILE, timeFileFilter);
File directory = new File(dirPath);
Iterator<File> itFile = FileUtils.iterateFiles(directory, fileFiles, TrueFileFilter.INSTANCE);
// 删除符合条件的文件
while (itFile.hasNext()) {
delete(itFile.next());
}
}
/**
*
*
* @param file
*/
public static void delete(File file) {
boolean result = file.delete();
//if (result) {
// log.info("删除: {} 成功", file.getAbsolutePath());
//} else {
// log.warn("删除: {} 失败", file.getAbsolutePath());
//}
}
/**
*
*
* @param backUpPath
* @param days
* @param fileType
* @author shuguang
* @date 2023-01-12 8:59
*/
public static void DeleteBackFile(String backUpPath, int days, String fileType) {
File[] files = new File(backUpPath).listFiles();
try {
for (File file : files) {
if (!file.isDirectory()) {
String backFileName = file.getName();
if (backFileName.contains("TB_")) {
// 根据文件的绝对路径获取Path
Path path = Paths.get(file.getAbsolutePath());
// 根据path获取文件的基本属性类
BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
// 从基本属性类中获取文件创建时间
FileTime fileTime = attrs.creationTime();
// 将文件创建时间转成毫秒
long millis = fileTime.toMillis();
//获取当前时间毫秒值
Date date = new Date();
long nowMillis = date.getTime();
long diffDays = (nowMillis - millis) / (1000L * 60 * 60 * 24);
if (diffDays > days && backFileName.contains(fileType)) {
file.delete();
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
*
* @param folder
*/
public static void deleteEmptyFolder(File folder) {
if (folder.isDirectory()) {
File[] files = folder.listFiles();
if (files != null && files.length > 0) {
for (File file : files) {
deleteEmptyFolder(file);
}
}
if (Objects.requireNonNull(folder.listFiles()).length == 0) {
folder.delete();
}
}
}
/**
*
*
* @param dirFilePath
*/
public static List<File> getAllFile(String dirFilePath) {
if (StrUtil.isBlank(dirFilePath)) {
return null;
}
return getAllFile(new File(dirFilePath));
}
/**
*
*
* @param dirFile
*/
public static List<File> getAllFile(File dirFile) {
// 如果文件夹不存在或着不是文件夹,则返回 null
if (Objects.isNull(dirFile) || !dirFile.exists() || dirFile.isFile()) {
return null;
}
File[] childrenFiles = dirFile.listFiles();
if (Objects.isNull(childrenFiles) || childrenFiles.length == 0) {
return null;
}
List<File> files = new ArrayList<>();
for (File childFile : childrenFiles) {
// 如果是文件,直接添加到结果集合
if (childFile.isFile()) {
files.add(childFile);
}
//以下几行代码取消注释后可以将所有子文件夹里的文件也获取到列表里
// else {
// // 如果是文件夹,则将其内部文件添加进结果集合
// List<File> cFiles = getAllFile(childFile);
// if (Objects.isNull(cFiles) || cFiles.isEmpty()) continue;
// files.addAll(cFiles);
// }
}
return files;
}
/**
*
*
* @param oldFilePath
* @param newFilePath
* @author shuguang
* @date 2023-01-12 8:33
*/
public static void copyFile(String oldFilePath, String newFilePath) {
//拷贝备份文件到备份目录
try {
FileUtils.copyFile(new File(oldFilePath), new File(newFilePath));
} catch (IOException e) {
log.error("拷贝备份文件{},到{}失败:{}", oldFilePath, newFilePath, e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
/**
* zipzipNametargetDirName
*
* @param zipName
* @param targetDirName
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2022-10-22 13:45
*/
public static List<String> upZipFile(String zipName, String targetDirName) {
//记录解压后的文件路径
List<String> srcList = new ArrayList<>();
//log.info("开始解压缩文件{}", zipName);
try {
byte[] buffer = new byte[1024];
ZipInputStream zis = new ZipInputStream(new FileInputStream(zipName));
//获取压缩包中的entry并将其解压
ZipEntry zipEntry = zis.getNextEntry();
int i = 0;
while (zipEntry != null) {
File newFile = newFile(new File(targetDirName), zipEntry);
srcList.add(newFile.getAbsolutePath());
FileOutputStream fos = new FileOutputStream(newFile);
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
fos.close();
i++;
//解压完成一个entry再解压下一个
zipEntry = zis.getNextEntry();
}
//log.info("解压缩文件完成,文件数为{}", i);
zis.closeEntry();
zis.close();
} catch (IOException e) {
log.error("解压缩{}失败:{}", zipName, e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
return srcList;
}
/**
*
*
* @return java.io.File
* @author shuguang
* @date 2022-10-22 13:47
*/
public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOException {
File destFile = new File(destinationDir, zipEntry.getName());
if (destFile.isDirectory()) {
// 如果zn是一个目录则创建目录
new File(String.valueOf(destFile)).mkdirs();
} else {
// 如果zn是文件则创建父目录
new File(String.valueOf(destFile)).getParentFile().mkdirs();
}
// 否则创建文件
new File(String.valueOf(destFile));
String destDirPath = destinationDir.getCanonicalPath();
String destFilePath = destFile.getCanonicalPath();
if (!destFilePath.startsWith(destDirPath + File.separator)) {
throw new IOException("该解压项在目标文件夹之外: " + zipEntry.getName());
}
return destFile;
}
/**
*
*
* @param path
* @return java.lang.String[]
* @author shuguang
* @date 2022-10-16 15:40
*/
public static String[] readTxt(String path) {
InputStreamReader isr;
List<String> list = new ArrayList<>();
String[] strings;
try {
isr = new InputStreamReader(new FileInputStream(path), "GBK");
BufferedReader read = new BufferedReader(isr);
String s;
while ((s = read.readLine()) != null) {
if (s.trim().length() > 1) {
list.add(s.trim());
}
}
} catch (IOException e) {
e.printStackTrace();
}
//确定数组长度
strings = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
String s = list.get(i);
strings[i] = s;
}
return strings;
}
/**
*
*
* @param path
* @author shuguang
* @date 2022-10-16 13:07
*/
public static void fileCreat(String path) {
File file = new File(path);
if (!file.isDirectory()) {
file.mkdirs();
}
}
/**
*
*
* @param path
* @author shuguang
* @date 2023-07-26 13:07
*/
public static void newFileCreat(String path) {
File file = new File(path);
if (!file.exists()) {
//创建文件
try {
file.createNewFile();
} catch (IOException e) {
//log.error(e.getMessage(), e);
}
}
}
/**
*
*
* @param path
* @author shuguang
* @date 2022-10-16 13:07
*/
public static void fileDelete(String path) {
File file = new File(path);
if (file.exists()) {
file.delete();
}
}
/**
*
*
* @param oldPath
* @param newPath
* @author shuguang
* @date 2023-01-31 10:14
*/
public static void moveFileReName(String oldPath, String newPath) {
try {
FileUtils.moveFile(new File(oldPath), new File(newPath));
} catch (IOException e) {
e.printStackTrace();
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
/**
* txt
*
* @param filePath
* @param str
* @author shuguang
* @date 2022-10-13 14:25
*/
public static void writeStringToFile(String filePath, String str) {
try {
FileOutputStream fos = new FileOutputStream(filePath);
fos.write(str.getBytes());
fos.close();
//log.info("路径下:{},字符串:{}写入txt完成", filePath, str);
} catch (Exception e) {
//log.error(e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
/**
* zip
*
* @param srcFiles
* @param zipFile
*/
public static void zipFiles(List<String> srcFiles, File zipFile, String localFileDir) {
// 创建 FileOutputStream 对象
FileOutputStream fileOutputStream;
// 创建 ZipOutputStream
ZipOutputStream zipOutputStream;
// 创建 FileInputStream 对象
BufferedInputStream bis = null;
FileInputStream inputStream = null;
// 判断压缩后的文件存在不,不存在则创建
try {
if (!zipFile.exists()) {
zipFile.createNewFile();
}
// 实例化 FileOutputStream 对象
fileOutputStream = new FileOutputStream(zipFile);
// 实例化 ZipOutputStream 对象
zipOutputStream = new ZipOutputStream(fileOutputStream);
// 创建 ZipEntry 对象
ZipEntry zipEntry;
// 遍历源文件数组
for (String file : srcFiles) {
// 将源文件数组中的当前文件读入 FileInputStream 流中
String fileName = file;
fileName = URLDecoder.decode(fileName, "UTF-8");
//获取文件输入流 localFileDir是服务端存储文件的路径
File files = new File(localFileDir + File.separator + fileName);
inputStream = new FileInputStream(files);
// 文件后缀名称
// 实例化 ZipEntry 对象,源文件数组中的当前文件
zipEntry = new ZipEntry(fileName);
zipOutputStream.putNextEntry(zipEntry);
// 该变量记录每次真正读的字节个数
int len;
// 定义每次读取的字节数组
byte[] buffer = new byte[4096];
while ((len = inputStream.read(buffer)) > 0) {
zipOutputStream.write(buffer, 0, len);
}
}
zipOutputStream.closeEntry();
zipOutputStream.close();
fileOutputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} finally {
try {
if (bis != null) {
bis.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException e) {
//log.error(e.getMessage(), e);
}
}
}
/**
*
* return
*/
public static String getTemplatePath() {
String realPath = Objects.requireNonNull(FileUtil.class.getClassLoader().getResource("")).getFile();
File file = new File(realPath);
realPath = file.getAbsolutePath();
try {
realPath = URLDecoder.decode(realPath, "utf-8");
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
return realPath;
}
public static void fileInput(HttpServletResponse response, String filename, File filePath) {
if (filePath.exists()) {
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
response.setContentType("application/octet-stream;charset=utf-8");
response.setHeader("content-disposition", "attachment;filename=" + java.net.URLEncoder.encode(filename, "UTF-8"));
byte[] buffer = new byte[4096];
fis = new FileInputStream(filePath);
//增加文件的大小
response.setContentLengthLong(fis.available());
bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} finally {
if (bis != null) {
try {
bis.close();
// 删除临时文件
filePath.delete();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
}
}
/**
*
*
* @param file
* @return boolean
* @author shuguang
* @date 2022-10-14 15:42
*/
public static boolean delFile(File file) {
if (!file.exists()) {
return false;
}
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null) {
for (File f : files) {
delFile(f);
}
}
}
return file.delete();
}
/**
*
*
* @param multipartFile zip
* @param temporaryFolder
* @param temporaryFilePath
* @author shuguang
* @date 2022-10-17 9:40
*/
public static void temporaryFile(MultipartFile multipartFile, String temporaryFolder, String temporaryFilePath) {
if (multipartFile != null) {
try {
InputStream in = multipartFile.getInputStream();
File file = new File(temporaryFolder);
if (!file.exists()) {
file.mkdirs();
}
FileOutputStream out = new FileOutputStream(temporaryFilePath);
byte[] bytes = new byte[1024];
int count;
while ((count = in.read(bytes)) >= 0) {
out.write(bytes, 0, count);
}
out.flush();
out.close();
in.close();
//log.info("{}文件下载成功", multipartFile.getOriginalFilename());
} catch (IOException e) {
log.error("文件下载失败{}", e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
}
/**
*
*
* @param file
*/
public static void removeFiles(File file) {
//将file子目录及子文件放进文件数组
File[] files = file.listFiles();
//如果包含文件进行删除操作
if (files != null && files.length > 0) {
for (File value : files) {
//删除子文件
if (value.isFile()) {
value.delete();
//通过递归方法删除子目录的文件
} else if (value.isDirectory()) {
removeFiles(value);
}
value.delete();//删除子目录
}
}
}
/**
* json
*
* @param destDir json
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2023-02-08 9:48
*/
public static List<String> getJsonPaths(String destDir) {
List<String> jsonPathList = new ArrayList<>();
File file = new File(destDir);
File[] files = file.listFiles();
if (files != null && files.length > 0) {
for (File file1 : files) {
jsonPathList.add(destDir + file1.getName());
}
}
return jsonPathList;
}
/**
* json
*
* @param destDir json
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2023-02-08 9:48
*/
public static String getJsonPath(String destDir) {
String jsonPath = "";
File file = new File(destDir);
File[] files = file.listFiles();
if (files != null && files.length > 0) {
for (File file1 : files) {
jsonPath = destDir + file1.getName();
}
}
return jsonPath;
}
/**
*
*
* @param file
* @return long
* @author shuguang
* @date 2023-02-20 20:36
*/
public static long getFileSize(File file) {
long length = file.length();
return length;
}
/**
*
*
* @param fileS
* @return java.lang.String
* @author shuguang
* @date 2022-11-22 16:45
*/
public static String formatFileSize(long fileS) {
DecimalFormat df = new DecimalFormat("#.00");
String fileSizeString;
String wrongSize = "0B";
if (fileS == 0) {
return wrongSize;
}
if (fileS < 1024) {
fileSizeString = df.format((double) fileS) + " B";
} else if (fileS < 1048576) {
fileSizeString = df.format((double) fileS / 1024) + " KB";
} else if (fileS < 1073741824) {
fileSizeString = df.format((double) fileS / 1048576) + " MB";
} else {
fileSizeString = df.format((double) fileS / 1073741824) + " GB";
}
return fileSizeString;
}
public static void main(String[] args) throws IOException {
String path = "D:\\桌面\\增量\\123\\234\\";
String s = "D:\\桌面\\增量\\123\\234\\ALLROADMINFEE_20230728001_G5511150100100_49_1110.SQB";
fileCreat(path);
newFileCreat(s);
}
}

@ -0,0 +1,50 @@
package com.nmggs.query.common.utils;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* @author: shuguang
* @date: 20221016 16:46
* @description: MD5
*/
public class MD5Util {
/**
* MD5
*
* @param password
* @return java.lang.String
* @author shuguang
* @date 2022-10-16 13:30
*/
public static String md5(String password) {
if (password == null) {
return null;
}
try {
// 使用UTF-8编码将字符串转换为字节数组
byte[] bytes = password.getBytes(StandardCharsets.UTF_8);
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(bytes);
byte[] digest = md.digest();
BigInteger no = new BigInteger(1, digest);
String hashtext = no.toString(16);
while (hashtext.length() < 32) {
hashtext = "0" + hashtext;
}
return hashtext;
} catch (NoSuchAlgorithmException e) {
// 记录错误日志
System.err.println("MD5 algorithm not found: " + e.getMessage());
}
return null;
}
public static void main(String[] args) {
String input = "蒙BF626772025-04-202025-04-278c602c65fe6f57c4b721c5078bb8a916";
String md5 = MD5Util.md5(input);
System.out.println("MD5: " + md5);
}
}

@ -0,0 +1,72 @@
package com.nmggs.query.common.utils;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author: shuguang
* @date: 20250423 11:04
* @description:
*/
public class NewFileUtils {
/**
* json
*
* @param destDir json
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2023-02-08 9:48
*/
public static List<String> getJsonPaths(String destDir) {
List<String> jsonPathList = new ArrayList<>();
File file = new File(destDir);
File[] files = file.listFiles();
if (files != null && files.length > 0) {
for (File file1 : files) {
jsonPathList.add(destDir + file1.getName());
}
}
return jsonPathList;
}
/**
*
*
* @param path
* @author shuguang
* @date 2022-10-16 13:07
*/
public static void fileCreat(String path) {
File file = new File(path);
if (!file.isDirectory()) {
file.mkdirs();
}
}
/**
*
*
* @param file
*/
public static void removeFiles(File file) {
//将file子目录及子文件放进文件数组
File[] files = file.listFiles();
//如果包含文件进行删除操作
if (files != null && files.length > 0) {
for (File value : files) {
//删除子文件
if (value.isFile()) {
value.delete();
//通过递归方法删除子目录的文件
} else if (value.isDirectory()) {
removeFiles(value);
}
value.delete();//删除子目录
}
}
}
}

@ -0,0 +1,32 @@
package com.nmggs.query.common.utils;
import java.util.ArrayList;
import java.util.List;
/**
* @author: shuguang
* @date: 20240718 15:40
* @description: Object
*/
public class ObjectUtils {
/**
* ObjectList<String>
*
* @param obj Object
* @return java.util.List<java.lang.String>
* @author shuguang
* @date 2024-07-18 15:42
*/
public static List<String> objToList(Object obj) {
List<String> result = new ArrayList<>();
if (obj != null) {
if (obj instanceof List<?>) {
for (Object o : (List<?>) obj) {
result.add((String) o);
}
}
}
return result;
}
}

@ -0,0 +1,42 @@
package com.nmggs.query.common.utils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.List;
public class PagesUtils {
public static Page getPages(Integer currentPage, Integer pageSize, List list) {
Page page = new Page();
currentPage = (currentPage == 0) ? 10 : currentPage;
pageSize = (pageSize == 0) ? 1 : pageSize;
if (list.size() > 0) {
int size = list.size();
if (pageSize > size) {
pageSize = size;
}
// 求出最大页数防止currentPage越界
int maxPage = size % pageSize == 0 ? size / pageSize : size / pageSize + 1;
if (currentPage > maxPage) {
currentPage = maxPage;
}
// 当前页第一条数据的下标
int curIdx = currentPage > 1 ? (currentPage - 1) * pageSize : 0;
List pageList = new ArrayList();
// 将当前页的数据放进pageList
for (int i = 0; i < pageSize && curIdx + i < size; i++) {
pageList.add(list.get(curIdx + i));
}
page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList);
}
return page;
}
}

@ -0,0 +1,84 @@
package com.nmggs.query.common.utils;
import org.springframework.util.ClassUtils;
import java.io.UnsupportedEncodingException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.URLDecoder;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.Objects;
import java.util.Properties;
public class PathUtil {
public static String TomcatPath = System.getProperty("catalina.home");
public static String webappsPath;
public static String applicationPath;
public static String applicationTextPath;
public static String projectApplicationPath = Objects.requireNonNull(Objects.requireNonNull(ClassUtils.getDefaultClassLoader()).getResource("")).getPath() + "static/application.properties";
public static String uploadPath;
public static String hostAddress;
public static String tomcatUserXMLPath;
public static String versionPath;
public static String webName = "GetDataInterface";
public static String downFile;
/**
*
*/
public static String encryptedFile;
/**
*
*/
public static String decryptedFile;
public static String downZipInsertBackup;
/**
* zipjson
*/
public static String unZip;
static {
Properties props = System.getProperties();
String os = props.getProperty("os.name").toLowerCase();
try {
if (os.startsWith("win")) {
webappsPath = java.net.URLDecoder.decode(TomcatPath + "\\webapps\\", "utf-8");
uploadPath = java.net.URLDecoder.decode("\\uploadfiles\\" + webName, "utf-8");
downFile = java.net.URLDecoder.decode(uploadPath + "\\downFile\\", "utf-8");
encryptedFile = java.net.URLDecoder.decode(uploadPath + "\\encryptedFile\\", "utf-8");
decryptedFile = java.net.URLDecoder.decode(uploadPath + "\\decryptedFile\\", "utf-8");
unZip = java.net.URLDecoder.decode(uploadPath + "\\unZip\\", "utf-8");
downZipInsertBackup = java.net.URLDecoder.decode(uploadPath + "\\downZipInsertBackup\\", "utf-8");
if (projectApplicationPath.charAt(0) == '/' || projectApplicationPath.charAt(0) == '\\') {
projectApplicationPath = java.net.URLDecoder.decode(projectApplicationPath.substring(1), "utf-8");
}
versionPath = URLDecoder.decode(Objects.requireNonNull(ClassUtils.getDefaultClassLoader().getResource("")).getPath(), "UTF-8") + "version/";
} else {
webappsPath = java.net.URLDecoder.decode(TomcatPath + "/webapps/", "utf-8");
uploadPath = java.net.URLDecoder.decode("/uploadfiles/" + webName, "utf-8");
downFile = java.net.URLDecoder.decode(uploadPath + "/downFile/", "utf-8");
encryptedFile = java.net.URLDecoder.decode(uploadPath + "/encryptedFile/", "utf-8");
decryptedFile = java.net.URLDecoder.decode(uploadPath + "/decryptedFile/", "utf-8");
unZip = java.net.URLDecoder.decode(uploadPath + "/unZip/", "utf-8");
downZipInsertBackup = java.net.URLDecoder.decode(uploadPath + "/downZipInsertBackup/", "utf-8");
versionPath = Objects.requireNonNull(ClassUtils.getDefaultClassLoader().getResource("")).getPath() + "version/";
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
applicationPath = webappsPath + "application.properties";
applicationTextPath = webappsPath + "/applicationText.properties";
tomcatUserXMLPath = TomcatPath + "/conf/tomcat-users.xml";
try {
hostAddress = Inet4Address.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
}

@ -0,0 +1,353 @@
package com.nmggs.query.common.utils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
public class PropertiesUtil {
public static String getValue(String key) {
String path = PathUtil.applicationPath;
FileInputStream fIn = null;
InputStreamReader in = null;
try {
// File updateFile = new File(path);
Properties properties = new Properties();
// BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream(path), "gb2312"));
fIn = new FileInputStream(path);
in = new InputStreamReader(fIn, "UTF-8");
BufferedReader bf = new BufferedReader(in);
properties.load(bf);
return properties.getProperty(key);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (fIn != null) {
fIn.close();
}
if (in != null) {
in.close();
}
} catch (Exception e) {
}
}
return "";
}
//目标文件
public File file;
//目标路径
public String path;
//默认字符编码
public String charset = "UTF-8";
//文件的每一行
public String[] lines;
//注释符
public static final String ANNOTATION_CHAR = "#";
public PropertiesUtil(File file) throws IOException {
this.file = file;
this.lines = getFileLines(file);
}
public PropertiesUtil(String path) throws IOException {
this.path = path;
this.lines = getFileLines(path);
}
/*
*
*
* @param key
* @return: java.lang.String
*/
public String get(String key) {
for (String line : lines) {
if (hasKey(line, key)) {
return getLineValue(line);
}
}
return null;
}
/**
*
*
* @param key
* @param value
* @param descriptions
* @return: boolean
*/
public boolean add(String key, String value, String... descriptions) {
List<String> lineList = new ArrayList<>(Arrays.asList(lines));
for (String description : descriptions) {
lineList.add(ANNOTATION_CHAR + description);
}
lineList.add(key.trim() + "=" + value.trim());
return commit(lineList.toArray(new String[0]));
}
/**
*
*
* @param key
* @param value
* @return: boolean
*/
public boolean set(String key, String value) {
boolean isHave = false;
for (int i = 0; i < lines.length; i++) {
if (hasKey(lines[i], key)) {
isHave = true;
lines[i] = key + "=" + value;
}
}
if (!isHave) {
add(key, value);
}
return commit(lines);
}
/**
*
*
* @param key
* @param value
* @return: boolean
*/
public boolean set(String key, String value, String... descriptions) {
boolean isHave = false;
for (int i = 0; i < lines.length; i++) {
if (hasKey(lines[i], key)) {
isHave = true;
lines[i] = key + "=" + value;
List<String> lineList = new ArrayList<>(Arrays.asList(lines));
for (String description : descriptions) {
while (1 == 1) {
if (i - 1 >= 0 && lineList.get(i - 1).toString().contains("#")) {
lineList.remove(i - 1);
i = i - 1;
} else {
break;
}
}
lineList.add(i, ANNOTATION_CHAR + description);
}
lines = lineList.toArray(new String[0]);
break;
}
}
if (!isHave) {
add(key, value, descriptions);
}
return commit(lines);
}
/*
*
*
* @param key
* @return: boolean
*/
public boolean delete(String key) {
List<String> lineList = new ArrayList<>(Arrays.asList(lines));
lineList.removeIf(line -> hasKey(line, key));
return commit(lineList.toArray(new String[0]));
}
/*
*
*
* @param lines
* @return: boolean
*/
public boolean commit(String[] lines) {
synchronized (this) {
this.lines = lines;
try (BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset))) {
StringBuilder data = new StringBuilder();
for (String line : lines) {
data.append(line).append('\n');
}
bufferedWriter.write(data.toString());
return true;
} catch (IOException e) {
e.printStackTrace();
}
}
return false;
}
/*
* key
*
* @param line
* @return: java.lang.String
*/
public String getLineKey(String line) {
return line.substring(0, line.indexOf('=')).trim();
}
/**
* value
*
* @param line
* @return: java.lang.String
*/
public String getLineValue(String line) {
return line.substring(line.indexOf('=') + 1).trim();
}
/**
* ( # = ) true false
*
* @return: boolean
*/
public boolean isValidLine(String line) {
return !line.trim().startsWith("#") && line.contains("=");
}
/**
* key
*
* @param line
* @param key
* @return: boolean
*/
public boolean hasKey(String line, String key) {
return isValidLine(line) && key.equals(getLineKey(line));
}
public boolean hasKey(String key) {
List<String> lineList = new ArrayList<>(Arrays.asList(lines));
for (int i = 0; i < lineList.size(); i++) {
String line = lineList.get(i);
if (hasKey(line, key)) {
return true;
}
if (i == lineList.size() - 1) {
return false;
}
}
return false;
}
/**
*
*
* @param file
* @return: java.lang.String[]
*/
public String[] getFileLines(File file) {
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));) {
String line;
List<String> lines = new ArrayList<>();
while ((line = bufferedReader.readLine()) != null) {
lines.add(line);
}
return lines.toArray(new String[0]);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* resource resourceIOException
*
* @param path
* @return: java.lang.String[]
*/
public String[] getFileLines(String path) throws IOException {
File file = new File(path);
if (file.isFile()) {
this.file = file;
return getFileLines(file);
} else {
URL url = getClass().getClassLoader().getResource(path);
if (url == null) {
throw new FileNotFoundException("resource path is not found");
}
file = new File(url.getPath());
if (file.isFile()) {
this.file = file;
return getFileLines(file);
} else {
throw new FileNotFoundException("properties file is not found");
}
}
}
// Type conversion
public boolean getBoolean(String key) {
return Boolean.parseBoolean(get(key));
}
public int getInt(String key) {
return Integer.parseInt(get(key));
}
public float getFloat(String key) {
return Float.parseFloat(get(key));
}
public double getDouble(String key) {
return Double.parseDouble(get(key));
}
public short getShort(String key) {
return Short.parseShort(get(key));
}
public long getLong(String key) {
return Long.parseLong(get(key));
}
//getter and setter
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public String[] getLines() {
return lines;
}
public void setLines(String[] lines) {
this.lines = lines;
}
}

@ -0,0 +1,72 @@
package com.nmggs.query.common.utils;
import com.nmggs.query.common.emnu.Constant;
import java.util.Date;
/**
* @author: shuguang
* @date: 20250527 17:05
* @description:
*/
public class QueryDateUtil {
/**
*
*
* @param querytype
* @return Date
*/
public static Date[] getDateRange(int querytype) {
Date startDate;
Date endDate;
Date nowDate = new Date();
//固定查询一天
//Date nowDate = DateTimeUtil.getFormatDate("2025-04-10 10:00:00",Constant.YYYY_MM_DD_HH_MM_SS);
switch (querytype) {
// 小时
case 1:
startDate = DateTimeUtil.addDateHours(nowDate, -1);
endDate = nowDate;
break;
// 天
case 2:
startDate = DateTimeUtil.getDateByDay(nowDate);
endDate = nowDate;
break;
// 周
case 3:
startDate = DateTimeUtil.getFirstDayOfWeekDate();
endDate = nowDate;
break;
// 月
case 4:
startDate = DateTimeUtil.getFirstDayOfMonthDate();
endDate = nowDate;
break;
// 季度
case 5:
startDate = DateTimeUtil.getFirstDayOfQuarterDate();
endDate = nowDate;
break;
// 年
default:
startDate = DateTimeUtil.getFirstDayOfYearDate();
endDate = nowDate;
break;
}
return new Date[]{startDate, endDate};
}
public static String conversionDateStr(int querytype, Date date) {
switch (querytype) {
case 1:
return DateTimeUtil.getFormateString(date, Constant.YYYY_MM_DD_HH_MM_SS);
case 2:
case 3:
case 4:
case 5:
default:
return DateTimeUtil.getFormateString(date, Constant.YYYY_MM_DD);
}
}
}

@ -0,0 +1,187 @@
package com.nmggs.query.common.utils;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Hex;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;
import java.security.Security;
import java.util.Base64;
@Slf4j
public class SM4Utils {
private static final String ALGORITHM_NAME = "SM4";
private static final String ALGORITHM_ECB_PKCS5PADDING = "SM4/ECB/PKCS5Padding";
private static final int DEFAULT_KEY_SIZE = 128;
static {
if (null == Security.getProvider(BouncyCastleProvider.PROVIDER_NAME)) {
Security.addProvider(new BouncyCastleProvider());
}
}
public static String generateKey() {
String key = "";
try {
KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME);
kg.init(DEFAULT_KEY_SIZE, new SecureRandom());
return Hex.toHexString(kg.generateKey().getEncoded());
} catch (NoSuchAlgorithmException | NoSuchProviderException e) {
log.error("生成密钥失败,报错:{}", e.getMessage(),e);
}
return key;
}
public static String sm4Encrypt(String plainString, String key) {
String cipherString = null;
try {
SecretKeySpec secretKeySpec = new SecretKeySpec(hexStringToBytes(key), ALGORITHM_NAME);
Cipher cipher = Cipher.getInstance(ALGORITHM_ECB_PKCS5PADDING, BouncyCastleProvider.PROVIDER_NAME);
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
byte[] cipherBytes = cipher.doFinal(plainString.getBytes(StandardCharsets.UTF_8));
cipherString = Base64.getEncoder().encodeToString(cipherBytes);
} catch (Exception e) {
log.error("加密密失败,报错:{}", e.getMessage(),e);
}
return cipherString;
}
public static String sm4Decrypt(String cipherString, String key) {
String plainString = null;
try {
// 注册 Bouncy Castle 提供者
Security.addProvider(new BouncyCastleProvider());
// 创建密钥规范
SecretKeySpec secretKeySpec = new SecretKeySpec(hexStringToBytes(key), "SM4");
// 获取Cipher对象实例
Cipher cipher = Cipher.getInstance(ALGORITHM_ECB_PKCS5PADDING, BouncyCastleProvider.PROVIDER_NAME);
// 初始化Cipher为解密模式
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
// 获取加密byte数组
byte[] cipherBytes = cipher.doFinal(Base64.getDecoder().decode(cipherString));
// 输出为字符串,指定字符编码
plainString = new String(cipherBytes, StandardCharsets.UTF_8);
} catch (Exception e) {
log.error("解密失败,报错:{}", e.getMessage(),e);
}
return plainString;
}
public static byte[] hexStringToBytes(String hexString) {
if (hexString != null && !"".equals(hexString)) {
hexString = hexString.toUpperCase();
if (hexString.length() % 2 != 0) {
hexString = "0" + hexString;
}
int length = hexString.length() / 2;
char[] hexChars = hexString.toCharArray();
byte[] d = new byte[length];
for (int i = 0; i < length; ++i) {
int pos = i * 2;
d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
}
return d;
} else {
return null;
}
}
private static byte charToByte(char c) {
return (byte) "0123456789ABCDEF".indexOf(c);
}
public static void encryptFile(String inputFilePath, String outputFilePath, String key) throws Exception {
try (InputStream inputStream = new FileInputStream(inputFilePath);
OutputStream outputStream = new FileOutputStream(outputFilePath);
CipherOutputStream cipherOutputStream = new CipherOutputStream(outputStream, getCipher(key, Cipher.ENCRYPT_MODE))) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
cipherOutputStream.write(buffer, 0, bytesRead);
}
} catch (Exception e) {
log.error("文件加密失败,报错:{}", e.getMessage(),e);
throw new Exception("文件加密失败", e);
}
}
public static void decryptFile(String inputFilePath, String outputFilePath, String key) throws Exception {
try (InputStream inputStream = new FileInputStream(inputFilePath);
CipherInputStream cipherInputStream = new CipherInputStream(inputStream, getCipher(key, Cipher.DECRYPT_MODE));
OutputStream outputStream = new FileOutputStream(outputFilePath)) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = cipherInputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
} catch (Exception e) {
log.error("文件解密失败,报错:{}", e.getMessage(),e);
throw new Exception("文件解密失败", e);
}
}
private static Cipher getCipher(String key, int mode) throws Exception {
SecretKeySpec secretKeySpec = new SecretKeySpec(hexStringToBytes(key), ALGORITHM_NAME);
Cipher cipher = Cipher.getInstance(ALGORITHM_ECB_PKCS5PADDING, BouncyCastleProvider.PROVIDER_NAME);
cipher.init(mode, secretKeySpec);
return cipher;
}
public static void main(String[] args) {
//加解密文件
try {
String key = generateKey();
System.out.println("生成的密钥Hex: " + key);
String inputFilePath = "D:\\downTest\\DownloadFilePath\\uploadfiles\\CPCReconciliation\\downFile\\DCPC_PAY_20250418.zip";
String encryptedFilePath = "D:\\downTest\\DownloadFilePath\\uploadfiles\\CPCReconciliation\\encryptedFile\\DCPC_PAY_20250418.zip";
encryptFile(inputFilePath, encryptedFilePath, key);
System.out.println("文件加密完成,加密后的文件路径为: " + encryptedFilePath);
String receivedEncryptedFilePath = encryptedFilePath;
String decryptedFilePath = "D:\\downTest\\DownloadFilePath\\uploadfiles\\CPCReconciliation\\decryptedFile\\DCPC_PAY_20250418.zip";
decryptFile(receivedEncryptedFilePath, decryptedFilePath, key);
System.out.println("文件解密完成,解密后的文件路径为: " + decryptedFilePath);
} catch (Exception e) {
e.printStackTrace();
}
//加解密json
//try {
//
// String key = generateKey();
// System.out.println("密钥Hex: " + key);
//
// // 待加密的JSON数据
// String json = "[{\"name\":\"张三\",\"age\":25},{\"name\":\"李四\",\"age\":18}]";
//
// // 加密JSON数据
// String encryptedJson = sm4Encrypt(json, key);
// System.out.println("加密后的JSONHex: " + encryptedJson);
// // 解密JSON数据
// String decryptedJson = sm4Decrypt(encryptedJson, key);
// System.out.println("解密后的JSON: " + decryptedJson);
//} catch (Exception e) {
// e.printStackTrace();
//}
}
}

@ -0,0 +1,51 @@
package com.nmggs.query.common.utils;
import com.nmggs.query.common.emnu.Constant;
import org.apache.commons.codec.digest.HmacUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250418 9:20
* @description:
*/
public class SignUtil {
/**
*
*/
public static String generateSign(String timestamp) {
Map<String, String> params = new HashMap<>();
params.put("timestamp", timestamp);
// 生成签名
return createSign(params);
}
public static String generateSign2(String timestamp,String date) {
Map<String, String> params = new HashMap<>();
params.put("date", date);
params.put("timestamp", timestamp);
// 生成签名
return createSign(params);
}
public static String createSign(Map<String, String> params) {
List<String> keys = new ArrayList<>(params.keySet());
Collections.sort(keys);
StringBuilder signStrBuilder = new StringBuilder();
for (String key : keys) {
if (signStrBuilder.length() > 0) {
signStrBuilder.append("&");
}
signStrBuilder.append(key).append("=").append(params.get(key));
}
String signStr = signStrBuilder.toString();
return HmacUtils.hmacSha256Hex(Constant.APP_SECRET.getBytes(), signStr.getBytes());
}
}

@ -0,0 +1,69 @@
package com.nmggs.query.common.utils;
import java.text.DecimalFormat;
/**
* @author: shuguang
* @date: 20250307 14:37
* @description:
*/
public class StringUtils {
public static void main(String[] args) {
long flag = 2252350106386944L;
System.out.println(GetFlagValue(flag));
}
/**
* flag
*
* @param flag flag
* @return java.lang.String
* @author shuguang
* @date 2025-03-11 10:19
*/
public static String GetFlagValue(long flag) {
String flagValue = "";
if (flag == 0) {
flagValue = "0";
} else if (flag == 1) {
flagValue = "1";
} else {
String binaryString = Long.toBinaryString(flag);
int postion = 1;
for (int i = binaryString.length() - 1; i >= 0; i--, postion++) {
if (binaryString.charAt(i) == '1') {
flagValue += postion + ",";
}
}
flagValue = flagValue.substring(0, flagValue.length() - 1);
}
return flagValue;
}
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.00");
/**
*
*/
public static String formattedResult(double num1, double num2) {
if (num2 == 0) {
//throw new IllegalArgumentException("除数不能为0");
return "0.00";
}
double result = (double) num1 / num2;
return DECIMAL_FORMAT.format(result);
}
public static String roundResult(long num1, long num2) {
if (num2 == 0) {
//throw new IllegalArgumentException("除数不能为0");
return "0.00";
}
long result = num1 / num2;
return Long.toString(result);
}
}

@ -0,0 +1,95 @@
package com.nmggs.query.common.utils;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class TokenUtil {
/**
* token
*/
private static String TOKEN_SECRET;
/**
*
*/
private static long EXPIRE_DATE;
static {
String SystemType = PropertiesUtil.getValue("SystemType");
if (StringUtils.isEmpty(SystemType) || SystemType.equals("0") || SystemType.equals("2")) {
TOKEN_SECRET = "apiManager";
} else if (SystemType.equals("1")) {
TOKEN_SECRET = "5267915";
}
String tokenOutTime = PropertiesUtil.getValue("tokenOutTime");
if (StringUtils.isEmpty(tokenOutTime)) {
tokenOutTime = "30";
}
EXPIRE_DATE = Long.parseLong(tokenOutTime) * 60 * 1000;
}
public static boolean verify(String token) {
/**
* @desc tokentrue
* @params [token]
**/
try {
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
JWTVerifier verifier = JWT.require(algorithm).build();
verifier.verify(token);
return true;
} catch (Exception e) {
log.error("验证token异常", e);
return false;
}
}
public static String reToken(String token, HttpServletRequest request) {
/**
* @desc tokentrue
* @params [token]
**/
try {
Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET);
JWTVerifier verifier = JWT.require(algorithm).build();
DecodedJWT jwt = verifier.verify(token);
String Man = jwt.getClaim("Man").toString().replaceAll("\\\"", "");
String Manid = jwt.getClaim("Manid").toString().replaceAll("\\\"", "");
String Manno = jwt.getClaim("Manno").toString().replaceAll("\\\"", "");
//过期时间
Date date = new Date(System.currentTimeMillis() + EXPIRE_DATE);
//秘钥及加密算法
//设置头部信息
Map<String, Object> header = new HashMap<>();
header.put("typ", "JWT");
header.put("alg", "HS256");
token = JWT.create()
.withHeader(header)
.withClaim("Man", Man)
.withClaim("Manid", Manid)
.withClaim("Manno", Manno)
.withExpiresAt(date)
.sign(algorithm);
HttpSession session = request.getSession();
session.setAttribute("token", token);
session.setAttribute("Man", Man);
session.setAttribute("Manid", Manid);
session.setAttribute("Manno", Manno);
return token;
} catch (Exception e) {
log.error("获取token异常", e);
return "";
}
}
}

@ -0,0 +1,207 @@
package com.nmggs.query.common.utils;
import lombok.extern.slf4j.Slf4j;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Objects;
import java.util.zip.CRC32;
import java.util.zip.CheckedInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
/**
* @author: shuguang
* @date: 20221109 10:03
* @description:
*/
@Slf4j
public class UnzipUtil {
private static final int BUFFER = 1024;
private static final String CODING_GBK = "GBK";
/**
*
*
* @param zipPath zip
* @param unzipPath
*/
public static List<String> decompress(String zipPath, String unzipPath) {
//记录解压后的文件路径
List<String> srcList = new ArrayList<>();
try {
//解压缩执行方法
decompressFile(new File(zipPath), new File(unzipPath), srcList);
} catch (Exception e) {
log.error("解压缩失败,报错:{}", e.getMessage());
}
return srcList;
}
/**
*
*
* @param srcFile File
* @param destFile File
*/
public static void decompressFile(File srcFile, File destFile, List<String> srcList) throws Exception {
//创建数据输入流
CheckedInputStream cis = new CheckedInputStream(new FileInputStream(srcFile), new CRC32());
//创建压缩输入流
ZipInputStream zis = new ZipInputStream(cis, StandardCharsets.UTF_8);
//异常捕获的方式判断编码格式,处理中文文件名乱码
try {
//判断代码如果此代码未抛出异常则表示编码为UTF-8
Objects.requireNonNull(zis.getNextEntry()).getName();
} catch (Exception e) {
//如果乱码会抛异常,抛异常重新创建输入流,重新设置编码格式
cis = new CheckedInputStream(new FileInputStream(srcFile), new CRC32());
zis = new ZipInputStream(cis, Charset.forName(CODING_GBK));
}
//解压zip
decompressZis(destFile, zis, srcList);
//关闭流
zis.close();
cis.close();
}
/**
*
*
* @param destFile
* @param zis ZipInputStream
*/
private static void decompressZis(File destFile, ZipInputStream zis, List<String> srcList) throws Exception {
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
//获取当前的ZIP条目路径
String dir = destFile.getPath() + File.separator + entry.getName();
File dirFile = new File(dir);
//递归检查文件路径,路径上没有文件夹则创建,保证整条路径在本地存在
fileProber(dirFile);
//判断是否是文件夹
if (entry.isDirectory()) {
//如果是,创建文件夹
dirFile.mkdirs();
} else {
//如果不是文件夹,数据流输出,生成文件
decompressFile(dirFile, zis);
srcList.add(dirFile.getPath());
}
//关闭当前的ZIP条目并定位流
zis.closeEntry();
}
}
/**
*
*
* @param dirFile ZIP
*/
private static void fileProber(File dirFile) {
//获取此路径的父目录
File parentFile = dirFile.getParentFile();
//判断是否存在
if (!parentFile.exists()) {
// 递归寻找上级目录
fileProber(parentFile);
//直至存在,递归执行创建文件夹
parentFile.mkdir();
}
}
/**
*
*
* @param destFile
* @param zis ZipInputStream
*/
private static void decompressFile(File destFile, ZipInputStream zis) throws Exception {
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile))) {
byte[] data = new byte[BUFFER];
int count;
while ((count = zis.read(data, 0, BUFFER)) != -1) {
bos.write(data, 0, count);
}
}
}
public static void dealUnZip(String zipPaths, String desZipPath) {
List<String> sourcesList = new ArrayList<>();
File targetFile = new File(desZipPath);
sourcesList.add(zipPaths);
for (String zipPath : sourcesList) {
if (zipPath.endsWith(".zip")) {
dealzip(zipPath, desZipPath);
}
}
// 确保targetFile是一个目录
if (targetFile.exists() && targetFile.isDirectory()) {
File[] files = targetFile.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".zip")) {
try {
dealzip(file.getPath(), desZipPath);
file.delete(); // 解压后删除ZIP文件
} catch (Exception e) {
// 处理解压异常
log.error("解压缩文件时出错,报错:{}", e.getMessage());
}
}
}
}
}
}
public static void dealzip(String zipSourcePath, String targetZipPath) {
File pathFile = new File(targetZipPath);
if (!pathFile.exists()) {
pathFile.mkdirs();
}
try (ZipFile zipFile = new ZipFile(zipSourcePath, StandardCharsets.UTF_8)) {
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
String zipEntryName = entry.getName();
File outPathFile = new File(targetZipPath, zipEntryName);
if (!entry.isDirectory()) {
try (InputStream in = zipFile.getInputStream(entry);
OutputStream out = new FileOutputStream(outPathFile)) {
byte[] bf = new byte[2048];
int len;
while ((len = in.read(bf)) > 0) {
out.write(bf, 0, len);
}
}
}
}
} catch (Exception e) {
log.error("解压缩文件时出错,报错:{}", e.getMessage());
}
}
}

@ -0,0 +1,14 @@
package com.nmggs.query.common.utils;
import java.util.UUID;
/**
* @author: shuguang
* @date: 20221025 18:01
* @description: uuid
*/
public class UuidUtil {
public static String getUuid() {
return UUID.randomUUID().toString().replace("-","");
}
}

@ -0,0 +1,46 @@
package com.nmggs.query.controller;
import com.nmggs.query.common.utils.UuidUtil;
import com.nmggs.query.service.AddInterfaceService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250427 15:43
* @description:
*/
@RestController
public class AddInterfaceController {
@Resource
private AddInterfaceService addInterfaceService;
@PostMapping("/baseinfo/QueryExStationTrans")
public String QueryExStationTrans(@RequestBody Map<String, Object> params) {
String uuid = UuidUtil.getUuid();
return addInterfaceService.QueryExStationTrans(params, uuid);
}
@PostMapping("/baseinfo/minPath")
public void minPath(@RequestBody Map<String, Object> params, HttpServletResponse response) {
String uuid = UuidUtil.getUuid();
addInterfaceService.minPath(params, uuid, response);
}
@PostMapping("/baseinfo/gantryinfo")
public String gantryinfo(@RequestBody Map<String, Object> params) {
String uuid = UuidUtil.getUuid();
return addInterfaceService.gantryinfo(params, uuid);
}
@PostMapping("/baseinfo/gantryfee")
public String gantryfee(@RequestBody Map<String, Object> params) {
String uuid = UuidUtil.getUuid();
return addInterfaceService.gantryfee(params, uuid);
}
}

@ -0,0 +1,29 @@
package com.nmggs.query.controller;
import com.nmggs.query.common.utils.UuidUtil;
import com.nmggs.query.service.GetDataService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250418 15:43
* @description:
*/
@RestController
public class GetDataController {
@Resource
private GetDataService getDataService;
@PostMapping("/getData")
public String getData(@RequestBody Map<String, Object> params) {
String uuid = UuidUtil.getUuid();
return getDataService.getData(params, uuid);
}
}

@ -0,0 +1,65 @@
package com.nmggs.query.controller;
import com.alibaba.fastjson2.JSON;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.nmggs.query.common.utils.UuidUtil;
import com.nmggs.query.entity.Res;
import com.nmggs.query.entity.sendproblacklist.LoginAuthentication;
import com.nmggs.query.service.SendProBlackListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author: shuguang
* @date: 20250626 16:26
* @description:
*/
@RestController
@Slf4j
public class ManualSendProBlackListController {
@Resource
private SendProBlackListService sendProBlackListService;
@GetMapping("/ManualGetFeeEvasionInfo")
public Res manualGetFeeEvasionInfo() {
String uuid = UuidUtil.getUuid();
String loginAuthenticationAccount = PropertiesUtil.getValue("loginAuthenticationAccount");
String loginAuthenticationPassword = PropertiesUtil.getValue("loginAuthenticationPassword");
String loginAuthenticationUrl = PropertiesUtil.getValue("loginAuthenticationUrl");
String getFeeEvasionInfoUrl = PropertiesUtil.getValue("sendProBlackListUrl");
log.info("[uuid:{}]-手动执行获取逃费车辆信息,获取到的配置文件参数loginAuthenticationAccount={},loginAuthenticationPassword={},loginAuthenticationUrl={},sendProBlackListUrl={}"
, uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, getFeeEvasionInfoUrl);
sendProBlackListService.getFeeEvasionInfo(uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, getFeeEvasionInfoUrl);
log.info("[uuid:{}]-手动执行获取逃费车辆信息完成", uuid);
return Res.success();
}
@GetMapping("/ManualSendProBlackList")
public Res manualSendProBlackList() {
String uuid = UuidUtil.getUuid();
String loginAuthenticationAccount = PropertiesUtil.getValue("loginAuthenticationAccount");
String loginAuthenticationPassword = PropertiesUtil.getValue("loginAuthenticationPassword");
String loginAuthenticationUrl = PropertiesUtil.getValue("loginAuthenticationUrl");
String sendProBlackListUrl = PropertiesUtil.getValue("sendProBlackListUrl");
log.info("[uuid:{}]-手动执行下发省内黑名单,获取到的配置文件参数loginAuthenticationAccount={},loginAuthenticationPassword={},loginAuthenticationUrl={},sendProBlackListUrl={}"
, uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, sendProBlackListUrl);
sendProBlackListService.sendProBlackListToInterface(uuid, loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl, sendProBlackListUrl);
log.info("[uuid:{}]-手动执行下发省内黑名单完成", uuid);
return Res.success();
}
@PostMapping("/ReceptionProBlackList")
public String receptionProBlackList(@RequestBody String json) {
System.out.println(json);
LoginAuthentication loginAuthentication = new LoginAuthentication();
loginAuthentication.setCode(200);
loginAuthentication.setData("推送成功");
loginAuthentication.setMessage("请求成功");
loginAuthentication.setSuccess(true);
return JSON.toJSONString(loginAuthentication);
}
}

@ -0,0 +1,29 @@
package com.nmggs.query.controller;
import com.nmggs.query.common.utils.UuidUtil;
import com.nmggs.query.entity.Res;
import com.nmggs.query.service.RequestInterfaceService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250617 8:30
* @description:
*/
@RestController
public class RecaptureDataController {
@Resource
private RequestInterfaceService requestInterfaceService;
@PostMapping("/recaptureDataByDate")
public Res queryProgramVersion(@RequestBody Map<String, Object> map) {
String uuid = UuidUtil.getUuid();
String dateString = map.get("dT").toString();
requestInterfaceService.getRequestInterface(uuid,dateString);
return Res.success();
}
}

@ -0,0 +1,89 @@
package com.nmggs.query.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import java.util.Date;
/**
* @author: shuguang
* @date: 20250418 10:22
* @description: CPC
*/
@Data
@TableName("DCPC_GD_PAY_INFO")
public class GDCpcPayInfo {
/**
* YYYY-MM-DD
*/
@TableField(value = "CLASS_DATE", jdbcType = JdbcType.DATE)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date class_date;
/**
*
*/
@TableField("CLASS_NO")
private String class_no;
/**
*
*/
@TableField("LIST_NO")
private String list_no;
/**
*
*/
@TableField("PAY_NO")
private String pay_no;
/**
*
*/
@TableField("ROAD_NO")
private Integer road_no;
/**
*
*/
@TableField("STA_NO")
private Integer sta_no;
/**
*
*/
@TableField("LANE_NO")
private Integer lane_no;
/**
*
*/
@TableField("PAY_FEE")
private Long pay_fee;
/**
*
*/
@TableField("FEE")
private Long fee;
/**
*
*/
@TableField("DISCOUNT_FEE")
private Long discount_fee;
/**
*
*/
@TableField("ORDER_ID")
private String order_id;
/**
* zip
*/
@TableField("ZIP_FILENAME")
private String zip_filename;
/**
*
*/
@TableField(value = "INSERT_DATE", jdbcType = JdbcType.DATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date insert_date;
}

@ -0,0 +1,38 @@
package com.nmggs.query.entity;
import com.nmggs.query.common.emnu.MessageEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author: shuguang
* @date: 20221114 14:54
* @description:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Res implements Serializable {
private static final long serialVersionUID = 1L;
private Integer code;
private Object data = "";
private String message = "";
public static Res success() {
Res result = new Res();
result.setCode(Integer.valueOf(MessageEnum..getCode()));
result.setMessage(MessageEnum..getMessage());
return result;
}
public static Res success(Object data) {
Res result = new Res();
result.setCode(Integer.valueOf(MessageEnum..getCode()));
result.setMessage(MessageEnum..getMessage());
result.setData(data);
return result;
}
}

@ -0,0 +1,21 @@
package com.nmggs.query.entity;
import lombok.Data;
/**
* @author: shuguang
* @date: 20250820 9:22
* @description:
*/
@Data
public class ResData {
/**
*
*/
private String key;
/**
*
*/
private String data;
}

@ -0,0 +1,18 @@
package com.nmggs.query.entity;
import lombok.Data;
import java.util.List;
/**
* @author: shuguang
* @date: 20250418 10:19
* @description:
*/
@Data
public class Signature {
private Integer code;
private String message;
private List data;
private Trace trace;
}

@ -0,0 +1,57 @@
package com.nmggs.query.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import java.util.Date;
/**
* @author: shuguang
* @date: 20250423 8:06
* @description:
*/
@Data
@TableName("DCPC_GD_SUMMARY_INFO")
public class Summary {
/**
* YYYY-MM-DD
*/
@TableField(value = "CLASS_DATE", jdbcType = JdbcType.DATE)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date class_date;
/**
*
*/
@TableField("TOTAL_COUNT")
private Integer total_count;
/**
*
*/
@TableField("TOTAL_PAY_FEE")
private Long total_pay_fee;
/**
*
*/
@TableField("TOTAL_FEE")
private Long total_fee;
/**
*
*/
@TableField("TOTAL_DISCOUNT_FEE")
private Long total_discount_fee;
/**
* zip
*/
@TableField("ZIP_FILENAME")
private String zip_filename;
/**
*
*/
@TableField(value = "INSERT_DATE", jdbcType = JdbcType.DATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date insert_date;
}

@ -0,0 +1,15 @@
package com.nmggs.query.entity;
import lombok.Data;
/**
* @author: shuguang
* @date: 20250418 10:17
* @description:
*/
@Data
public class Trace {
private String request_id;
private Long timestamp;
private Integer take_time;
}

@ -0,0 +1,47 @@
package com.nmggs.query.entity.sendproblacklist;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
* @author: shuguang
* @date: 20250630 8:18
* @description:
*/
@Data
@TableName("FEE_EVASION_INFO_JAVA")
public class FeeEvasionInfo {
/**
*
*/
@TableField("ADDRESS")
private String address;
/**
*
*/
@TableField("PLATENUMBER")
private String plateNumber;
/**
*
*/
@TableField("WARNINGTIME")
private Date warningTime;
/**
*
*/
@TableField("DEVICEID")
private String deviceId;
/**
*
*/
@TableField("PLATECOLOR")
private String plateColor;
/**
*
*/
@TableField("INSERTTIME")
private Date insertTime;
}

@ -0,0 +1,30 @@
package com.nmggs.query.entity.sendproblacklist;
import lombok.Data;
import java.util.List;
/**
* @author: shuguang
* @date: 20250627 10:19
* @description:
*/
@Data
public class LoginAuthentication {
/**
*200500
*/
private Integer code;
/**
*token
*/
private String data;
/**
*token12
*/
private String message;
/**
*
*/
private boolean success;
}

@ -0,0 +1,23 @@
package com.nmggs.query.entity.sendproblacklist;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @author: shuguang
* @date: 20250626 8:55
* @description:
*/
@Data
public class ProBlackList {
private String begdate;
private String cardid;
private String cardno;
private String dt;
private String platecolor;
private Integer verno;
private Long cash;
private Integer type;
}

@ -0,0 +1,19 @@
package com.nmggs.query.entity.sendproblacklist;
import lombok.Data;
import java.util.List;
/**
* @author: shuguang
* @date: 20250630 8:52
* @description:
*/
@Data
public class ResponseData {
private Integer code;
private String key;
private String data;
private String message;
private boolean success;
}

@ -0,0 +1,24 @@
package com.nmggs.query.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250427 10:39
* @description:
*/
@Mapper
public interface AddInterfaceMapper {
int getNodefeeMaxIdx();
List<Map<String, Object>> selectNodefeeList();
int getNoderelationMaxIdx();
List<Map<String, Object>> selectNoderelationList();
List<Map<String, Object>> selectExStationTransList( String vehiclePlate, String dateStart, String dateEnd);
}

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--你的mapper路径-->
<mapper namespace="com.nmggs.query.mapper.AddInterfaceMapper">
<select id="getNodefeeMaxIdx" resultType="java.lang.Integer">
SELECT MAX(idx)
FROM NODEFEE_TABLE
</select>
<select id="selectNodefeeList" resultType="java.util.Map">
SELECT "IDX" AS "version",
"TOLLINTERVALID" AS "id",
"VEHTYPE" AS "vehType",
TO_CHAR("VALIDTIME", 'YYYY-MM-DD') AS "validTime"
FROM "NODEFEE_TABLE"
WHERE "IDX" = (SELECT MAX("IDX") FROM "NODEFEE_TABLE")
</select>
<select id="getNoderelationMaxIdx" resultType="java.lang.Integer">
SELECT MAX(idx)
FROM NODERELATION_TABLE
</select>
<select id="selectNoderelationList" resultType="java.util.Map">
SELECT "IDX" AS "version",
"ENROADNODEID" AS "enRoadNodeId",
"EXROADNODEID" AS "exRoadNodeId",
"MILES" AS "miles"
FROM "NODERELATION_TABLE"
WHERE "IDX" = (SELECT MAX("IDX") FROM "NODERELATION_TABLE")
</select>
<select id="selectExStationTransList" resultType="java.util.Map">
SELECT
a."enStationId",
a."enLaneId",
a."enPassTime",
n.GBSTATIONID AS "exStationId",
s.GBID AS "exLaneId" ,
a."exPassTime",
a."fee",
a."fee_pay"
FROM
(
SELECT
ENTOLLSTATIONHEX AS "enStationId",
ENTOLLLANEID AS "enLaneId",
IDT AS "enPassTime",
stano,
PORTNO,
DT AS "exPassTime",
( INCASH + PAYCASH ) AS "fee_pay",
CASH AS "fee"
FROM
out_port
WHERE
ACARNO = #{vehiclePlate}
AND DT >= TO_DATE( #{dateStart}, 'yyyy-MM-dd' )
AND DT &lt;= TO_DATE( #{dateEnd}, 'yyyy-MM-dd' )
) a
LEFT JOIN NAME_TABLE n ON n.STANO = a.STANO
LEFT JOIN SETUP_TABLE s ON s.STANO = a.STANO
AND s.PORTNO = a.PORTNO
</select>
</mapper>

@ -0,0 +1,14 @@
package com.nmggs.query.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nmggs.query.entity.sendproblacklist.FeeEvasionInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* @author: shuguang
* @date: 20250630 8:33
* @description:
*/
@Mapper
public interface FeeEvasionInfoMapper extends BaseMapper<FeeEvasionInfo> {
}

@ -0,0 +1,14 @@
package com.nmggs.query.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nmggs.query.entity.GDCpcPayInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* @author: shuguang
* @date: 20250418 14:06
* @description:
*/
@Mapper
public interface GDCpcPayInfoMapper extends BaseMapper<GDCpcPayInfo> {
}

@ -0,0 +1,30 @@
package com.nmggs.query.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250418 15:48
* @description:
*/
@Mapper
public interface InterfaceQueryMapper {
List<Map<String, Object>> getBasicLinkOwnerDownloadReq15();
List<Map<String, Object>> getBasicTollRoadDownloadReq15();
List<Map<String, Object>> getBasicSectionDownloadReq15();
List<Map<String, Object>> getBasicVerticalSectionDownloadReq15();
List<Map<String, Object>> getBasicTollStationDownloadReq15();
List<Map<String, Object>> getBasicTollPlazaDownloadReq15();
List<Map<String, Object>> getBasicTollLaneDownloadReq15();
List<Map<String, Object>> getBasicTollPointDownloadReq15();
}

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--你的mapper路径-->
<mapper namespace="com.nmggs.query.mapper.InterfaceQueryMapper">
<select id="getBasicLinkOwnerDownloadReq15" resultType="java.util.Map">
SELECT "GBID" AS "id",
"COMNAME" AS "name",
"GBCONTACT" AS "contact",
"GBTEL" AS "tel",
"GBADDRESS" AS "address",
"BANK" AS "bank",
"BANKADDR" AS "bankAddr",
"BANKACCOUNT" AS "bankAccount",
"TAXPAYERCODE" AS "taxpayerCode",
"CREDITCODE" AS "creditCode"
FROM "COMPANY_TABLE"
</select>
<select id="getBasicTollRoadDownloadReq15" resultType="java.util.Map">
SELECT "GBID" AS "id",
"GBLINENAME" AS "name",
"GBLEVEL" AS "TECHLEVEL",
"GBSTARTSITE" AS "startSite",
"GBSTARTSTAKENUM" AS "startStakeNum",
"GBSTARTLAT" AS "startLat",
"GBSTARTLNG" AS "startLng",
"GBSTARTSTATIONID" AS "startStationId",
"GBENDSITE" AS "endSite",
"GBENDSTAKENUM" AS "endStakeNum",
"GBENDLAT" AS "endLat",
"GBENDLNG" AS "endLng",
"GBENDSTATIONID" AS "endStationId"
FROM "ROAD_LINE_TABLE"
</select>
<select id="getBasicSectionDownloadReq15" resultType="java.util.Map">
SELECT "GBLINEID" AS "id",
"LINENAME" AS "name",
"GBROADTYPE" AS "type",
"GBMILES" * 1000 AS "length",
"GBSTARTLAT" AS "startLat",
"GBSTARTLNG" AS "startLng",
"GBSTARTSTAKENUM" AS "startStakeNum",
"GBENDSTAKENUM" AS "endStakeNum",
"GBENDLAT" AS "endLat",
"GBENDLNG" AS "endLng",
"GBTAX" AS "tax",
"GBTAXRATE" AS "taxRate",
"GBSECTIONOWNERID" AS "sectionOwnerId",
"GBCHARGETYPE" AS "chargeType",
"GBTOLLROADS" AS "tollRoads",
"GBBUILTTIME" AS "builtTime",
"GBSTARTTIME" AS "startTime",
"GBENDTIME" AS "endTime"
FROM "LINE_TABLE"
</select>
<select id="getBasicVerticalSectionDownloadReq15" resultType="java.util.Map">
SELECT "ID" AS "id",
"NAME" AS "name",
"TYPE" AS "type",
"LENGTH" AS "length",
"STARTLAT" AS "startLat",
"STARTLNG" AS "startLng",
"STARTSTAKENUM" AS "startStakeNum",
"ENDSTAKENUM" AS "endStakeNum",
"ENDLAT" AS "endLat",
"ENDLNG" AS "endLng",
"TOLLROADS" AS "tollRoads",
"PROVINCETYPE" AS "provinceType",
"ENDTIME" AS "endTime"
FROM "FEEUNIT_TABLE"
</select>
<select id="getBasicTollStationDownloadReq15" resultType="java.util.Map">
SELECT "GBSTATIONID" AS "id",
"STANAME" AS "name",
"GBTOLLPLAZACOUNT" AS "tollPlazaCount",
"STATIONHEX" AS "stationHex",
"LINETYPE" AS "lineType",
"OPERATORS" AS "operators",
"DATAMERGEPOINT" AS "dataMergePoint",
"IMEI" AS "imei",
"IP" AS "ip",
"SNMPVERSION" AS "snmpVersion",
"SNMPPORT" AS "snmpPort",
"COMMUNITY" AS "community",
"SECURITYNAME" AS "securityName",
"SECURITYLEVEL" AS "securityLevel",
"AUTHENTICATION" AS "authentication",
"AUTHKEY" AS "authKey",
"ENCRYPTION" AS "encryption",
"SECRETKEY" AS "secretKey"
FROM "NAME_TABLE"
WHERE LENGTH("GBSTATIONID") > 2
</select>
<select id="getBasicTollPlazaDownloadReq15" resultType="java.util.Map">
SELECT "GBID" AS "id",
"GBNAME" AS "name",
"GBPLAZATYPE" AS "plazaType",
"GBLAT" AS "Lat",
"GBLNG" AS "Lng",
"GBSTAKENUM" AS "stakeNum",
"GBETCLANECOUNT" AS "ETCLaneCount",
"GBMTCLANECOUNT" AS "MTCLaneCount",
"GBMIXLANECOUNT" AS "mixLaneCount"
FROM "TOLLPLAZA_TABLE"
</select>
<select id="getBasicTollLaneDownloadReq15" resultType="java.util.Map">
SELECT "GBID" AS "id",
"GBTYPE" AS "type",
"GBTIDALTIME" AS "tidalTime",
"GBSTARTTIME" AS "startTime",
"GBENDTIME" AS "endTime",
"GBSTATUS" AS "status",
"LANEHEX" AS "laneHex",
"RSUMANUID" AS "rsuManUID",
"RSUMODEL" AS "rsuModel",
"RSUID" AS "rsuID"
FROM "SETUP_TABLE"
</select>
<select id="getBasicTollPointDownloadReq15" resultType="java.util.Map">
SELECT "ID" AS "id",
"NAME" AS "name",
"TYPE" AS "type",
"BOUNDARYTYPE" AS "boundaryType",
"TOLLINTERVALS" AS "tollIntervals",
"LAT" AS "lat",
"LNG" AS "lng",
"PILENUM" AS "pileNumber",
"STATUS" AS "status",
"STARTTIME" AS "startTime",
"ENDTIME" AS "endTime",
"GANTRYHEX" AS "etcGantryHex",
"RSUMANUID" AS "rsuManUID",
"RSUMODEL" AS "rsuModel",
"RSUID" AS "rsuID",
"VPLRUID" AS "vplrUID",
"VPLRMODEL" AS "vplrModel",
"VPLRID" AS "vplrID",
"HDVUID" AS "hdvUID",
"HDVMODEL" AS "hdvModel",
"HDVID" AS "hdvID",
"CONTROLLERUID" AS "controllerUID",
"CONTROLLERMODEL" AS "controllerModel",
"CONTROLLERID" AS "controllerID",
"CONTROLLERSYSVER" AS "controllerSysVer",
"SERVERUID" AS "serverUID",
"SERVERMODEL" AS "serverModel",
"SERVERID" AS "serverID",
"SERVERSYSVER" AS "serverSysVer",
"SERVERDBVER" AS "serverDBVer",
"VEHDETECTORUID" AS "vehDetectorUID",
"VEHDETECTORMODEL" AS "vehDetectorModel",
"VEHDETECTORID" AS "vehDetectorID",
"WEATHERDETECTORUID" AS "weatherDetectorUID",
"WEATHERDETECTORMODEL" AS "weatherDetectorModel",
"WEATHERDETECTORID" AS "weatherDetectorID",
"CLASSDETECTORUID" AS "classDetectorUID",
"CLASSDETECTORMODEL" AS "classDetectorModel",
"CLASSDETECTORID" AS "classDetectorID",
"LOADDETECTIONUID" AS "loadDetectionUID",
"LOADDETECTIONMODEL" AS "loadDetectionModel",
"LOADDETECTIONID" AS "loadDetectionID",
"TEMPCONTROLLERUID" AS "tempControllerUID",
"TEMPCONTROLLERMODEL" AS "tempControllerModel",
"TEMPCONTROLLERID" AS "tempControllerID",
"POWERCONTROLLERUID" AS "powerControllerUID",
"POWERCONTROLLERMODEL" AS "powerControllerModel",
"POWERCONTROLLERID" AS "powerControllerID",
"SAFEEQUIPUID" AS "safeEquipUID",
"SAFEEQUIPMODEL" AS "safeEquipModel",
"SAFEEQUIPID" AS "safeEquipID",
"LINETYPE" AS "lineType",
"OPERATORS" AS "operators",
"DATAMERGEPOINT" AS "dataMergePoint",
"IMEI" AS "imei",
"IP" AS "ip",
"SNMPVERSION" AS "snmpVersion",
"SNMPPORT" AS "snmpPort",
"COMMUNITY" AS "community",
"SECURITYNAME" AS "securityName",
"SECURITYLEVEL" AS "securityLevel",
"AUTHENTICATION" AS "authentication",
"AUTHKEY" AS "authKey",
"ENCRYPTION" AS "encryption",
"SECRETKEY" AS "secretKey"
FROM "GANTRY_TABLE"
</select>
</mapper>

@ -0,0 +1,14 @@
package com.nmggs.query.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nmggs.query.entity.Summary;
import org.apache.ibatis.annotations.Mapper;
/**
* @author: shuguang
* @date: 20250423 8:28
* @description:
*/
@Mapper
public interface SummaryMapper extends BaseMapper<Summary> {
}

@ -0,0 +1,52 @@
package com.nmggs.query.service;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250427 9:51
* @description:
*/
public interface AddInterfaceService {
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
String gantryfee(Map<String, Object> params, String uuid);
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
String gantryinfo(Map<String, Object> params, String uuid);
/**
*
*
* @param params
* @param uuid uuid
* @param response HttpServletResponse
* @author shuguang
* @date 2025-04-27 9:53
*/
void minPath(Map<String, Object> params, String uuid, HttpServletResponse response);
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
String QueryExStationTrans(Map<String, Object> params, String uuid);
}

@ -0,0 +1,20 @@
package com.nmggs.query.service;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250418 15:44
* @description:
*/
public interface GetDataService {
/**
*
* @author shuguang
* @date 2025-04-18 15:51
* @param params
* @param uuid uuid
* @return java.lang.String
*/
String getData(Map<String, Object> params, String uuid);
}

@ -0,0 +1,16 @@
package com.nmggs.query.service;
/**
* @author: shuguang
* @date: 20250418 14:03
* @description:
*/
public interface RequestInterfaceService {
/**
* CPC
*
* @author shuguang
* @date 2025-04-18 14:05
*/
void getRequestInterface(String uuid,String beforeDateString);
}

@ -0,0 +1,35 @@
package com.nmggs.query.service;
/**
* @author: shuguang
* @date: 20250626 15:31
* @description:
*/
public interface SendProBlackListService {
/**
*
*
* @param uuid uuid
* @param loginAuthenticationAccount
* @param loginAuthenticationPassword
* @param loginAuthenticationUrl
* @param getFeeEvasionInfoUrl
* @author shuguang
* @date 2025-06-30 8:34
*/
void getFeeEvasionInfo(String uuid, String loginAuthenticationAccount, String loginAuthenticationPassword, String loginAuthenticationUrl, String getFeeEvasionInfoUrl);
/**
*
*
* @param uuid uuid
* @param loginAuthenticationAccount
* @param loginAuthenticationPassword
* @param loginAuthenticationUrl
* @param sendProBlackListUrl
* @author shuguang
* @date 2025-06-27 8:34
*/
void sendProBlackListToInterface(String uuid, String loginAuthenticationAccount, String loginAuthenticationPassword, String loginAuthenticationUrl, String sendProBlackListUrl);
}

@ -0,0 +1,300 @@
package com.nmggs.query.service.impl;
import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import com.nmggs.query.common.utils.CheckUtils;
import com.nmggs.query.common.utils.FileUtil;
import com.nmggs.query.common.utils.MD5Util;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.nmggs.query.common.utils.SM4Utils;
import com.nmggs.query.entity.ResData;
import com.nmggs.query.mapper.AddInterfaceMapper;
import com.nmggs.query.service.AddInterfaceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250427 9:51
* @description:
*/
@Service
@Slf4j
public class AddInterfaceServiceImpl implements AddInterfaceService {
@Resource
private AddInterfaceMapper addInterfaceMapper;
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
@Override
public String gantryfee(Map<String, Object> params, String uuid) {
log.info("[uuid:" + uuid + "]-开始通过接口获取收费门架费率,参数为" + params);
// 鉴权码
String authKey = PropertiesUtil.getValue("authKey");
int version = (Integer) params.get("version");
String reqAuthKey = (String) params.get("authKey");
String reqMd5 = (String) params.get("md5");
String verifyMd5 = MD5Util.md5(version + authKey);
log.info("[uuid:" + uuid + "]-鉴权码为:" + authKey + ",请求鉴权码为:" + reqAuthKey + ",请求md5为" + reqMd5 + ",验证md5为" + verifyMd5);
CheckUtils.checkAddParams(authKey, reqAuthKey, reqMd5, verifyMd5);
int maxIdx = addInterfaceMapper.getNodefeeMaxIdx();
List<Map<String, Object>> list;
String result;
if (version >= maxIdx) {
log.info("[uuid:" + uuid + "]-当前查询的版本号" + version + "收费门架费率数据已是最新数据,查询不返回数据");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} else {
list = addInterfaceMapper.selectNodefeeList();
}
log.info("[uuid:" + uuid + "]-获取查询数据,条数为" + list.size());
// 转换为JSON字符串
String jsonResult = conversionJson(list, uuid);
//对数据进行加密返回并携带加密密钥
result = encryptData(jsonResult, uuid);
log.info("[uuid:{}]-数据处理完成",uuid);
return result;
}
public static String encryptData(String jsonResult, String uuid) {
String result;
try {
// 生成SM4密钥
String key = SM4Utils.generateKey();
log.info("[uuid:{}]-生成的SM4密钥为{}",uuid,key);
// 加密JSON数据
String encryptedJson = SM4Utils.sm4Encrypt(jsonResult, key);
// 将加密后的数据和密钥一起返回
// 封装密钥和加密数据
ResData resData = new ResData();
resData.setKey(key);
resData.setData(encryptedJson);
// 推送数据
result = JSON.toJSONString(resData);
} catch (Exception e) {
log.error("[uuid:{}]-加密或生成密钥时出错:{}",uuid,e.getMessage(),e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
return result;
}
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
@Override
public String gantryinfo(Map<String, Object> params, String uuid) {
log.info("[uuid:" + uuid + "]-开始通过接口获取连通关系数据,参数为" + params);
//鉴权码
String authKey = PropertiesUtil.getValue("authKey");
int version = (Integer) params.get("version");
String reqAuthKey = (String) params.get("authKey");
String reqMd5 = (String) params.get("md5");
String verifyMd5 = MD5Util.md5(version + authKey);
log.info("[uuid:" + uuid + "]-鉴权码为:" + authKey + ",请求鉴权码为:" + reqAuthKey + ",请求md5为" + reqMd5 + ",验证md5为" + verifyMd5);
CheckUtils.checkAddParams(authKey, reqAuthKey, reqMd5, verifyMd5);
int maxIdx = addInterfaceMapper.getNoderelationMaxIdx();
List<Map<String, Object>> list;
String result;
if (version >= maxIdx) {
log.info("[uuid:" + uuid + "]-当前查询的版本号" + version + "收费门架费率数据已是最新数据,查询不返回数据");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} else {
list = addInterfaceMapper.selectNoderelationList();
}
log.info("[uuid:" + uuid + "]-获取查询数据,条数为" + list.size());
// 转换为JSON字符串
String jsonResult = conversionJson(list, uuid);
//对数据进行加密返回并携带加密密钥
result = encryptData(jsonResult, uuid);
log.info("[uuid:{}]-数据处理完成",uuid);
return result;
}
/**
*
*
* @param params
* @param uuid uuid
* @param response HttpServletResponse
* @author shuguang
* @date 2025-04-27 9:53
*/
@Override
@ResponseBody
public void minPath(Map<String, Object> params, String uuid, HttpServletResponse response) {
log.info("[uuid:" + uuid + "]-开始通过接口根据参数下载最小费额文件,参数为" + params);
String version = (String) params.get("version");
int subcomno = (Integer) params.get("subcomno");
int stano = (Integer) params.get("stano");
//鉴权码
String authKey = PropertiesUtil.getValue("authKey");
String reqAuthKey = (String) params.get("authKey");
String reqMd5 = (String) params.get("md5");
String verifyMd5 = MD5Util.md5(version+subcomno+stano + authKey);
log.info("[uuid:" + uuid + "]-鉴权码为:" + authKey + ",请求鉴权码为:" + reqAuthKey + ",请求md5为" + reqMd5 + ",验证md5为" + verifyMd5);
CheckUtils.checkAddParams(authKey, reqAuthKey, reqMd5, verifyMd5);
String minFeeFilePath = PropertiesUtil.getValue("minFeeFilePath");
List<Long> longs = FileUtil.folderNames(minFeeFilePath);
if (longs.size() > 0) {
long latestVersion = Collections.max(longs);
log.info("[uuid:" + uuid + "]-当前请求下载的版本号" + version + "最小费额文件最新版本号为:" + latestVersion);
if (Long.parseLong(version) >= latestVersion) {
log.info("[uuid:" + uuid + "]-当前查询的版本号" + version + "最小费额文件已是最新数据,查询不返回数据");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
minFeeFilePath = minFeeFilePath + File.separator + latestVersion + File.separator + subcomno;
// 构造正则表达式
String regex = ".*ALLROADMINFEE_"+latestVersion+"_" +stano+"_.*\\.ZLIB$";
// 检查文件是否存在
String filePath = checkFileExistsAndGetPath(minFeeFilePath, regex);
if (filePath == null) {
log.info("[uuid:" + uuid + "]-当前查询的版本号" + version + "最小费额文件不存在,查询不返回数据");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} else {
// 将文件以下载形式返回
File file = new File(filePath);
response.setContentType("application/octet-stream");
response.setContentLengthLong(file.length());
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=\"" + file.getName() + "\"");
try (FileInputStream fileInputStream = new FileInputStream(file);
OutputStream outputStream = response.getOutputStream()) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = fileInputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.flush();
} catch (IOException e) {
log.info("[uuid:" + uuid + "]-文件流操作失败:" + e.getMessage());
}
}
} else {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-27 9:53
*/
@Override
public String QueryExStationTrans(Map<String, Object> params, String uuid) {
String result;
log.info("[uuid:" + uuid + "]-开始通过接口获取出口交易数据,参数为" + params);
String vehiclePlate = (String) params.get("VehiclePlate");
String dateStart = (String) params.get("dateStart");
String dateEnd = (String) params.get("dateEnd");
//鉴权码
String authKey = PropertiesUtil.getValue("authKey");
String reqAuthKey = (String) params.get("authKey");
String reqMd5 = (String) params.get("md5");
String verifyMd5 = MD5Util.md5(vehiclePlate+dateStart+dateEnd + authKey);
log.info("[uuid:" + uuid + "]-鉴权码为:" + authKey + ",请求鉴权码为:" + reqAuthKey + ",请求md5为" + reqMd5 + ",验证md5为" + verifyMd5);
CheckUtils.checkAddParams(authKey, reqAuthKey, reqMd5, verifyMd5);
List<Map<String, Object>> list = addInterfaceMapper.selectExStationTransList(vehiclePlate, dateStart, dateEnd);
log.info("[uuid:" + uuid + "]-获取查询数据,条数为" + list.size());
Map<String, Object> map = new HashMap<>();
map.put("dataCount", list.size());
map.put("dataList", list);
String jsonResult = conversionMapToJson(map, uuid);
//对数据进行加密返回并携带加密密钥
result = encryptData(jsonResult, uuid);
log.info("[uuid:{}]-数据处理完成",uuid);
return result;
}
private String conversionJson(List<Map<String, Object>> list, String uuid) {
String result = "";
// 使用ObjectMapper将List<Map<String, Object>>转换为JSON字符串
ObjectMapper objectMapper = new ObjectMapper();
try {
result = objectMapper.writeValueAsString(list);
} catch (JsonProcessingException e) {
log.info("[uuid:" + uuid + "]-转换json数据报错" + e.getMessage());
}
return result;
}
private String conversionMapToJson(Map<String, Object> map, String uuid) {
String result = "";
ObjectMapper objectMapper = new ObjectMapper();
try {
result = objectMapper.writeValueAsString(map);
} catch (JsonProcessingException e) {
log.info("[uuid:" + uuid + "]-转换json数据报错" + e.getMessage());
}
return result;
}
private String checkFileExistsAndGetPath(String directoryPath, String regex) {
try {
// 获取目录路径
Path path = Paths.get(directoryPath);
// 遍历目录中的文件
return Files.list(path)
// 确保是文件
.filter(Files::isRegularFile)
// 获取文件名
.map(Path::getFileName)
// 转换为字符串
.map(Path::toString)
// 匹配正则表达式
.filter(fileName -> fileName.matches(regex))
// 获取文件路径
.findFirst()
.map(fileName -> directoryPath + File.separator + fileName)
.orElse(null);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}

@ -0,0 +1,109 @@
package com.nmggs.query.service.impl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import com.nmggs.query.common.utils.CheckUtils;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.nmggs.query.mapper.InterfaceQueryMapper;
import com.nmggs.query.service.GetDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @author: shuguang
* @date: 20250418 15:45
* @description:
*/
@Service
@Slf4j
public class GetDataServiceImpl implements GetDataService {
@Resource
private InterfaceQueryMapper interfaceQueryMapper;
/**
*
*
* @param params
* @param uuid uuid
* @return java.lang.String
* @author shuguang
* @date 2025-04-18 15:51
*/
@Override
public String getData(Map<String, Object> params, String uuid) {
log.info("[uuid:" + uuid + "]-开始通过接口获取基础信息,参数为"+params);
//鉴权码
String authKey = PropertiesUtil.getValue("authKey");
String fileName = (String) params.get("fileName");
String reqAuthKey = (String) params.get("authKey");
String reqMd5 = (String) params.get("md5");
CheckUtils.checkParams(authKey, reqAuthKey, reqMd5, fileName);
List<Map<String, Object>> list;
String result = null;
//收费公路业主信息
if (fileName.contains("BASIC_LINKOWNERDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费公路业主信息");
list = interfaceQueryMapper.getBasicLinkOwnerDownloadReq15();
//收费公路信息
} else if (fileName.contains("BASIC_TOLLROADDOWNLOAD_REdisplayedSideImageQ_15")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费公路信息");
list = interfaceQueryMapper.getBasicTollRoadDownloadReq15();
//收费路段信息
} else if (fileName.contains("BASIC_SECTIONDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费路段信息");
list = interfaceQueryMapper.getBasicSectionDownloadReq15();
//收费单元信息
} else if (fileName.contains("BASIC_VERTICALSECTIONDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费单元信息");
list = interfaceQueryMapper.getBasicVerticalSectionDownloadReq15();
//收费站信息
} else if (fileName.contains("BASIC_TOLLSTATIONDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费站信息");
list = interfaceQueryMapper.getBasicTollStationDownloadReq15();
//收费广场信息
} else if (fileName.contains("BASIC_TOLLPLAZADOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费广场信息");
list = interfaceQueryMapper.getBasicTollPlazaDownloadReq15();
//收费车道信息
} else if (fileName.contains("BASIC_TOLLLANEDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费车道信息");
list = interfaceQueryMapper.getBasicTollLaneDownloadReq15();
//收费门架信息
} else if (fileName.contains("BASIC_TOLLPOINTDOWNLOAD_REQ_15_")) {
log.info("[uuid:" + uuid + "]-当前获取的是收费门架信息");
list = interfaceQueryMapper.getBasicTollPointDownloadReq15();
}else {
log.info("[uuid:" + uuid + "]-请求文件名参数校验失败");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
log.info("[uuid:" + uuid + "]-获取查询数据,条数为"+list.size());
if (list.size() == 0) {
log.info("[uuid:" + uuid + "]-请求数据不存在");
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
String jsonResult ="";
// 使用ObjectMapper将List<Map<String, Object>>转换为JSON字符串
ObjectMapper objectMapper = new ObjectMapper();
try {
jsonResult = objectMapper.writeValueAsString(list);
} catch (JsonProcessingException e) {
log.error("[uuid:" + uuid + "]-转换json数据报错"+e.getMessage());
}
//对数据进行加密返回并携带加密密钥
result = AddInterfaceServiceImpl.encryptData(jsonResult, uuid);
log.info("[uuid:{}]-数据处理完成",uuid);
return result;
}
}

@ -0,0 +1,244 @@
package com.nmggs.query.service.impl;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nmggs.query.common.emnu.Constant;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import com.nmggs.query.common.utils.NewFileUtils;
import com.nmggs.query.common.utils.PathUtil;
import com.nmggs.query.common.utils.PropertiesUtil;
import com.nmggs.query.common.utils.SM4Utils;
import com.nmggs.query.common.utils.SignUtil;
import com.nmggs.query.common.utils.UnzipUtil;
import com.nmggs.query.entity.GDCpcPayInfo;
import com.nmggs.query.entity.Signature;
import com.nmggs.query.entity.Summary;
import com.nmggs.query.mapper.GDCpcPayInfoMapper;
import com.nmggs.query.mapper.SummaryMapper;
import com.nmggs.query.service.RequestInterfaceService;
import lombok.extern.slf4j.Slf4j;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.io.FileUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author: shuguang
* @date: 20250418 14:04
* @description:
*/
@Service
@Slf4j
public class RequestInterfaceServiceImpl implements RequestInterfaceService {
@Resource
private GDCpcPayInfoMapper gdCpcPayInfoMapper;
@Resource
private SummaryMapper summaryMapper;
/**
* JSON
*
* @param str
* @return JSON true false
*/
private boolean isJson(String str) {
try {
JSON.parseObject(str);
return true;
} catch (Exception e) {
return false;
}
}
/**
* CPC
*
* @author shuguang
* @date 2025-04-18 14:05
*/
@Override
public void getRequestInterface(String uuid, String beforeDateString) {
log.info("[uuid:{}]-开始请求接口获取统计日{}的数据", uuid, beforeDateString);
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String encryptTimestamp = SignUtil.generateSign(timestamp);
String verifyInterfaceUrl = PropertiesUtil.getValue("verifyInterfaceUrl");
String reconciliationInterfaceUrl = PropertiesUtil.getValue("reconciliationInterfaceUrl");
// 构建包含查询参数的URL
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(verifyInterfaceUrl)).newBuilder();
urlBuilder.addQueryParameter("timestamp", timestamp);
String requestUrl = urlBuilder.build().toString();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url(requestUrl)
.method("GET", null)
.addHeader("app-key", Constant.APP_KEY)
.addHeader("signature", encryptTimestamp)
.build();
try (Response response = client.newCall(request).execute()) {
if (!response.isSuccessful()) {
log.error("[uuid:{}]-请求接口{}失败,返回码:{}", uuid, verifyInterfaceUrl, response.code());
throw new IOException("返回码 " + response.code());
}
String responseData = Objects.requireNonNull(response.body()).string();
// 检查返回数据是否为 JSON 格式
if (!isJson(responseData)) {
log.error("[uuid:{}]-请求接口{}返回数据格式错误,返回内容:{}", uuid, verifyInterfaceUrl, responseData);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
log.info("[uuid:{}]-请求验签接口{}成功,返回数据:{}", uuid, verifyInterfaceUrl, responseData);
Signature signature = JSON.parseObject(responseData, Signature.class);
if (signature.getCode().equals(Constant.INT_10000)) {
log.info("[uuid:{}]-开始请求对账接口{}获取统计日{}的数据", uuid, reconciliationInterfaceUrl, beforeDateString);
String cpcDownFilePath = PropertiesUtil.getValue("cpcDownFilePath");
// 请求下载文件接口携带SM4密钥
String downloadUrl = PropertiesUtil.getValue("downloadInterfaceUrl");
String key = SM4Utils.generateKey();
log.info("[uuid:{}]-生成的SM4密钥{}", uuid, key);
HttpUrl.Builder downloadUrlBuilder = Objects.requireNonNull(HttpUrl.parse(downloadUrl)).newBuilder();
downloadUrlBuilder.addQueryParameter("timestamp", timestamp);
downloadUrlBuilder.addQueryParameter("beforeDateString", beforeDateString);
downloadUrlBuilder.addQueryParameter("key", key);
String downloadRequestUrl = downloadUrlBuilder.build().toString();
Request downloadRequest = new Request.Builder()
.url(downloadRequestUrl)
.method("GET", null)
.addHeader("app-key", Constant.APP_KEY)
.addHeader("signature", SignUtil.generateSign(timestamp))
.build();
try (Response downloadResponse = client.newCall(downloadRequest).execute()) {
if (!downloadResponse.isSuccessful()) {
log.error("[uuid:{}]-请求下载接口{}失败,返回码:{}", uuid, downloadUrl, downloadResponse.code());
throw new IOException("返回码 " + downloadResponse.code());
}
// 下载加密文件
String encryptedFilePath = cpcDownFilePath + PathUtil.encryptedFile + beforeDateString + ".zip";
Files.copy(Objects.requireNonNull(downloadResponse.body()).byteStream(), Paths.get(encryptedFilePath), StandardCopyOption.REPLACE_EXISTING);
log.info("[uuid:{}]-加密文件下载完成,路径:{}", uuid, encryptedFilePath);
// 解密文件
String decryptedFilePath = cpcDownFilePath + PathUtil.decryptedFile + beforeDateString + ".zip";
SM4Utils.decryptFile(encryptedFilePath, decryptedFilePath, key);
log.info("[uuid:{}]-文件解密完成,路径:{}", uuid, decryptedFilePath);
// 解压文件并入库
insertGdCpcPayInfo(uuid, cpcDownFilePath, beforeDateString + ".zip");
} catch (IOException e) {
log.error("[uuid:{}]-请求下载接口{}失败,报错:{}", uuid, downloadUrl, e.getMessage());
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} catch (Exception e) {
log.error("[uuid:{}]-解密失败,报错:{}", uuid, e.getMessage());
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
} catch (IOException e) {
log.error("[uuid:{}]-请求接口{}失败,报错:{}", uuid, verifyInterfaceUrl, e.getMessage());
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
/**
* zipjsonDCPC_GD_PAY_INFODCPC_GD_SUMMARY_INFO
*/
private void insertGdCpcPayInfo(String uuid, String cpcDownFilePath, String fileName) throws IOException {
List<String> jsonPathList = unzipFile(uuid, cpcDownFilePath, fileName);
Summary summary = null;
List<GDCpcPayInfo> detailList = new ArrayList<>();
if (jsonPathList.size() > 0) {
for (String jsonPath : jsonPathList) {
File file2 = ResourceUtils.getFile(jsonPath);
String json = FileUtils.readFileToString(file2, Constant.UTF_8);
if (jsonPath.contains("summary")) {
// 解析 Summary 对象
summary = JSON.parseObject(json, Summary.class);
} else if (jsonPath.contains("detail")) {
// 解析 GDCpcPayInfo 列表
List<GDCpcPayInfo> details = JSON.parseArray(json, GDCpcPayInfo.class);
if (details != null) {
detailList.addAll(details);
}
}
}
}
int count = 0;
log.info("[uuid:{}]-解析zip文件{}生成对象完成", uuid, fileName);
Date nowDate = new Date();
if (!detailList.isEmpty()) {
log.info("[uuid:{}]-数据库表DCPC_GD_PAY_INFO按照主键PAY_NO先删后插", uuid);
for (GDCpcPayInfo info : detailList) {
QueryWrapper<GDCpcPayInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PAY_NO", info.getPay_no());
//按主键先删后插
gdCpcPayInfoMapper.delete(queryWrapper);
info.setZip_filename(fileName);
info.setInsert_date(nowDate);
gdCpcPayInfoMapper.insert(info);
count++;
}
log.info("[uuid:{}]-插入数据库表DCPC_GD_PAY_INFO条数为{}", uuid, count);
}
if (summary != null) {
log.info("[uuid:{}]-数据库表DCPC_GD_SUMMARY_INFO按照主键CLASS_DATE先删后插", uuid);
QueryWrapper<Summary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CLASS_DATE", summary.getClass_date());
summaryMapper.delete(queryWrapper);
summary.setZip_filename(fileName);
summary.setInsert_date(nowDate);
int insert = summaryMapper.insert(summary);
log.info("[uuid:{}]-插入数据库表DCPC_GD_SUMMARY_INFO,统计日:{},条数:{}", uuid, summary.getClass_date(), insert);
}
}
/**
*
*/
private List<String> unzipFile(String uuid, String cpcDownFilePath, String fileName) {
log.info("[uuid:{}]-解压zip文件开始 {}", uuid, fileName);
//被解压的压缩文件
String fileZip = cpcDownFilePath + PathUtil.decryptedFile + fileName;
//解压的目标目录
String destDir = cpcDownFilePath + PathUtil.unZip;
NewFileUtils.fileCreat(destDir);
//解压之前先清空解压目标目录
log.info("[uuid:{}]-清空解压目标目录 {}", uuid, fileName);
NewFileUtils.removeFiles(new File(destDir));
log.info("[uuid:{}]-解析zip文件{}生成json转对象开始", uuid, fileName);
//解压缩文件
UnzipUtil.dealUnZip(fileZip, destDir);
return NewFileUtils.getJsonPaths(destDir);
}
}

@ -0,0 +1,337 @@
package com.nmggs.query.service.impl;
import com.alibaba.fastjson2.JSON;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import com.nmggs.query.common.utils.DateTimeUtil;
import com.nmggs.query.common.utils.SM4Utils;
import com.nmggs.query.entity.ResData;
import com.nmggs.query.entity.sendproblacklist.FeeEvasionInfo;
import com.nmggs.query.entity.sendproblacklist.LoginAuthentication;
import com.nmggs.query.entity.sendproblacklist.ProBlackList;
import com.nmggs.query.entity.sendproblacklist.ResponseData;
import com.nmggs.query.mapper.FeeEvasionInfoMapper;
import com.nmggs.query.service.SendProBlackListService;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
* @author: shuguang
* @date: 20250626 15:31
* @description:
*/
@Service
@Slf4j
public class SendProBlackListServiceImpl implements SendProBlackListService {
private static final String DRIVER_NAME = "oracle.jdbc.driver.OracleDriver";
private static final String DB_URL = "jdbc:oracle:thin:@10.15.100.5:1521/TORCL";
private static final String DB_USER_NAME = "NMGLWADMIN";
private static final String DB_PASS_WORD = "nmlwzx2021[]";
private static final String SQL_STR = "select BEGDATE,CARDID,CARDNO,DT,PLATECOLOR,VERNO,CASH,TYPE from hang_table_collect_all WHERE JTFLAG =1 and PLATECOLOR ='黄'";
private static final int INT_200 = 200;
@Resource
private FeeEvasionInfoMapper feeEvasionInfoMapper;
/**
*
*
* @param uuid uuid
* @param loginAuthenticationAccount
* @param loginAuthenticationPassword
* @param loginAuthenticationUrl
* @param getFeeEvasionInfoUrl
* @author shuguang
* @date 2025-06-30 8:34
*/
@Override
public void getFeeEvasionInfo(String uuid, String loginAuthenticationAccount, String loginAuthenticationPassword, String loginAuthenticationUrl, String getFeeEvasionInfoUrl) {
log.info("[uuid:{}]-开始登录鉴权获取token", uuid);
String token = loginAndGetToken(uuid,loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl);
log.info("[uuid:{}}]-获取到token{}",uuid, token);
log.info("[uuid:{}}]-开始向指定接口:{},获取逃费记录数据",uuid, getFeeEvasionInfoUrl);
List<FeeEvasionInfo> feeEvasionInfoList = getDataToServer(uuid, getFeeEvasionInfoUrl, token);
log.info("[uuid:{}}]-获取到逃费记录数据条数:{}",uuid, feeEvasionInfoList.size());
if (feeEvasionInfoList.size() > 0) {
Date now = new Date();
for (FeeEvasionInfo feeEvasionInfo : feeEvasionInfoList) {
feeEvasionInfo.setInsertTime(now);
feeEvasionInfoMapper.insert(feeEvasionInfo);
}
}
log.info("[uuid:{}}]-获取到逃费记录数据入库到FEE_EVASION_INFO_JAVA表入库条数为{}",uuid, feeEvasionInfoList.size());
}
/**
*
*
* @param uuid uuid
* @param loginAuthenticationAccount
* @param loginAuthenticationPassword
* @param loginAuthenticationUrl
* @param sendProBlackListUrl
* @author shuguang
* @date 2025-06-27 8:34
*/
@Override
public void sendProBlackListToInterface(String uuid, String loginAuthenticationAccount, String loginAuthenticationPassword, String loginAuthenticationUrl, String sendProBlackListUrl) {
log.info("[uuid:{}]-开始登录鉴权获取token", uuid);
String token = loginAndGetToken(uuid,loginAuthenticationAccount, loginAuthenticationPassword, loginAuthenticationUrl);
//String token = "test123";
log.info("[uuid:{}}]-获取到token{}",uuid, token);
List<ProBlackList> dataList = fetchData(uuid);
//List<ProBlackList> dataList = testDate();
log.info("[uuid:{}}]-查询到最新的省内黑名单数据条数:{}",uuid, dataList.size());
// 生成密钥
String key;
try {
key = SM4Utils.generateKey();
log.info("[uuid:{}]-生成的密钥:{}", uuid, key);
} catch (Exception e) {
log.error("[uuid:{}]-生成密钥失败,报错:{}", uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
// 加密数据
String json = JSON.toJSONString(dataList);
String encryptedJson = SM4Utils.sm4Encrypt(json, key);
//log.info("[uuid:{}]-加密后的数据:{}", uuid, encryptedJson);
// 封装密钥和加密数据
ResData resData = new ResData();
resData.setKey(key);
resData.setData(encryptedJson);
// 推送数据
String pushJson = JSON.toJSONString(resData);
log.info("[uuid:{}}]-开始向指定接口:{},推送最新的省内黑名单数据",uuid, sendProBlackListUrl);
pushDataToServer(uuid,sendProBlackListUrl, token, pushJson);
}
private static List<ProBlackList> testDate() {
Date date = new Date();
List<ProBlackList> dataList = new ArrayList<>();
ProBlackList proBlackList = new ProBlackList();
proBlackList.setBegdate(DateTimeUtil.getFormateString(date, "yyyy-MM-dd HH:mm:ss"));
proBlackList.setCardid("蒙A12345");
proBlackList.setCardno("test");
proBlackList.setDt(DateTimeUtil.getFormateString(date, "yyyy-MM-dd HH:mm:ss"));
proBlackList.setPlatecolor("黄");
proBlackList.setVerno(250820001);
proBlackList.setCash(10L);
proBlackList.setType(1);
dataList.add(proBlackList);
ProBlackList proBlackList2 = new ProBlackList();
proBlackList2.setBegdate(DateTimeUtil.getFormateString(date, "yyyy-MM-dd HH:mm:ss"));
proBlackList2.setCardid("蒙A12346");
proBlackList2.setCardno("test");
proBlackList2.setDt(DateTimeUtil.getFormateString(date, "yyyy-MM-dd HH:mm:ss"));
proBlackList2.setPlatecolor("黄");
proBlackList2.setVerno(250820001);
proBlackList2.setCash(10L);
proBlackList2.setType(1);
dataList.add(proBlackList2);
return dataList;
}
private String loginAndGetToken(String uuid,String loginAuthenticationAccount, String loginAuthenticationPassword, String loginAuthenticationUrl) {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost(loginAuthenticationUrl);
List<BasicNameValuePair> formParams = new ArrayList<>();
formParams.add(new BasicNameValuePair("account", loginAuthenticationAccount));
formParams.add(new BasicNameValuePair("password", loginAuthenticationPassword));
httpPost.setEntity(new UrlEncodedFormEntity(formParams, "UTF-8"));
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
String responseString = "";
if (entity != null) {
responseString = EntityUtils.toString(entity, "UTF-8");
}
String chineseResponseString = convertUnicodeToChinese(responseString);
log.info("[uuid:{}]-登录鉴权返回数据:{}", uuid, chineseResponseString);
LoginAuthentication loginAuthentication = JSON.parseObject(chineseResponseString, LoginAuthentication.class);
if (loginAuthentication.getCode() == INT_200) {
return loginAuthentication.getData();
} else {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
} catch (Exception e) {
log.error("[uuid:{}}]-登录鉴权失败,报错:{}",uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
private List<ProBlackList> fetchData(String uuid) {
List<ProBlackList> list = new ArrayList<>();
// 定义日期格式
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Class.forName(SendProBlackListServiceImpl.DRIVER_NAME);
try (Connection connection = DriverManager.getConnection(SendProBlackListServiceImpl.DB_URL, SendProBlackListServiceImpl.DB_USER_NAME, SendProBlackListServiceImpl.DB_PASS_WORD);
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(SendProBlackListServiceImpl.SQL_STR)) {
while (rs.next()) {
ProBlackList proBlackList = new ProBlackList();
Timestamp begdate = rs.getTimestamp("BEGDATE");
Timestamp dt = rs.getTimestamp("DT");
String cardid = rs.getString("CARDID");
String cardno = rs.getString("CARDNO");
String platecolor = rs.getString("PLATECOLOR");
int verno = rs.getInt("VERNO");
long cash = rs.getLong("CASH");
int type = rs.getInt("TYPE");
// 检查字段是否为空如果不为空则设置字段值并添加到list中
if (begdate != null && dt != null && cardid != null && cardno != null &&
platecolor != null && verno != 0 && cash != 0 && type != 0) {
proBlackList.setBegdate(dateFormat.format(begdate));
proBlackList.setDt(dateFormat.format(dt));
proBlackList.setCardid(cardid);
proBlackList.setCardno(cardno);
proBlackList.setPlatecolor(platecolor);
proBlackList.setVerno(verno);
proBlackList.setCash(cash);
proBlackList.setType(type);
list.add(proBlackList);
}
}
}
return list;
} catch (ClassNotFoundException e) {
log.error("[uuid:{}}]-数据库连接异常,报错:{}", uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} catch (SQLException e) {
log.error("[uuid:{}}]-数据库执行sql失败报错{}", uuid, e);
throw new PPException(MessageEnum.sql.getCode(), MessageEnum.sql.getMessage());
}
}
private List<FeeEvasionInfo> getDataToServer(String uuid, String interfaceUrl, String token) {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
// 生成密钥
String key;
try {
key = SM4Utils.generateKey();
log.info("[uuid:{}]-生成的密钥:{}", uuid, key);
} catch (Exception e) {
log.error("[uuid:{}]-生成密钥失败,报错:{}", uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
// 构造请求参数
HttpGet httpGet = new HttpGet(interfaceUrl + "?key=" + key);
httpGet.setHeader("Authorization", token);
// 发送请求
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String responseString = "";
if (entity != null) {
responseString = EntityUtils.toString(entity, "UTF-8");
}
String chineseResponseString = convertUnicodeToChinese(responseString);
log.info("[uuid:{}]-请求接口:{},返回数据为{}", uuid, interfaceUrl, chineseResponseString);
// 解析响应数据
ResponseData responseData = JSON.parseObject(chineseResponseString, ResponseData.class);
if (responseData.getCode() == INT_200) {
log.info("[uuid:{}]-请求接口:{},获取数据成功", uuid, interfaceUrl);
// 提取密钥和加密数据
String returnedKey = responseData.getKey();
String encryptedData = responseData.getData();
// 解密数据
String decryptedData = SM4Utils.sm4Decrypt(encryptedData, returnedKey);
log.info("[uuid:{}]-解密后的数据:{}", uuid, decryptedData);
// 将解密后的数据解析为 FeeEvasionInfo 列表
return JSON.parseArray(decryptedData, FeeEvasionInfo.class);
} else {
log.info("[uuid:{}]-请求接口:{},获取数据失败", uuid, interfaceUrl);
// 返回空列表
return Collections.emptyList();
}
} catch (Exception e) {
log.error("[uuid:{}]-获取逃费记录数据失败,报错:{}", uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
private void pushDataToServer(String uuid,String interfaceUrl, String token, String json) {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost(interfaceUrl);
httpPost.setHeader("Content-Type", "application/json; charset=UTF-8");
httpPost.setHeader("Authorization", token);
httpPost.setEntity(new StringEntity(json, "UTF-8"));
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
String responseString = "";
if (entity != null) {
responseString = EntityUtils.toString(entity, "UTF-8");
}
String chineseResponseString = convertUnicodeToChinese(responseString);
log.info("[uuid:{}}]-请求接口:{},返回数据为{}",uuid, interfaceUrl, chineseResponseString);
LoginAuthentication loginAuthentication = JSON.parseObject(chineseResponseString, LoginAuthentication.class);
if (loginAuthentication.getCode() == INT_200) {
log.info("[uuid:{}}]-请求接口:{},推送数据成功",uuid, interfaceUrl);
} else {
log.info("[uuid:{}}]-请求接口:{},推送数据失败",uuid, interfaceUrl);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
} catch (Exception e) {
log.error("[uuid:{}}]-推送省内黑名单数据失败,报错:{}",uuid, e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
}
public static void main(String[] args) {
List<ProBlackList> proBlackLists = testDate();
String json = JSON.toJSONString(proBlackLists);
System.out.println( json);
}
public static String convertUnicodeToChinese(String unicodeStr) {
StringBuilder sb = new StringBuilder();
int i = 0;
while (i < unicodeStr.length()) {
if (unicodeStr.charAt(i) == '\\' && unicodeStr.charAt(i + 1) == 'u') {
StringBuilder unicode = new StringBuilder();
int j = i + 2;
for (int k = 0; k < 4; k++) {
unicode.append(Character.toUpperCase(unicodeStr.charAt(j++)));
}
sb.append((char) Integer.parseInt(unicode.toString(), 16));
i = j;
} else {
sb.append(unicodeStr.charAt(i++));
}
}
return sb.toString();
}
}

@ -0,0 +1,102 @@
package com.nmggs.query.test;
/**
* @author: shuguang
* @date: 20250523 14:56
* @description:
*/
public class GreenQRInfo {
public static final int CARD_TYPE_PASS = 2;
public static final int CARD_TYPE_TICKET = 5;
public static final int CARD_TYPE_STORE = 22;
public static final int CARD_TYPE_TOLLY = 23;
public static final int MEDIA_TYPE_OBU = 1;
public static final int MEDIA_TYPE_CPC = 2;
public static final int MEDIA_TYPE_TICKET = 3;
public static final int MEDIA_TYPE_UNKNOWN = 9;
public static final int PAY_TYPE_STORE = 1;
public static final int PAY_TYPE_TOLLY = 2;
public static String getVehPlateAll(String vehPlate, int vehPlateColor) {
if (vehPlate.isEmpty()) {
return "";
}
return vehPlate + "_" + vehPlateColor;
}
public static String getGreenQRInfo(String vehPlate, int vehPlateColor, String enStationId, String exStationId,
int enWeight, int exWeight, int cardTP, String id, String passId,
long exTime, int payType, int cash, int inCash, int vehSign, String appointId, int provCount) {
int mediaType = cardTP2MediaType(cardTP);
int transPayType = 0;
if (payType == PAY_TYPE_STORE || payType == PAY_TYPE_TOLLY) {
transPayType = 2;
if (cardTP == CARD_TYPE_TOLLY || cardTP == CARD_TYPE_STORE) {
transPayType = 1;
}
}
String sVehSign = "0xFF";
if (!(appointId.isEmpty() || "0".equals(appointId))) {
sVehSign = String.format("0x%02X", vehSign);
}
String sExWeight = "";
if (exWeight > 1000) {
sExWeight = Integer.toString(exWeight);
}
if (transPayType != 0) {
return String.format("%s|%s|%s|%d|%s|%d|%s|%s|%s|%d|%d|%d|%s|%d",
getVehPlateAll(vehPlate, vehPlateColor), enStationId, exStationId, enWeight, sExWeight, mediaType,
id, passId, DateTime2Str(exTime), transPayType, inCash, cash, sVehSign, provCount);
} else {
return String.format("%s|%s|%s|%d|%s|%d|%s|%s|%s|%s|%d|%d|%s|%d",
getVehPlateAll(vehPlate, vehPlateColor), enStationId, exStationId, enWeight, sExWeight, mediaType,
id, passId, DateTime2Str(exTime), "", cash, cash, sVehSign, provCount);
}
}
public static int cardTP2MediaType(int cardTP) {
switch (cardTP) {
case CARD_TYPE_STORE:
case CARD_TYPE_TOLLY:
return MEDIA_TYPE_OBU;
case CARD_TYPE_PASS:
return MEDIA_TYPE_CPC;
case CARD_TYPE_TICKET:
return MEDIA_TYPE_TICKET;
default:
return MEDIA_TYPE_UNKNOWN;
}
}
public static String DateTime2Str(long exTime) {
return String.format("%tF %<tT", exTime);
}
public static void main(String[] args) {
String vehPlate = "蒙A12345";
int vehPlateColor = 1;
String enStationId = "Station1";
String exStationId = "Station2";
int enWeight = 1000;
int exWeight = 1500;
int cardTP = CARD_TYPE_STORE;
String id = "ID123";
String passId = "Pass123";
long exTime = System.currentTimeMillis();
int payType = PAY_TYPE_STORE;
int cash = 100;
int inCash = 50;
int vehSign = 1;
String appointId = "0";
int provCount = 1;
String result = getGreenQRInfo(vehPlate, vehPlateColor, enStationId, exStationId, enWeight, exWeight, cardTP, id, passId, exTime, payType, cash, inCash, vehSign, appointId, provCount);
System.out.println(result);
}
}

@ -0,0 +1,40 @@
package com.nmggs.query.test;
import com.alibaba.fastjson2.JSON;
import com.nmggs.query.common.utils.SM4Utils;
import com.nmggs.query.entity.sendproblacklist.FeeEvasionInfo;
import com.nmggs.query.entity.sendproblacklist.ResponseData;
import java.util.List;
/**
* @author: shuguang
* @date: 20250819 16:17
* @description:
*/
public class SM4Test {
public static void main(String[] args) {
//String json ="{\n" +
// " \"code\": 200,\n" +
// " \"data\": \"2LonWjWevKWg6YuJXsKEOw==\",\n" +
// " \"key\": \"59ed0a9d89beab40c6ed6c60a1c7fee8\",\n" +
// " \"message\": \"请求成功\",\n" +
// " \"success\": true\n" +
// "}";
String json = "{\n" +
" \"code\": 200,\n" +
" \"data\": \"nj5H0P2zjoF8ulj2is8r0zFaaGRT5sqoStWyR7Ez6/zkRY4ISPYPhhaiCrxaNpqk2+63i5pA/85ecY2iCV0WmGOFmPNWvZRnSEhTaEz7Fc1O9G/LyKnhN6DHuC18wYuzDwsNfFQgA9j+se/YpUflCuK87tGeSiJ/7YpEysIERTW3fYNCOw6x3z4RzujxXWGW/3lKzYaKEkMxMMXGgDBIlYE+rUqZoYbjImqAS1UxLbz8Qpfj8lgdZFEPMW8wKEJcO79dR61M1NW0QXpGHdm6YisF7T7s0B2V+TWvgbZ9VUM=\",\n" +
" \"key\": \"25c5aae35c7e932519e43caba8671ffe\",\n" +
" \"message\": \"请求成功\",\n" +
" \"success\": true\n" +
"}";
ResponseData responseData = JSON.parseObject(json, ResponseData.class);
System.out.println(responseData.getData());
System.out.println(responseData.getKey());
String s = SM4Utils.sm4Decrypt(responseData.getData(), responseData.getKey());
System.out.println(s);
List<FeeEvasionInfo> feeEvasionInfos =
JSON.parseArray(s, FeeEvasionInfo.class);
System.out.println(feeEvasionInfos.size());
}
}

@ -0,0 +1,87 @@
package com.nmggs.query.test;
import com.alibaba.fastjson2.JSON;
import com.google.common.base.Stopwatch;
import com.nmggs.query.common.emnu.MessageEnum;
import com.nmggs.query.common.exception.PPException;
import com.nmggs.query.entity.sendproblacklist.ProBlackList;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author: shuguang
* @date: 20250626 8:31
* @description:
*/
public class Test01 {
public static void main(String[] args) {
String driverName = "oracle.jdbc.driver.OracleDriver";
String DBUrl = "jdbc:oracle:thin:@10.15.100.5:1521/TORCL";
String DBUserName = "NMGLWADMIN";
String DBPassWord = "nmlwzx2021[]";
String sqlStr = "select BEGDATE,CARDID,CARDNO,DT,PLATECOLOR,VERNO,CASH,TYPE from hang_table_collect_all WHERE JTFLAG=1";
// 启动计时器
Stopwatch stopwatch = Stopwatch.createStarted();
List<ProBlackList> proBlackListList = selectProBlackList( driverName, DBUrl, DBUserName, DBPassWord, sqlStr);
//将数据转成json
String json = JSON.toJSONString(proBlackListList);
System.out.println(json);
stopwatch.stop();
System.out.println( "====================");
System.out.println( proBlackListList.size());
System.out.println("耗时:" + stopwatch.elapsed(TimeUnit.MILLISECONDS) + "毫秒");
}
public static List<ProBlackList> selectProBlackList(String driverName, String url, String username, String password, String sqlParam) {
List<ProBlackList> list = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Class.forName(driverName);
try (Connection connection = DriverManager.getConnection(url, username, password);
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(sqlParam)) {
while (rs.next()) {
ProBlackList proBlackList = new ProBlackList();
Timestamp begdate = rs.getTimestamp("BEGDATE");
Timestamp dt = rs.getTimestamp("DT");
String cardid = rs.getString("CARDID");
String cardno = rs.getString("CARDNO");
String platecolor = rs.getString("PLATECOLOR");
int verno = rs.getInt("VERNO");
long cash = rs.getLong("CASH");
int type = rs.getInt("TYPE");
// 检查字段是否为空如果不为空则设置字段值并添加到list中
if (begdate != null && dt != null && cardid != null && cardno != null &&
platecolor != null && verno != 0 && cash != 0 && type != 0) {
proBlackList.setBegdate(dateFormat.format(begdate));
proBlackList.setDt(dateFormat.format(dt));
proBlackList.setCardid(cardid);
proBlackList.setCardno(cardno);
proBlackList.setPlatecolor(platecolor);
proBlackList.setVerno(verno);
proBlackList.setCash(cash);
proBlackList.setType(type);
list.add(proBlackList);
}
}
}
return list;
} catch (ClassNotFoundException e) {
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} catch (SQLException e) {
throw new PPException(MessageEnum.sql.getCode(), MessageEnum.sql.getMessage());
}
}
}

@ -0,0 +1,2 @@
org.springframework.boot.env.EnvironmentPostProcessor=\
com.nmggs.query.common.config.MyEnvironmentPostProcessor

@ -0,0 +1,255 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL如果设置为WARN则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时配置文件如果发生改变将会被重新加载默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔如果没有给出时间单位默认单位是毫秒。当scan为true时此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时将打印出logback内部日志信息实时查看logback运行状态。默认值为false。 -->
<configuration scan="false" scanPeriod="10 seconds" debug="true">
<springProperty scope="context" name="logLevel" source="spring.logback.level"/>
<springProperty scope="context" name="APP_NAME" source="spring.logback.appName"/>
<springProperty scope="context" name="myMaxHistory" source="spring.logback.myMaxHistory"/>
<springProperty scope="context" name="myFileSize" source="spring.logback.myFileSize"/>
<springProperty scope="context" name="myTotalSizeCap" source="spring.logback.myTotalSizeCap"/>
<springProperty scope="context" name="logPath" source="spring.logback.logPath"/>
<contextName>${APP_NAME}</contextName>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!--彩色日志输出格式-->
<property name="CONSOLE_LOG_PATTERN"
value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%level){blue} %clr(${PID}){magenta} %clr([%thread]){orange} %clr(%logger){cyan} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<!--非彩色日志输出格式-->
<property name="PATTERN"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level 服务名称:${APP_NAME} %logger{36} - %msg%n"/>
<!--dev文件路径src同级目录logs,如果上级目录不存在会自动创建-->
<property name="DEV_FILE_PATH" value="${logPath}/${APP_NAME}/"/>
<!-- pro文件路径 -->
<property name="PRO_FILE_PATH" value="${logPath}/${APP_NAME}/"/>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%level] [%thread] [%class:%line] %logger{50} - %m %n</pattern>-->
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符-->
<pattern>${PATTERN}</pattern>
<!-- <charset>UTF-8</charset>-->
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>
<!-- 按照每天生成输出日志文件 -->
<appender name="fileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<!--格式化输出:%d表示日期%thread表示线程%-5level级别从左显示五个字符宽度%logger{36}logger是class的全名,后面的数字代表限制最长的字符,%msg日志消息%n换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<!--滚动策略按照时间滚动-->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily 文件名称 -->
<fileNamePattern>${DEV_FILE_PATH}/output-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>${myMaxHistory}</maxHistory>
<maxFileSize>${myFileSize}</maxFileSize>
<totalSizeCap>${myTotalSizeCap}</totalSizeCap>
</rollingPolicy>
</appender>
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${DEV_FILE_PATH}/log_info_%d{yyyy-MM-dd_HH}.%i.txt</fileNamePattern>
<!-- 当文件总大小超过2GB先删除30天内最早的文件。不会删除30天外的文件。 -->
<maxHistory>${myMaxHistory}</maxHistory>
<maxFileSize>${myFileSize}</maxFileSize>
<totalSizeCap>${myTotalSizeCap}</totalSizeCap>
</rollingPolicy>
<append>true</append>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${DEV_FILE_PATH}/log_error_%d{yyyy-MM-dd_HH}.%i.txt</fileNamePattern>
<!-- 当文件总大小超过1GB先删除10天内最早的文件。不会删除10天外的文件。 -->
<maxHistory>${myMaxHistory}</maxHistory>
<maxFileSize>${myFileSize}</maxFileSize>
<totalSizeCap>${myTotalSizeCap}</totalSizeCap>
</rollingPolicy>
<append>true</append>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- <appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">-->
<!-- <fileNamePattern>${DEV_FILE_PATH}/log_warn_%d{yyyy-MM-dd_H}.%i.txt</fileNamePattern>-->
<!-- &lt;!&ndash; 每产生一个日志文件该日志文件的保存期限为10天 &ndash;&gt;-->
<!-- <maxHistory>10</maxHistory>-->
<!-- <maxFileSize>20MB</maxFileSize>-->
<!-- <totalSizeCap>500MB</totalSizeCap>-->
<!-- </rollingPolicy>-->
<!-- <append>true</append>-->
<!-- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">-->
<!-- <pattern>${PATTERN}</pattern>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- <filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!-- <level>WARN</level>-->
<!-- <onMatch>ACCEPT</onMatch>-->
<!-- <onMismatch>DENY</onMismatch>-->
<!-- </filter>-->
<!-- </appender>-->
<!-- <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">-->
<!-- <fileNamePattern>${DEV_FILE_PATH}/log_debug_%d{yyyy-MM-dd_H}.%i.txt</fileNamePattern>-->
<!-- &lt;!&ndash; 当文件总大小超过1GB先删除10天内最早的文件。不会删除10天外的文件。 &ndash;&gt;-->
<!-- <maxHistory>${myMaxHistory}</maxHistory>-->
<!-- <maxFileSize>${myFileSize}</maxFileSize>-->
<!-- <totalSizeCap>${myTotalSizeCap}</totalSizeCap>-->
<!-- </rollingPolicy>-->
<!-- <append>true</append>-->
<!-- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">-->
<!-- <pattern>${PATTERN}</pattern>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- <filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!-- <level>DEBUG</level>-->
<!-- <onMatch>ACCEPT</onMatch>-->
<!-- <onMismatch>DENY</onMismatch>-->
<!-- </filter>-->
<!-- </appender>-->
<!-- <appender name="SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">-->
<!-- <fileNamePattern>${DEV_FILE_PATH}/log-sql-%d{yyyy-MM-dd_H}.%i.txt</fileNamePattern>-->
<!-- &lt;!&ndash; 每产生一个日志文件该日志文件的保存期限为3天 &ndash;&gt;-->
<!-- <maxHistory>${myMaxHistory}</maxHistory>-->
<!-- <maxFileSize>${myFileSize}</maxFileSize>-->
<!-- <totalSizeCap>${myTotalSizeCap}</totalSizeCap>-->
<!-- </rollingPolicy>-->
<!-- <append>true</append>-->
<!-- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">-->
<!-- <pattern>${PATTERN}</pattern>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- <filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!-- <level>DEBUG</level>-->
<!-- <onMatch>ACCEPT</onMatch>-->
<!-- <onMismatch>DENY</onMismatch>-->
<!-- </filter>-->
<!-- </appender>-->
<!--异步输出-->
<!-- <appender name="DEBUG_ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender">-->
<!-- &lt;!&ndash; 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 &ndash;&gt;-->
<!-- <discardingThreshold>0</discardingThreshold>-->
<!-- &lt;!&ndash; 更改默认的队列的深度,该值会影响性能.默认值为256 &ndash;&gt;-->
<!-- <queueSize>2048</queueSize>-->
<!-- <includeCallerData>true</includeCallerData>-->
<!-- &lt;!&ndash; 添加附加的appender,最多只能添加一个 &ndash;&gt;-->
<!-- <appender-ref ref="DEBUG"/>-->
<!-- </appender>-->
<!--异步输出-->
<appender name="ERROR_ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>1024</queueSize>
<includeCallerData>true</includeCallerData>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="ERROR"/>
</appender>
<!--异步输出-->
<!-- <appender name="WARN_ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender">-->
<!-- &lt;!&ndash; 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 &ndash;&gt;-->
<!-- <discardingThreshold>0</discardingThreshold>-->
<!-- &lt;!&ndash; 更改默认的队列的深度,该值会影响性能.默认值为256 &ndash;&gt;-->
<!-- <queueSize>1024</queueSize>-->
<!-- <includeCallerData>true</includeCallerData>-->
<!-- &lt;!&ndash; 添加附加的appender,最多只能添加一个 &ndash;&gt;-->
<!-- <appender-ref ref="WARN"/>-->
<!-- </appender>-->
<!--异步输出-->
<appender name="INFO_ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>2048</queueSize>
<includeCallerData>true</includeCallerData>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="INFO"/>
</appender>
<!--异步输出-->
<!-- <appender name="SQL_ASYNC_LOG" class="ch.qos.logback.classic.AsyncAppender">-->
<!-- &lt;!&ndash; 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 &ndash;&gt;-->
<!-- <discardingThreshold>0</discardingThreshold>-->
<!-- &lt;!&ndash; 更改默认的队列的深度,该值会影响性能.默认值为256 &ndash;&gt;-->
<!-- <queueSize>2048</queueSize>-->
<!-- <includeCallerData>true</includeCallerData>-->
<!-- &lt;!&ndash; 添加附加的appender,最多只能添加一个 &ndash;&gt;-->
<!-- <appender-ref ref="SQL"/>-->
<!-- </appender>-->
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender><logger>仅有一个name属性
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别大小写无关TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF
还有一个特俗值INHERITED或者同义词NULL代表强制执行上级的级别。
如果未设置此属性那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!-- <logger name="dao" level="ERROR">-->
<!-- <appender-ref ref="SQL"/>-->
<!-- <appender-ref ref="STDOUT"/>-->
<!-- </logger>-->
<root level="${logLevel}">
<appender-ref ref="STDOUT"/>
<appender-ref ref="fileAppender"/>
<appender-ref ref="INFO_ASYNC_LOG"/>
<!-- <appender-ref ref="WARN_ASYNC_LOG"/>-->
<appender-ref ref="ERROR_ASYNC_LOG"/>
<!-- <appender-ref ref="DEBUG_ASYNC_LOG"/>-->
<!-- <appender-ref ref="SQL_ASYNC_LOG"/>-->
</root>
</configuration>

@ -0,0 +1,81 @@
#\u65E5\u5FD7\u9ED8\u8BA4\u914D\u7F6E
spring.logback.appName=GetDataInterface
spring.logback.level=INFO
spring.logback.myMaxHistory=30
spring.logback.myFileSize=10MB
spring.logback.myTotalSizeCap=2GB
#\u7F16\u7801\u8BBE\u7F6E
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
spring.messages.encoding=UTF-8
spring.profiles.active=dev
server.resources.static-locations=classpath:/resources/,classpath:/static/
# \u8FDE\u63A5\u6C60\u914D\u7F6E
spring.datasource.name=com.zaxxer.hikari.HikariConfig
spring.datasource.type=com.zaxxer.hikari.HikariConfig
spring.datasource.hikari.maximum-pool-size=25
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=0
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=300000
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.minimum-idle=1
spring.datasource.hikari.allow-pool-suspension: true
spring.datasource.hikari.register-mbeans: true
spring.datasource.hikari.leak-detection-threshold: 60000
# xml\u5730\u5740
spring.mybatis-plus.mapper-locations=com.nmggs.query.mapper/*Mapper.xml
# \u5B9E\u4F53\u626B\u63CF\uFF0C\u591A\u4E2Apackage\u7528\u9017\u53F7\u6216\u8005\u5206\u53F7\u5206\u9694
#\u81EA\u5DF1\u7684\u5B9E\u4F53\u7C7B\u5730\u5740
spring.mybatis-plus.type-aliases-package=com.nmggs.query.entity
# \u670D\u52A1\u6A21\u5757
# \u70ED\u90E8\u7F72\u5F00\u5173
spring.devtools.restart.enabled=true
#\u91CD\u542F\u76EE\u5F55
spring.devtools.restart.additional-paths=src/main
#redis
spring.session.store-type=none
#spring-session
spring.session.timeout: PT30M
spring.datasource.initialization-mode=always
#\u53BB\u9664\u9644\u4EF6\u5927\u5C0F\u9650\u5236
#\u8BF7\u6C42\u53C2\u6570\u957F\u5EA6
server.tomcat.max-http-form-post-size=10MB
server.max-http-header-size=10MB
#\u6700\u5927\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F(10MB)
spring.servlet.multipart.max-file-size = -1
spring.servlet.multipart.max-request-size = -1
server.tomcat.max-swallow-size = -1
server.tomcat.max-threads=1000
#\u4E0D\u53EF\u914D\u7F6E\u7684\u914D\u7F6E\u9879
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
logging.level.com.nmgs.ssmpback.mapper=debug
sqlClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
sqlvalidationQuery=SELECT 1
OracleClassName=oracle.jdbc.driver.OracleDriver
OraclevalidationQuery=SELECT 1 from dual
DMClassName=dm.jdbc.driver.DmDriver
DMvalidationQuery=SELECT 1
MySQLClassName=com.mysql.cj.jdbc.Driver
MySQLvalidationQuery=SELECT 1
GoldenDBClassName=com.goldendb.jdbc.Driver
GoldenvalidationQuery=SELECT 1 FROM DUAL
mybatis-plus.configuration.map-underscore-to-camel-case=false
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#前端vue
spring.web.resources.static-locations= classpath:/static/

@ -0,0 +1,7 @@
#每4小时执行一次
time.corn1 = 0 0 0/4 * * ?
#每天1点执行一次
time.corn2 = 0 0 1 * * ?
#每天3点执行一次
time.corn3 = 0 0 3 * * ?

@ -0,0 +1,13 @@
序号 日期 版本号 说明
1 2025年08月22日 1.0.0 增加定时推送省内黑名单到指定接口配置文件中isSendProBlackList是否启用下发省内黑名单到指定接口 1-下发,其他值为不下发
loginAuthenticationAccount,loginAuthenticationPassword,loginAuthenticationUrl,sendProBlackListUrl
每天凌晨一点获取逃费记录并入库FEE_EVASION_INFO_JAVA
推送省内黑名单到指定接口时使用select BEGDATE,CARDID,CARDNO,DT,PLATECOLOR,VERNO,CASH,TYPE from hang_table_collect_all WHERE JTFLAG =1 and PLATECOLOR ='黄'查询数据
增加获取数据和推送数据json时进行SM4加密
增加基础信息下载接口查询接口(http://ip:port/GetDataInterface/getData)
查询收费门架费率http://ip:port/GetDataInterface/baseinfo/gantryfee
查询连通关系http://ip:port/GetDataInterface/baseinfo/gantryinfo
根据参数下载最小费额文件http://ip:port/GetDataInterface/baseinfo/minPath
出口交易查询http://ip:port/GetDataInterface/baseinfo/QueryExStationTrans
同时增加返回json进行SM4加密文件也进行SM4加密

@ -0,0 +1,9 @@
Manifest-Version: 1.0
Created-By: IntelliJ IDEA
Built-By: shuguang
Build-Jdk: Oracle OpenJDK version 1.8.0_181
Implementation-Title: GetDataInterface
Implementation-Version: 0.0.1-SNAPSHOT
Implementation-Vendor-Id: com.nmggs
Main-Class: ${start-class}

@ -0,0 +1,2 @@
org.springframework.boot.env.EnvironmentPostProcessor=\
com.nmggs.query.common.config.MyEnvironmentPostProcessor

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save