yang_shj
2 years ago
303 changed files with 7274 additions and 41809 deletions
@ -1,21 +0,0 @@
|
||||
# http://editorconfig.org |
||||
root = true |
||||
|
||||
# 空格替代Tab缩进在各种编辑工具下效果一致 |
||||
[*] |
||||
indent_style = space |
||||
indent_size = 4 |
||||
charset = utf-8 |
||||
end_of_line = lf |
||||
trim_trailing_whitespace = true |
||||
insert_final_newline = true |
||||
|
||||
[*.java] |
||||
indent_style = tab |
||||
|
||||
[*.{json,yml}] |
||||
indent_size = 2 |
||||
|
||||
[*.md] |
||||
insert_final_newline = false |
||||
trim_trailing_whitespace = false |
@ -0,0 +1,9 @@
|
||||
*.idea |
||||
/hzims-biz-common/target |
||||
/hzims-service/*/target |
||||
/hzims-service-api/*/target |
||||
log |
||||
|
||||
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
# Default ignored files |
||||
/shelf/ |
||||
/workspace.xml |
||||
# Editor-based HTTP Client requests |
||||
/httpRequests/ |
||||
# Datasource local storage ignored files |
||||
/dataSources/ |
||||
/dataSources.local.xml |
||||
# Zeppelin ignored files |
||||
/ZeppelinRemoteNotebooks/ |
@ -1,18 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration"> |
||||
<code_scheme name="Project" version="173"> |
||||
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" /> |
||||
<option name="ENABLE_SECOND_REFORMAT" value="true" /> |
||||
<JavaCodeStyleSettings> |
||||
<option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" /> |
||||
<option name="JD_PRESERVE_LINE_FEEDS" value="true" /> |
||||
</JavaCodeStyleSettings> |
||||
<ScalaCodeStyleSettings> |
||||
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" /> |
||||
</ScalaCodeStyleSettings> |
||||
<codeStyleSettings language="JAVA"> |
||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" /> |
||||
<option name="LINE_COMMENT_ADD_SPACE" value="true" /> |
||||
<option name="WRAP_COMMENTS" value="true" /> |
||||
</codeStyleSettings> |
||||
</code_scheme> |
||||
</component> |
@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration"> |
||||
<state> |
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> |
||||
</state> |
||||
</component> |
@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="CompilerConfiguration"> |
||||
<annotationProcessing> |
||||
<profile default="true" name="Default" enabled="true" /> |
||||
<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="ticket-api" /> |
||||
<module name="hzims-operational-api" /> |
||||
<module name="safeproduct-api" /> |
||||
<module name="topvision" /> |
||||
<module name="hzims-operational" /> |
||||
<module name="topvision-api" /> |
||||
<module name="message" /> |
||||
<module name="equipment-api" /> |
||||
<module name="hzims-ticket" /> |
||||
<module name="common-api" /> |
||||
<module name="hzims-weather" /> |
||||
<module name="assets" /> |
||||
<module name="message-api" /> |
||||
<module name="assets-api" /> |
||||
<module name="inspect-api" /> |
||||
<module name="safeproduct" /> |
||||
<module name="weather-api" /> |
||||
<module name="hzims-equipment" /> |
||||
<module name="hzims-biz-common" /> |
||||
</profile> |
||||
</annotationProcessing> |
||||
</component> |
||||
<component name="JavacSettings"> |
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> |
||||
<module name="assets" options="-parameters" /> |
||||
<module name="assets-api" options="-parameters" /> |
||||
<module name="common-api" options="-parameters" /> |
||||
<module name="equipment-api" options="-parameters" /> |
||||
<module name="hzims-back" options="-parameters" /> |
||||
<module name="hzims-biz-common" options="-parameters" /> |
||||
<module name="hzims-equipment" options="-parameters" /> |
||||
<module name="hzims-operational" options="-parameters" /> |
||||
<module name="hzims-operational-api" options="-parameters" /> |
||||
<module name="hzims-service" options="-parameters" /> |
||||
<module name="hzims-service-api" options="-parameters" /> |
||||
<module name="hzims-ticket" options="-parameters" /> |
||||
<module name="hzims-weather" options="-parameters" /> |
||||
<module name="inspect-api" options="-parameters" /> |
||||
<module name="message" options="-parameters" /> |
||||
<module name="message-api" options="-parameters" /> |
||||
<module name="safeproduct" options="-parameters" /> |
||||
<module name="safeproduct-api" options="-parameters" /> |
||||
<module name="ticket-api" options="-parameters" /> |
||||
<module name="topvision" options="-parameters" /> |
||||
<module name="topvision-api" options="-parameters" /> |
||||
<module name="weather-api" options="-parameters" /> |
||||
</option> |
||||
</component> |
||||
</project> |
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8"> |
||||
<file url="file://$PROJECT_DIR$/hzims-biz-common/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-biz-common/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/assets-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/assets-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/common-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/common-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/equipment-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/equipment-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/hzims-operational-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/hzims-operational-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/inspect-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/inspect-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/message-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/message-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/safeproduct-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/safeproduct-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/ticket-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/ticket-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/topvision-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/topvision-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/weather-api/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service-api/weather-api/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/assets/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/assets/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/equipment/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/equipment/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/message/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/message/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/operational/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/operational/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/safeproduct/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/safeproduct/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/ticket/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/ticket/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/topvision/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/topvision/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/weather/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/hzims-service/weather/src/main/resources" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
||||
<file url="PROJECT" charset="UTF-8" /> |
||||
</component> |
||||
</project> |
@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="RemoteRepositoriesConfiguration"> |
||||
<remote-repository> |
||||
<option name="id" value="aliyun-repos" /> |
||||
<option name="name" value="aliyun-repos" /> |
||||
<option name="url" value="http://192.168.65.122:8081/repository/maven-public/" /> |
||||
</remote-repository> |
||||
<remote-repository> |
||||
<option name="id" value="central" /> |
||||
<option name="name" value="Nexus" /> |
||||
<option name="url" value="http://192.168.65.122:8081/repository/maven-public/" /> |
||||
</remote-repository> |
||||
<remote-repository> |
||||
<option name="id" value="central" /> |
||||
<option name="name" value="Central Repository" /> |
||||
<option name="url" value="https://repo.maven.apache.org/maven2" /> |
||||
</remote-repository> |
||||
<remote-repository> |
||||
<option name="id" value="com.e-iceblue" /> |
||||
<option name="name" value="com.e-iceblue" /> |
||||
<option name="url" value="http://192.168.65.122:8081/repository/maven-public/" /> |
||||
</remote-repository> |
||||
<remote-repository> |
||||
<option name="id" value="blade-release" /> |
||||
<option name="name" value="Release Repository" /> |
||||
<option name="url" value="http://192.168.65.122:8081/repository/maven-public/" /> |
||||
</remote-repository> |
||||
<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="com.e-iceblue" /> |
||||
<option name="name" value="com.e-iceblue" /> |
||||
<option name="url" value="https://repo.e-iceblue.cn/repository/maven-public/" /> |
||||
</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="aliyun-repos" /> |
||||
<option name="name" value="aliyun-repos" /> |
||||
<option name="url" value="https://maven.aliyun.com/nexus/content/groups/public/" /> |
||||
</remote-repository> |
||||
<remote-repository> |
||||
<option name="id" value="blade-release" /> |
||||
<option name="name" value="Release Repository" /> |
||||
<option name="url" value="http://nexus.bladex.vip/repository/maven-releases/" /> |
||||
</remote-repository> |
||||
</component> |
||||
</project> |
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||
<component name="MavenProjectsManager"> |
||||
<option name="originalFiles"> |
||||
<list> |
||||
<option value="$PROJECT_DIR$/pom.xml" /> |
||||
<option value="$PROJECT_DIR$/hzims-service-api/inspect-api/pom.xml" /> |
||||
<option value="$PROJECT_DIR$/hzims-service/pom.xml" /> |
||||
</list> |
||||
</option> |
||||
</component> |
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
||||
</project> |
@ -1,124 +0,0 @@
|
||||
<?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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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.svg" 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> |
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project version="4"> |
||||
<component name="VcsDirectoryMappings"> |
||||
<mapping directory="" vcs="Git" /> |
||||
</component> |
||||
</project> |
@ -0,0 +1,55 @@
|
||||
package com.hnac.hzims.common.logs.annotation; |
||||
|
||||
import com.hnac.hzims.common.logs.enums.BusinessType; |
||||
import com.hnac.hzims.common.logs.enums.OperatorType; |
||||
|
||||
import java.lang.annotation.*; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/29 11:38 |
||||
*/ |
||||
@Documented |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Target({ ElementType.PARAMETER, ElementType.METHOD }) |
||||
public @interface OperationAnnotation { |
||||
|
||||
|
||||
/** |
||||
* 功能模块 |
||||
*/ |
||||
String moduleName() default ""; |
||||
|
||||
|
||||
/** |
||||
* 操作模块 |
||||
* @return |
||||
*/ |
||||
String title() default "操作模块"; |
||||
|
||||
/** |
||||
* 系统类型(网页端,app端) |
||||
*/ |
||||
OperatorType operatorType() default OperatorType.OTHER; |
||||
|
||||
|
||||
/** |
||||
* 操作类型 |
||||
* @return |
||||
*/ |
||||
BusinessType businessType() default BusinessType.OTHER; |
||||
|
||||
|
||||
/** |
||||
* 是否保存响应的参数 |
||||
*/ |
||||
public boolean isSaveResponseData() default true; |
||||
|
||||
/** |
||||
* 功能说明 |
||||
* @return |
||||
*/ |
||||
String action() default "功能说明"; |
||||
} |
@ -0,0 +1,262 @@
|
||||
package com.hnac.hzims.common.logs.aop; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
||||
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
||||
import com.hnac.hzims.common.logs.consumer.SysLogQueue; |
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.enums.BusinessStatus; |
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.aspectj.lang.JoinPoint; |
||||
import org.aspectj.lang.annotation.*; |
||||
import org.aspectj.lang.reflect.CodeSignature; |
||||
import org.springblade.core.launch.props.BladeProperties; |
||||
import org.springblade.core.launch.server.ServerInfo; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.constant.BladeConstant; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.WebUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.util.StopWatch; |
||||
import org.springframework.web.context.request.RequestAttributes; |
||||
import org.springframework.web.context.request.RequestContextHolder; |
||||
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.lang.reflect.Method; |
||||
import java.time.LocalDateTime; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author dfy |
||||
* @date 2023/3/29 |
||||
* @description: 操作日志切面处理类 |
||||
*/ |
||||
@Aspect |
||||
@Component |
||||
@Slf4j |
||||
public class SysLogAspect { |
||||
|
||||
|
||||
@Autowired |
||||
private ServerInfo serverInfo; |
||||
|
||||
|
||||
@Autowired |
||||
private BladeProperties bladeProperties; |
||||
|
||||
|
||||
@Autowired |
||||
private SysLogQueue sysLogQueue; |
||||
|
||||
/** |
||||
* 请求地址 |
||||
*/ |
||||
private String requestPath = null; |
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
private String userName = null; |
||||
|
||||
/** |
||||
* 请求 |
||||
*/ |
||||
private HttpServletRequest request = null; |
||||
|
||||
|
||||
private Long userId = -1L; |
||||
|
||||
|
||||
private StopWatch stopWatch = new StopWatch(); |
||||
|
||||
|
||||
/** |
||||
* 设置操作日志切入点 在注解的位置切入代码 |
||||
*/ |
||||
@Pointcut("@annotation(com.hnac.hzims.common.logs.annotation.OperationAnnotation)") |
||||
public void logPointCut() { |
||||
} |
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 前置通知 方法调用前触发 记录开始时间,从session中获取操作人 |
||||
*/ |
||||
@Before(value = "logPointCut()") |
||||
public void before(JoinPoint joinPoint) { |
||||
stopWatch.start(); |
||||
log.info("前置通知"); |
||||
} |
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 后置通知 方法调用后触发 记录结束时间 ,操作人 ,入参等 |
||||
*/ |
||||
@AfterReturning(value = "logPointCut()", returning = "jsonResult") |
||||
public void after(JoinPoint joinPoint, Object jsonResult) { |
||||
log.info("=========返回通知=============="); |
||||
request = getHttpServletRequest(); |
||||
handleLog(joinPoint, jsonResult, null); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @return |
||||
* @Description 获取入参方法参数 |
||||
*/ |
||||
public Map<String, Object> getNameAndValue(JoinPoint joinPoint) { |
||||
Map<String, Object> param = new HashMap<>(16); |
||||
Object[] paramValues = joinPoint.getArgs(); |
||||
String[] paramNames = ((CodeSignature) joinPoint.getSignature()).getParameterNames(); |
||||
for (int i = 0; i < paramNames.length; i++) { |
||||
if (paramValues[i] instanceof Integer || paramValues[i] instanceof String) { |
||||
param.put(paramNames[i], paramValues[i]); |
||||
} |
||||
} |
||||
return param; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @Description: 获取request |
||||
*/ |
||||
public HttpServletRequest getHttpServletRequest() { |
||||
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
||||
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
||||
HttpServletRequest request = sra.getRequest(); |
||||
return request; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @param joinPoint |
||||
* @Description 异常通知 |
||||
*/ |
||||
@AfterThrowing(pointcut = "logPointCut()", throwing = "e") |
||||
public void throwing(JoinPoint joinPoint, Exception e) { |
||||
log.info("=========异常通知=============="); |
||||
handleLog(joinPoint, null, e); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 转换request 请求参数 |
||||
* |
||||
* @param paramMap request获取的参数数组 |
||||
*/ |
||||
public Map<String, String> converMap(Map<String, String[]> paramMap) { |
||||
Map<String, String> rtnMap = new HashMap<String, String>(); |
||||
for (String key : paramMap.keySet()) { |
||||
rtnMap.put(key, paramMap.get(key)[0]); |
||||
} |
||||
return rtnMap; |
||||
} |
||||
|
||||
/** |
||||
* 转换异常信息为字符串 |
||||
* |
||||
* @param exceptionName 异常名称 |
||||
* @param exceptionMessage 异常信息 |
||||
* @param elements 堆栈信息 |
||||
*/ |
||||
public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) { |
||||
StringBuffer strbuff = new StringBuffer(); |
||||
for (StackTraceElement stet : elements) { |
||||
strbuff.append(stet + "\n"); |
||||
} |
||||
String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); |
||||
return message; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 处理操作日志结果集 |
||||
* |
||||
* @param joinPoint |
||||
* @param jsonResult |
||||
* @param exception |
||||
*/ |
||||
private void handleLog(JoinPoint joinPoint, Object jsonResult, Exception exception) { |
||||
String targetName = joinPoint.getTarget().getClass().getName(); |
||||
String methodName = joinPoint.getSignature().getName(); |
||||
Object[] arguments = joinPoint.getArgs(); |
||||
Class<?> targetClass = null; |
||||
try { |
||||
targetClass = Class.forName(targetName); |
||||
} catch (ClassNotFoundException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
Method[] methods = targetClass.getMethods(); |
||||
String title; |
||||
String action; |
||||
String businessType; |
||||
String operatorType; |
||||
String moduleName; |
||||
Class<?>[] clazzs; |
||||
for (Method method : methods) { |
||||
if (method.getName().equals(methodName)) { |
||||
clazzs = method.getParameterTypes(); |
||||
if (clazzs != null && clazzs.length == arguments.length && method.getAnnotation(OperationAnnotation.class) != null) { |
||||
// 获取请求的类名
|
||||
String className = joinPoint.getTarget().getClass().getName(); |
||||
methodName = className + "." + methodName; |
||||
request = getHttpServletRequest(); |
||||
requestPath = request.getServletPath(); |
||||
OperationAnnotation annotation = method.getAnnotation(OperationAnnotation.class); |
||||
title = annotation.title(); |
||||
action = annotation.action(); |
||||
businessType = annotation.businessType().getValue(); |
||||
operatorType = annotation.operatorType().getValue(); |
||||
moduleName = annotation.moduleName(); |
||||
// 获取当前用户信息
|
||||
userName = AuthUtil.getUserAccount(request); |
||||
userId = AuthUtil.getUserId(request); |
||||
SysLogTo sysLog = new SysLogTo(); |
||||
if (StringUtils.isBlank(userName) && userId == -1) { |
||||
userName = "当前用户未登录"; |
||||
} |
||||
sysLog.setModuleName(moduleName); |
||||
sysLog.setOperationUserName(userName); |
||||
sysLog.setOperationUserId(userId); |
||||
sysLog.setTenantId(Func.toStr(AuthUtil.getTenantId(), BladeConstant.ADMIN_TENANT_ID)); |
||||
sysLog.setLocalIp(WebUtil.getIP(request));// 请求IP
|
||||
stopWatch.stop(); |
||||
sysLog.setCostTime(stopWatch.getTotalTimeMillis() + "ms"); |
||||
sysLog.setPath(requestPath); |
||||
sysLog.setTitle(title); |
||||
sysLog.setAction(action); |
||||
sysLog.setOperatorType(operatorType); |
||||
sysLog.setBusinessType(businessType); |
||||
sysLog.setParameter(getNameAndValue(joinPoint).toString()); |
||||
sysLog.setMethodClass(className); |
||||
sysLog.setMethodName(methodName); |
||||
sysLog.setServerName(bladeProperties.getName()); |
||||
sysLog.setServerHost(serverInfo.getHostName()); |
||||
sysLog.setServerIp(serverInfo.getIpWithPort()); |
||||
sysLog.setEnv(bladeProperties.getEnv()); |
||||
sysLog.setMethod(request.getMethod()); |
||||
sysLog.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER)); |
||||
sysLog.setOperationTime(LocalDateTime.now()); |
||||
|
||||
//返回结果集
|
||||
if (ObjectUtils.isNotEmpty(jsonResult)) { |
||||
sysLog.setStatus(BusinessStatus.SUCCESS.getKey()); |
||||
sysLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); |
||||
} |
||||
|
||||
//异常结果集
|
||||
if (exception != null) { |
||||
sysLog.setStatus(BusinessStatus.FAIL.getKey()); |
||||
sysLog.setErrorMsg(StringUtils.substring(exception.getMessage(), 0, 2000)); |
||||
} |
||||
//保存到阻塞队列里
|
||||
sysLogQueue.add(sysLog); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,119 @@
|
||||
package com.hnac.hzims.common.logs.consumer; |
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.SysLogFeignService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.PostConstruct; |
||||
import javax.annotation.PreDestroy; |
||||
import javax.annotation.Resource; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 执行异步线程操作 |
||||
* @Author dfy |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 14:00 |
||||
*/ |
||||
@Slf4j |
||||
@Component |
||||
public class SysLogConsumer implements Runnable { |
||||
|
||||
/** |
||||
* 默认16 |
||||
*/ |
||||
private static final int DEFAULT_BATCH_SIZE = 16; |
||||
|
||||
@Resource |
||||
private SysLogQueue auditLogQueue; |
||||
/** |
||||
* 批次数 |
||||
*/ |
||||
private int batchSize = DEFAULT_BATCH_SIZE; |
||||
|
||||
@Autowired |
||||
private SysLogFeignService sysLogFeignService; |
||||
|
||||
|
||||
/** |
||||
* 默认为true |
||||
*/ |
||||
private boolean active = true; |
||||
|
||||
private Thread thread; |
||||
|
||||
|
||||
/** |
||||
* 启动线程 |
||||
*/ |
||||
@PostConstruct |
||||
public void init() { |
||||
thread = new Thread(this); |
||||
thread.start(); |
||||
thread.setName("SysLogConsumer"); |
||||
} |
||||
|
||||
/** |
||||
* 使用该注解在项目结束的舒缓关闭 |
||||
*/ |
||||
@PreDestroy |
||||
public void close() { |
||||
active = false; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 执行线程操作 |
||||
*/ |
||||
@Override |
||||
public void run() { |
||||
while (active) { |
||||
execute(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 执行业务处理操作,新增日志记录 |
||||
*/ |
||||
public void execute() { |
||||
List<SysLogTo> sysLogs = new ArrayList<>(); |
||||
try { |
||||
int size = 0; |
||||
while (size < batchSize) { |
||||
//从队列中取出一个
|
||||
SysLogTo sysLog = auditLogQueue.poll(); |
||||
if (sysLog == null) { |
||||
break; |
||||
} |
||||
sysLogs.add(sysLog); |
||||
size++; |
||||
} |
||||
} catch (InterruptedException e) { |
||||
e.printStackTrace(); |
||||
log.error(e.toString()); |
||||
} |
||||
//如果当前的日志list不为空
|
||||
if (CollectionUtils.isNotEmpty(sysLogs)) { |
||||
log.info("日志操作数据:" + sysLogs); |
||||
// TODO: 2023/4/4 添加到数据库
|
||||
try { |
||||
// TODO: 2023/4/4 后期采取kafka+elk实现,可以提高效率,操作日志数据越来越大,查询效率变大,提高性能
|
||||
sysLogFeignService.saveBatch(sysLogs); |
||||
} catch (Exception e) { |
||||
// TODO: 2023/4/4 出现异常呢,
|
||||
e.printStackTrace(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.hnac.hzims.common.logs.consumer; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.concurrent.BlockingQueue; |
||||
import java.util.concurrent.LinkedBlockingQueue; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* 定义队列 |
||||
* @Author dfy |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 14:01 |
||||
*/ |
||||
@Component |
||||
public class SysLogQueue { |
||||
|
||||
/** |
||||
* BlockingDequeue为双端阻塞队列,blockingQueue阻塞队列 |
||||
*/ |
||||
private BlockingQueue<SysLogTo> blockingQueue = new LinkedBlockingQueue<>(); |
||||
|
||||
/** |
||||
* 存入数据 |
||||
* @param auditLog |
||||
*/ |
||||
public void add(SysLogTo auditLog) { |
||||
blockingQueue.add(auditLog); |
||||
} |
||||
|
||||
/** |
||||
* poll从队列的头部获取到信息 |
||||
* @return |
||||
* @throws InterruptedException |
||||
*/ |
||||
public SysLogTo poll() throws InterruptedException { |
||||
//每秒钟执行一次
|
||||
return blockingQueue.poll(1, TimeUnit.SECONDS); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 操作状态 |
||||
* |
||||
* @author ruoyi |
||||
* |
||||
*/ |
||||
public enum BusinessStatus |
||||
{ |
||||
/** |
||||
* 成功 |
||||
*/ |
||||
SUCCESS(0,"执行成功"), |
||||
|
||||
/** |
||||
* 异常 |
||||
*/ |
||||
FAIL(1,"执行异常"); |
||||
|
||||
@Getter |
||||
private Integer key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
BusinessStatus(Integer key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,73 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 业务操作类型 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public enum BusinessType |
||||
{ |
||||
/** |
||||
* 其它 |
||||
*/ |
||||
OTHER("OTHER","其他"), |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
INSERT("INSERT","新增"), |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
UPDATE("UPDATE","修改"), |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
DELETE("DELETE","删除"), |
||||
|
||||
/** |
||||
* 授权 |
||||
*/ |
||||
GRANT("GRANT","授权"), |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
EXPORT("EXPORT","导出"), |
||||
|
||||
/** |
||||
* 导入 |
||||
*/ |
||||
IMPORT("IMPORT","导入"), |
||||
|
||||
/** |
||||
* 强退 |
||||
*/ |
||||
FORCE("FORCE","强退"), |
||||
|
||||
/** |
||||
* 查询 |
||||
*/ |
||||
GENCODE("GENCODE","查询"), |
||||
|
||||
/** |
||||
* 清空数据 |
||||
*/ |
||||
CLEAN("CLEAN","清空数据"); |
||||
|
||||
@Getter |
||||
private String key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
BusinessType(String key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.common.logs.enums; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 操作人类别 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public enum OperatorType |
||||
{ |
||||
/** |
||||
* 其它 |
||||
*/ |
||||
OTHER("OTHER","其它"), |
||||
|
||||
/** |
||||
* 后台用户 |
||||
*/ |
||||
MANAGE("MANAGE","后台用户"), |
||||
|
||||
/** |
||||
* web 端 |
||||
*/ |
||||
MOBILE("MOBILE","web端"), |
||||
/** |
||||
* app 端 |
||||
*/ |
||||
APPSYSTEMS("APPSYSTEMS","app端"); |
||||
|
||||
|
||||
@Getter |
||||
private String key; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
|
||||
OperatorType(String key,String value){ |
||||
this.key = key; |
||||
this.value = value; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.common.logs.fegin; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.fallback.SysLogFeignServiceFallback; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.stereotype.Repository; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/3 13:46 |
||||
*/ |
||||
@Repository |
||||
@FeignClient(value = "hzims-middle",fallback = SysLogFeignServiceFallback.class) |
||||
public interface SysLogFeignService { |
||||
|
||||
/** |
||||
* 报存日志操作 |
||||
* |
||||
* @param sysLogs |
||||
*/ |
||||
@PostMapping("/systemlog/sys-log/batchSave") |
||||
void saveBatch(@RequestBody List<SysLogTo> sysLogs); |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.hnac.hzims.common.logs.fegin.fallback; |
||||
|
||||
import com.hnac.hzims.common.logs.to.SysLogTo; |
||||
import com.hnac.hzims.common.logs.fegin.SysLogFeignService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/4 9:45 |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
public class SysLogFeignServiceFallback implements SysLogFeignService { |
||||
/** |
||||
* 报存日志操作 |
||||
* |
||||
* @param sysLogs |
||||
*/ |
||||
@Override |
||||
public void saveBatch(List<SysLogTo> sysLogs) { |
||||
log.error("报存日志操作异常发生,进入fallback方法"); |
||||
log.error("获取异常的数据 {}", sysLogs); |
||||
throw new IllegalArgumentException("报存日志操作异常发生,进入fallback方法"); |
||||
} |
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.hnac.hzims.common.logs.text; |
||||
|
||||
|
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
|
||||
import java.nio.charset.Charset; |
||||
import java.nio.charset.StandardCharsets; |
||||
|
||||
/** |
||||
* 字符集工具类 |
||||
* |
||||
* @author dfy |
||||
*/ |
||||
public class CharsetKit |
||||
{ |
||||
/** ISO-8859-1 */ |
||||
public static final String ISO_8859_1 = "ISO-8859-1"; |
||||
/** UTF-8 */ |
||||
public static final String UTF_8 = "UTF-8"; |
||||
/** GBK */ |
||||
public static final String GBK = "GBK"; |
||||
|
||||
/** ISO-8859-1 */ |
||||
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); |
||||
/** UTF-8 */ |
||||
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); |
||||
/** GBK */ |
||||
public static final Charset CHARSET_GBK = Charset.forName(GBK); |
||||
|
||||
/** |
||||
* 转换为Charset对象 |
||||
* |
||||
* @param charset 字符集,为空则返回默认字符集 |
||||
* @return Charset |
||||
*/ |
||||
public static Charset charset(String charset) |
||||
{ |
||||
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); |
||||
} |
||||
|
||||
/** |
||||
* 转换字符串的字符集编码 |
||||
* |
||||
* @param source 字符串 |
||||
* @param srcCharset 源字符集,默认ISO-8859-1 |
||||
* @param destCharset 目标字符集,默认UTF-8 |
||||
* @return 转换后的字符集 |
||||
*/ |
||||
public static String convert(String source, String srcCharset, String destCharset) |
||||
{ |
||||
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); |
||||
} |
||||
|
||||
/** |
||||
* 转换字符串的字符集编码 |
||||
* |
||||
* @param source 字符串 |
||||
* @param srcCharset 源字符集,默认ISO-8859-1 |
||||
* @param destCharset 目标字符集,默认UTF-8 |
||||
* @return 转换后的字符集 |
||||
*/ |
||||
public static String convert(String source, Charset srcCharset, Charset destCharset) |
||||
{ |
||||
if (null == srcCharset) |
||||
{ |
||||
srcCharset = StandardCharsets.ISO_8859_1; |
||||
} |
||||
|
||||
if (null == destCharset) |
||||
{ |
||||
destCharset = StandardCharsets.UTF_8; |
||||
} |
||||
|
||||
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) |
||||
{ |
||||
return source; |
||||
} |
||||
return new String(source.getBytes(srcCharset), destCharset); |
||||
} |
||||
|
||||
/** |
||||
* @return 系统字符集编码 |
||||
*/ |
||||
public static String systemCharset() |
||||
{ |
||||
return Charset.defaultCharset().name(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,93 @@
|
||||
package com.hnac.hzims.common.logs.text; |
||||
|
||||
|
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
|
||||
/** |
||||
* 字符串格式化 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class StrFormatter |
||||
{ |
||||
public static final String EMPTY_JSON = "{}"; |
||||
public static final char C_BACKSLASH = '\\'; |
||||
public static final char C_DELIM_START = '{'; |
||||
public static final char C_DELIM_END = '}'; |
||||
|
||||
/** |
||||
* 格式化字符串<br> |
||||
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
||||
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
||||
* 例:<br> |
||||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
||||
* |
||||
* @param strPattern 字符串模板 |
||||
* @param argArray 参数列表 |
||||
* @return 结果 |
||||
*/ |
||||
public static String format(final String strPattern, final Object... argArray) |
||||
{ |
||||
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) |
||||
{ |
||||
return strPattern; |
||||
} |
||||
final int strPatternLength = strPattern.length(); |
||||
|
||||
// 初始化定义好的长度以获得更好的性能
|
||||
StringBuilder sbuf = new StringBuilder(strPatternLength + 50); |
||||
|
||||
int handledPosition = 0; |
||||
int delimIndex;// 占位符所在位置
|
||||
for (int argIndex = 0; argIndex < argArray.length; argIndex++) |
||||
{ |
||||
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); |
||||
if (delimIndex == -1) |
||||
{ |
||||
if (handledPosition == 0) |
||||
{ |
||||
return strPattern; |
||||
} |
||||
else |
||||
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
|
||||
sbuf.append(strPattern, handledPosition, strPatternLength); |
||||
return sbuf.toString(); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) |
||||
{ |
||||
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) |
||||
{ |
||||
// 转义符之前还有一个转义符,占位符依旧有效
|
||||
sbuf.append(strPattern, handledPosition, delimIndex - 1); |
||||
sbuf.append(Convert.utf8Str(argArray[argIndex])); |
||||
handledPosition = delimIndex + 2; |
||||
} |
||||
else |
||||
{ |
||||
// 占位符被转义
|
||||
argIndex--; |
||||
sbuf.append(strPattern, handledPosition, delimIndex - 1); |
||||
sbuf.append(C_DELIM_START); |
||||
handledPosition = delimIndex + 1; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
// 正常占位符
|
||||
sbuf.append(strPattern, handledPosition, delimIndex); |
||||
sbuf.append(Convert.utf8Str(argArray[argIndex])); |
||||
handledPosition = delimIndex + 2; |
||||
} |
||||
} |
||||
} |
||||
// 加入最后一个占位符后所有的字符
|
||||
sbuf.append(strPattern, handledPosition, strPattern.length()); |
||||
|
||||
return sbuf.toString(); |
||||
} |
||||
} |
@ -0,0 +1,151 @@
|
||||
package com.hnac.hzims.common.logs.to; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/29 13:24 |
||||
*/ |
||||
@Data |
||||
public class SysLogTo { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
|
||||
private Long id; |
||||
|
||||
/** |
||||
* 租户ID |
||||
*/ |
||||
private String tenantId; |
||||
|
||||
/** |
||||
* 服务器ip |
||||
*/ |
||||
protected String serverIp; |
||||
|
||||
|
||||
/** |
||||
* 服务器地址 |
||||
*/ |
||||
protected String serverHost; |
||||
|
||||
/** |
||||
* 服务名称 |
||||
*/ |
||||
protected String serverName; |
||||
|
||||
|
||||
/** |
||||
* 环境 |
||||
*/ |
||||
protected String env; |
||||
|
||||
|
||||
/** |
||||
* 操作人 id |
||||
*/ |
||||
private Long operationUserId; |
||||
|
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
private String operationUserName; |
||||
|
||||
/** |
||||
* 请求路径 (操作地址) |
||||
*/ |
||||
private String path; |
||||
|
||||
|
||||
/** |
||||
* 用户代理 |
||||
*/ |
||||
protected String userAgent; |
||||
|
||||
|
||||
/** |
||||
* 操作方式 |
||||
*/ |
||||
protected String method; |
||||
|
||||
/** |
||||
* 方法类 |
||||
*/ |
||||
protected String methodClass; |
||||
|
||||
/** |
||||
* 方法名 |
||||
*/ |
||||
protected String methodName; |
||||
|
||||
/** |
||||
* 方法执行时间 消耗时间 毫秒 |
||||
*/ |
||||
private String costTime; |
||||
|
||||
/** |
||||
* 方法入参 |
||||
*/ |
||||
private String parameter; |
||||
|
||||
/** |
||||
* 操作方法 |
||||
*/ |
||||
private String title; |
||||
|
||||
/** |
||||
* 方法描述 |
||||
*/ |
||||
private String action; |
||||
|
||||
/** |
||||
* 系统类型 |
||||
*/ |
||||
private String operatorType; |
||||
|
||||
/** |
||||
* 操作人类别 |
||||
*/ |
||||
private String businessType; |
||||
|
||||
|
||||
/** |
||||
* 返回结果 |
||||
* |
||||
* @param jsonResult |
||||
*/ |
||||
public String jsonResult; |
||||
|
||||
/** |
||||
* 请求的Ip |
||||
*/ |
||||
private String localIp; |
||||
|
||||
/** |
||||
* 错误消息 |
||||
*/ |
||||
private String errorMsg; |
||||
/** |
||||
* 操作时间 |
||||
*/ |
||||
private LocalDateTime operationTime; |
||||
|
||||
|
||||
/** |
||||
* 操作状态(0 正常 1 异常) |
||||
*/ |
||||
private Integer status; |
||||
|
||||
|
||||
/** |
||||
* 功能模块 |
||||
*/ |
||||
private String moduleName; |
||||
|
||||
} |
@ -0,0 +1,130 @@
|
||||
package com.hnac.hzims.common.logs.utils; |
||||
|
||||
/** |
||||
* 通用常量信息 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class Constants |
||||
{ |
||||
/** |
||||
* UTF-8 字符集 |
||||
*/ |
||||
public static final String UTF8 = "UTF-8"; |
||||
|
||||
/** |
||||
* GBK 字符集 |
||||
*/ |
||||
public static final String GBK = "GBK"; |
||||
|
||||
/** |
||||
* www主域 |
||||
*/ |
||||
public static final String WWW = "www."; |
||||
|
||||
/** |
||||
* RMI 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_RMI = "rmi:"; |
||||
|
||||
/** |
||||
* LDAP 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_LDAP = "ldap:"; |
||||
|
||||
/** |
||||
* LDAPS 远程方法调用 |
||||
*/ |
||||
public static final String LOOKUP_LDAPS = "ldaps:"; |
||||
|
||||
/** |
||||
* http请求 |
||||
*/ |
||||
public static final String HTTP = "http://"; |
||||
|
||||
/** |
||||
* https请求 |
||||
*/ |
||||
public static final String HTTPS = "https://"; |
||||
|
||||
/** |
||||
* 成功标记 |
||||
*/ |
||||
public static final Integer SUCCESS = 200; |
||||
|
||||
/** |
||||
* 失败标记 |
||||
*/ |
||||
public static final Integer FAIL = 500; |
||||
|
||||
/** |
||||
* 登录成功状态 |
||||
*/ |
||||
public static final String LOGIN_SUCCESS_STATUS = "0"; |
||||
|
||||
/** |
||||
* 登录失败状态 |
||||
*/ |
||||
public static final String LOGIN_FAIL_STATUS = "1"; |
||||
|
||||
/** |
||||
* 登录成功 |
||||
*/ |
||||
public static final String LOGIN_SUCCESS = "Success"; |
||||
|
||||
/** |
||||
* 注销 |
||||
*/ |
||||
public static final String LOGOUT = "Logout"; |
||||
|
||||
/** |
||||
* 注册 |
||||
*/ |
||||
public static final String REGISTER = "Register"; |
||||
|
||||
/** |
||||
* 登录失败 |
||||
*/ |
||||
public static final String LOGIN_FAIL = "Error"; |
||||
|
||||
/** |
||||
* 当前记录起始索引 |
||||
*/ |
||||
public static final String PAGE_NUM = "pageNum"; |
||||
|
||||
/** |
||||
* 每页显示记录数 |
||||
*/ |
||||
public static final String PAGE_SIZE = "pageSize"; |
||||
|
||||
/** |
||||
* 排序列 |
||||
*/ |
||||
public static final String ORDER_BY_COLUMN = "orderByColumn"; |
||||
|
||||
/** |
||||
* 排序的方向 "desc" 或者 "asc". |
||||
*/ |
||||
public static final String IS_ASC = "isAsc"; |
||||
|
||||
/** |
||||
* 验证码有效期(分钟) |
||||
*/ |
||||
public static final long CAPTCHA_EXPIRATION = 2; |
||||
|
||||
/** |
||||
* 资源映射路径 前缀 |
||||
*/ |
||||
public static final String RESOURCE_PREFIX = "/profile"; |
||||
|
||||
/** |
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
||||
*/ |
||||
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; |
||||
|
||||
/** |
||||
* 定时任务违规的字符 |
||||
*/ |
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", |
||||
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" }; |
||||
} |
@ -0,0 +1,567 @@
|
||||
package com.hnac.hzims.common.logs.utils; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/3/31 15:43 |
||||
*/ |
||||
|
||||
import java.util.Collection; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
import com.hnac.hzims.common.logs.text.StrFormatter; |
||||
import org.springframework.util.AntPathMatcher; |
||||
|
||||
/** |
||||
* 字符串工具类 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils |
||||
{ |
||||
/** 空字符串 */ |
||||
private static final String NULLSTR = ""; |
||||
|
||||
/** 下划线 */ |
||||
private static final char SEPARATOR = '_'; |
||||
|
||||
/** |
||||
* 获取参数不为空值 |
||||
* |
||||
* @param value defaultValue 要判断的value |
||||
* @return value 返回值 |
||||
*/ |
||||
public static <T> T nvl(T value, T defaultValue) |
||||
{ |
||||
return value != null ? value : defaultValue; |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Collection是否为空, 包含List,Set,Queue |
||||
* |
||||
* @param coll 要判断的Collection |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Collection<?> coll) |
||||
{ |
||||
return isNull(coll) || coll.isEmpty(); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Collection是否非空,包含List,Set,Queue |
||||
* |
||||
* @param coll 要判断的Collection |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Collection<?> coll) |
||||
{ |
||||
return !isEmpty(coll); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象数组是否为空 |
||||
* |
||||
* @param objects 要判断的对象数组 |
||||
** @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Object[] objects) |
||||
{ |
||||
return isNull(objects) || (objects.length == 0); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象数组是否非空 |
||||
* |
||||
* @param objects 要判断的对象数组 |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Object[] objects) |
||||
{ |
||||
return !isEmpty(objects); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Map是否为空 |
||||
* |
||||
* @param map 要判断的Map |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(Map<?, ?> map) |
||||
{ |
||||
return isNull(map) || map.isEmpty(); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个Map是否为空 |
||||
* |
||||
* @param map 要判断的Map |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotEmpty(Map<?, ?> map) |
||||
{ |
||||
return !isEmpty(map); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个字符串是否为空串 |
||||
* |
||||
* @param str String |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isEmpty(String str) |
||||
{ |
||||
return isNull(str) || NULLSTR.equals(str.trim()); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个字符串是否为非空串 |
||||
* |
||||
* @param str String |
||||
* @return true:非空串 false:空串 |
||||
*/ |
||||
public static boolean isNotEmpty(String str) |
||||
{ |
||||
return !isEmpty(str); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否为空 |
||||
* |
||||
* @param object Object |
||||
* @return true:为空 false:非空 |
||||
*/ |
||||
public static boolean isNull(Object object) |
||||
{ |
||||
return object == null; |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否非空 |
||||
* |
||||
* @param object Object |
||||
* @return true:非空 false:空 |
||||
*/ |
||||
public static boolean isNotNull(Object object) |
||||
{ |
||||
return !isNull(object); |
||||
} |
||||
|
||||
/** |
||||
* * 判断一个对象是否是数组类型(Java基本型别的数组) |
||||
* |
||||
* @param object 对象 |
||||
* @return true:是数组 false:不是数组 |
||||
*/ |
||||
public static boolean isArray(Object object) |
||||
{ |
||||
return isNotNull(object) && object.getClass().isArray(); |
||||
} |
||||
|
||||
/** |
||||
* 去空格 |
||||
*/ |
||||
public static String trim(String str) |
||||
{ |
||||
return (str == null ? "" : str.trim()); |
||||
} |
||||
|
||||
/** |
||||
* 截取字符串 |
||||
* |
||||
* @param str 字符串 |
||||
* @param start 开始 |
||||
* @return 结果 |
||||
*/ |
||||
public static String substring(final String str, int start) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = str.length() + start; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = 0; |
||||
} |
||||
if (start > str.length()) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
return str.substring(start); |
||||
} |
||||
|
||||
/** |
||||
* 截取字符串 |
||||
* |
||||
* @param str 字符串 |
||||
* @param start 开始 |
||||
* @param end 结束 |
||||
* @return 结果 |
||||
*/ |
||||
public static String substring(final String str, int start, int end) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (end < 0) |
||||
{ |
||||
end = str.length() + end; |
||||
} |
||||
if (start < 0) |
||||
{ |
||||
start = str.length() + start; |
||||
} |
||||
|
||||
if (end > str.length()) |
||||
{ |
||||
end = str.length(); |
||||
} |
||||
|
||||
if (start > end) |
||||
{ |
||||
return NULLSTR; |
||||
} |
||||
|
||||
if (start < 0) |
||||
{ |
||||
start = 0; |
||||
} |
||||
if (end < 0) |
||||
{ |
||||
end = 0; |
||||
} |
||||
|
||||
return str.substring(start, end); |
||||
} |
||||
|
||||
/** |
||||
* 判断是否为空,并且不是空白字符 |
||||
* |
||||
* @param str 要判断的value |
||||
* @return 结果 |
||||
*/ |
||||
public static boolean hasText(String str) |
||||
{ |
||||
return (str != null && !str.isEmpty() && containsText(str)); |
||||
} |
||||
|
||||
private static boolean containsText(CharSequence str) |
||||
{ |
||||
int strLen = str.length(); |
||||
for (int i = 0; i < strLen; i++) |
||||
{ |
||||
if (!Character.isWhitespace(str.charAt(i))) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 格式化文本, {} 表示占位符<br> |
||||
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
||||
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
||||
* 例:<br> |
||||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
||||
* |
||||
* @param template 文本模板,被替换的部分用 {} 表示 |
||||
* @param params 参数值 |
||||
* @return 格式化后的文本 |
||||
*/ |
||||
public static String format(String template, Object... params) |
||||
{ |
||||
if (isEmpty(params) || isEmpty(template)) |
||||
{ |
||||
return template; |
||||
} |
||||
return StrFormatter.format(template, params); |
||||
} |
||||
|
||||
/** |
||||
* 是否为http(s)://开头
|
||||
* |
||||
* @param link 链接 |
||||
* @return 结果 |
||||
*/ |
||||
public static boolean ishttp(String link) |
||||
{ |
||||
return startsWithAny(link, Constants.HTTP, Constants.HTTPS); |
||||
} |
||||
|
||||
/** |
||||
* 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value |
||||
* |
||||
* @param array 给定的数组 |
||||
* @return boolean 结果 |
||||
*/ |
||||
public static boolean containsAny(Collection<String> collection, String... array) |
||||
{ |
||||
if (isEmpty(collection) || isEmpty(array)) |
||||
{ |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
for (String str : array) |
||||
{ |
||||
if (collection.contains(str)) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 驼峰转下划线命名 |
||||
*/ |
||||
public static String toUnderScoreCase(String str) |
||||
{ |
||||
if (str == null) |
||||
{ |
||||
return null; |
||||
} |
||||
StringBuilder sb = new StringBuilder(); |
||||
// 前置字符是否大写
|
||||
boolean preCharIsUpperCase = true; |
||||
// 当前字符是否大写
|
||||
boolean curreCharIsUpperCase = true; |
||||
// 下一字符是否大写
|
||||
boolean nexteCharIsUpperCase = true; |
||||
for (int i = 0; i < str.length(); i++) |
||||
{ |
||||
char c = str.charAt(i); |
||||
if (i > 0) |
||||
{ |
||||
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); |
||||
} |
||||
else |
||||
{ |
||||
preCharIsUpperCase = false; |
||||
} |
||||
|
||||
curreCharIsUpperCase = Character.isUpperCase(c); |
||||
|
||||
if (i < (str.length() - 1)) |
||||
{ |
||||
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); |
||||
} |
||||
|
||||
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) |
||||
{ |
||||
sb.append(SEPARATOR); |
||||
} |
||||
else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) |
||||
{ |
||||
sb.append(SEPARATOR); |
||||
} |
||||
sb.append(Character.toLowerCase(c)); |
||||
} |
||||
|
||||
return sb.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 是否包含字符串 |
||||
* |
||||
* @param str 验证字符串 |
||||
* @param strs 字符串组 |
||||
* @return 包含返回true |
||||
*/ |
||||
public static boolean inStringIgnoreCase(String str, String... strs) |
||||
{ |
||||
if (str != null && strs != null) |
||||
{ |
||||
for (String s : strs) |
||||
{ |
||||
if (str.equalsIgnoreCase(trim(s))) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld |
||||
* |
||||
* @param name 转换前的下划线大写方式命名的字符串 |
||||
* @return 转换后的驼峰式命名的字符串 |
||||
*/ |
||||
public static String convertToCamelCase(String name) |
||||
{ |
||||
StringBuilder result = new StringBuilder(); |
||||
// 快速检查
|
||||
if (name == null || name.isEmpty()) |
||||
{ |
||||
// 没必要转换
|
||||
return ""; |
||||
} |
||||
else if (!name.contains("_")) |
||||
{ |
||||
// 不含下划线,仅将首字母大写
|
||||
return name.substring(0, 1).toUpperCase() + name.substring(1); |
||||
} |
||||
// 用下划线将原始字符串分割
|
||||
String[] camels = name.split("_"); |
||||
for (String camel : camels) |
||||
{ |
||||
// 跳过原始字符串中开头、结尾的下换线或双重下划线
|
||||
if (camel.isEmpty()) |
||||
{ |
||||
continue; |
||||
} |
||||
// 首字母大写
|
||||
result.append(camel.substring(0, 1).toUpperCase()); |
||||
result.append(camel.substring(1).toLowerCase()); |
||||
} |
||||
return result.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 驼峰式命名法 |
||||
* 例如:user_name->userName |
||||
*/ |
||||
public static String toCamelCase(String s) |
||||
{ |
||||
if (s == null) |
||||
{ |
||||
return null; |
||||
} |
||||
if (s.indexOf(SEPARATOR) == -1) |
||||
{ |
||||
return s; |
||||
} |
||||
s = s.toLowerCase(); |
||||
StringBuilder sb = new StringBuilder(s.length()); |
||||
boolean upperCase = false; |
||||
for (int i = 0; i < s.length(); i++) |
||||
{ |
||||
char c = s.charAt(i); |
||||
|
||||
if (c == SEPARATOR) |
||||
{ |
||||
upperCase = true; |
||||
} |
||||
else if (upperCase) |
||||
{ |
||||
sb.append(Character.toUpperCase(c)); |
||||
upperCase = false; |
||||
} |
||||
else |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 |
||||
* |
||||
* @param str 指定字符串 |
||||
* @param strs 需要检查的字符串数组 |
||||
* @return 是否匹配 |
||||
*/ |
||||
public static boolean matches(String str, List<String> strs) |
||||
{ |
||||
if (isEmpty(str) || isEmpty(strs)) |
||||
{ |
||||
return false; |
||||
} |
||||
for (String pattern : strs) |
||||
{ |
||||
if (isMatch(pattern, str)) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 判断url是否与规则配置: |
||||
* ? 表示单个字符; |
||||
* * 表示一层路径内的任意字符串,不可跨层级; |
||||
* ** 表示任意层路径; |
||||
* |
||||
* @param pattern 匹配规则 |
||||
* @param url 需要匹配的url |
||||
* @return |
||||
*/ |
||||
public static boolean isMatch(String pattern, String url) |
||||
{ |
||||
AntPathMatcher matcher = new AntPathMatcher(); |
||||
return matcher.match(pattern, url); |
||||
} |
||||
|
||||
@SuppressWarnings("unchecked") |
||||
public static <T> T cast(Object obj) |
||||
{ |
||||
return (T) obj; |
||||
} |
||||
|
||||
/** |
||||
* 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 |
||||
* |
||||
* @param num 数字对象 |
||||
* @param size 字符串指定长度 |
||||
* @return 返回数字的字符串格式,该字符串为指定长度。 |
||||
*/ |
||||
public static final String padl(final Number num, final int size) |
||||
{ |
||||
return padl(num.toString(), size, '0'); |
||||
} |
||||
|
||||
/** |
||||
* 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 |
||||
* |
||||
* @param s 原始字符串 |
||||
* @param size 字符串指定长度 |
||||
* @param c 用于补齐的字符 |
||||
* @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 |
||||
*/ |
||||
public static final String padl(final String s, final int size, final char c) |
||||
{ |
||||
final StringBuilder sb = new StringBuilder(size); |
||||
if (s != null) |
||||
{ |
||||
final int len = s.length(); |
||||
if (s.length() <= size) |
||||
{ |
||||
for (int i = size - len; i > 0; i--) |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
sb.append(s); |
||||
} |
||||
else |
||||
{ |
||||
return s.substring(len - size, len); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
for (int i = size; i > 0; i--) |
||||
{ |
||||
sb.append(c); |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -1 +0,0 @@
|
||||
com.hnac.hzims.common.launch.LauncherServiceImpl |
@ -1 +0,0 @@
|
||||
restart.include.hzims-biz-common=/hzims-biz-common[\\w-]+\.jar |
@ -1,5 +0,0 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ |
||||
com.hnac.hzims.common.utils.CacheUtil,\ |
||||
com.hnac.hzims.common.config.BladeCommonConfiguration,\ |
||||
com.hnac.hzims.common.config.RedisMessageConfig,\ |
||||
com.hnac.hzims.common.service.UserAuthDataService |
@ -1,8 +0,0 @@
|
||||
${AnsiColor.BLUE} ______ _ _ ___ ___ |
||||
${AnsiColor.BLUE} | ___ \| | | | \ \ / / |
||||
${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___ \ V / |
||||
${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \ > < |
||||
${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/ / . \ |
||||
${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|/__/ \__\ |
||||
|
||||
${AnsiColor.BLUE}:: BladeX :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
artifactId=hzims-biz-common |
||||
groupId=com.hnac.hzims |
||||
version=4.0.0-SNAPSHOT |
@ -1,28 +0,0 @@
|
||||
com\hnac\hzims\common\pojo\Tree.class |
||||
com\hnac\hzims\common\invalid\DictInvalidator.class |
||||
com\hnac\hzims\common\utils\Condition.class |
||||
com\hnac\hzims\common\invalid\ObjectRequiredInvalidator.class |
||||
com\hnac\hzims\common\constant\LauncherConstant.class |
||||
com\hnac\hzims\common\service\UserAuthDataService.class |
||||
META-INF\spring.factories |
||||
com\hnac\hzims\common\invalid\DictInvalid.class |
||||
com\hnac\hzims\common\utils\CacheUtil$3.class |
||||
com\hnac\hzims\common\utils\TreeUtil$TreeUtilBuilder.class |
||||
com\hnac\hzims\common\config\RedisMessageListener.class |
||||
com\hnac\hzims\common\utils\CommonUtil.class |
||||
com\hnac\hzims\common\constant\CommonConstant.class |
||||
com\hnac\hzims\common\utils\TreeUtil.class |
||||
META-INF\services\org.springblade.core.launch.service.LauncherService |
||||
META-INF\spring-devtools.properties |
||||
com\hnac\hzims\common\config\BladeCommonConfiguration.class |
||||
com\hnac\hzims\common\constant\DateConstant$UnitEnum.class |
||||
com\hnac\hzims\common\utils\DateUtil$1.class |
||||
com\hnac\hzims\common\invalid\ObjectRequiredInvalid.class |
||||
com\hnac\hzims\common\utils\CacheUtil$1.class |
||||
com\hnac\hzims\common\constant\DateConstant.class |
||||
com\hnac\hzims\common\cache\CacheNames.class |
||||
com\hnac\hzims\common\utils\DateUtil.class |
||||
com\hnac\hzims\common\utils\CacheUtil$2.class |
||||
com\hnac\hzims\common\launch\LauncherServiceImpl.class |
||||
com\hnac\hzims\common\utils\CacheUtil.class |
||||
com\hnac\hzims\common\config\RedisMessageConfig.class |
@ -1,19 +0,0 @@
|
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\invalid\DictInvalid.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\config\RedisMessageListener.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\config\RedisMessageConfig.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\constant\DateConstant.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\service\UserAuthDataService.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\constant\LauncherConstant.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\utils\TreeUtil.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\config\BladeCommonConfiguration.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\invalid\ObjectRequiredInvalid.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\pojo\Tree.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\utils\CommonUtil.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\utils\DateUtil.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\launch\LauncherServiceImpl.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\cache\CacheNames.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\utils\Condition.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\invalid\DictInvalidator.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\invalid\ObjectRequiredInvalidator.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\constant\CommonConstant.java |
||||
F:\华自科技\项目\hzims-back\hzims-biz-common\src\main\java\com\hnac\hzims\common\utils\CacheUtil.java |
@ -0,0 +1,70 @@
|
||||
package com.hnac.hzims.operational.duty.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.SqlCondition; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
|
||||
/** |
||||
* 实体类 |
||||
* |
||||
* @author ty |
||||
*/ |
||||
@Data |
||||
@TableName("hz_ims_duty_analyse_example") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "AnalyseExample对象", description = "分析实例配置类") |
||||
public class AnalyseExample extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 4259568798118459986L; |
||||
/** |
||||
* 配置ID |
||||
*/ |
||||
@ApiModelProperty(value = "配置ID") |
||||
private Long id; |
||||
/** |
||||
* 站点ID |
||||
*/ |
||||
@ApiModelProperty(value = "站点ID") |
||||
private Long siteId; |
||||
/** |
||||
* 站点名称 |
||||
*/ |
||||
@ApiModelProperty(value = "站点名称") |
||||
private String siteName; |
||||
/** |
||||
* 设备ID |
||||
*/ |
||||
@ApiModelProperty(value = "设备ID") |
||||
private Long equipmentId; |
||||
|
||||
/** |
||||
* 设备名称 |
||||
*/ |
||||
@ApiModelProperty(value = "设备名称") |
||||
private String equipmentName; |
||||
/** |
||||
* 分析实例ID |
||||
*/ |
||||
@ApiModelProperty(value = "分析实例ID") |
||||
private Long deviceCode; |
||||
/** |
||||
* 分析实例名称 |
||||
*/ |
||||
@ApiModelProperty(value = "分析实例名称") |
||||
private String analyseName; |
||||
|
||||
/** |
||||
* 属性ID |
||||
*/ |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
@ApiModelProperty(value = "属性ID") |
||||
private String propertyIds; |
||||
|
||||
|
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.hnac.hzims.operational.duty.vo; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
@Data |
||||
@ApiModel(value = "调班对象", description = "调班填写的相关信息") |
||||
public class ChangeDutyMainVo extends ImsDutyMainEntity { |
||||
|
||||
@ApiModelProperty(value = "人员ID") |
||||
private List<String> personId; |
||||
|
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@ApiModelProperty(value = "调班开始日期") |
||||
private Date changeStartDate; |
||||
|
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@ApiModelProperty(value = "调班开始日期") |
||||
private Date changeEndtDate; |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ApiModelProperty(value = "班次ID") |
||||
private Long classId; |
||||
/** |
||||
* 调班类型 |
||||
* 1为调入,2为调出 |
||||
*/ |
||||
@ApiModelProperty(value = "调班类型") |
||||
private Integer type;//1为调入,2为调出
|
||||
} |
@ -0,0 +1,89 @@
|
||||
package com.hnac.hzims.message.entity; |
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.mp.support.SqlCondition; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
|
||||
@Data |
||||
@ApiModel(value = "消息推送记录",description = "消息推送记录") |
||||
@TableName("hzims_message_push_record") |
||||
@EqualsAndHashCode |
||||
public class MessagePushRecordEntity extends MessageTemplateEntity { |
||||
|
||||
@ApiModelProperty("站点编码") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String stationCode; |
||||
|
||||
@ApiModelProperty("站点名称") |
||||
private String stationName; |
||||
|
||||
@ApiModelProperty("业务任务ID") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private Long taskId; |
||||
|
||||
@ApiModelProperty("消息模板ID") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private Long templateId; |
||||
|
||||
@ApiModelProperty("资源编码") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String resourceCode; |
||||
|
||||
@ApiModelProperty(value = "推送人") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
private String pusher; |
||||
|
||||
@ApiModelProperty(value = "推送账号:手机号,邮箱") |
||||
private String account; |
||||
|
||||
@ApiModelProperty(value = "推送人名称") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
private String pusherName; |
||||
|
||||
@ApiModelProperty(value = "内容") |
||||
private String content; |
||||
|
||||
@ApiModelProperty(value = "计划推送时间") |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
private LocalDateTime planTime; |
||||
|
||||
@ApiModelProperty(value = "实际推送时间") |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
private LocalDateTime pushTime; |
||||
|
||||
@ApiModelProperty(value = "响应时间") |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) |
||||
private LocalDateTime respondTime; |
||||
|
||||
@ApiModelProperty(value = "响应说明") |
||||
private String respondRemark; |
||||
|
||||
@ApiModelProperty("查询开始时间") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@TableField(exist = false) |
||||
private LocalDate startTime; |
||||
|
||||
@ApiModelProperty("查询结束时间") |
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATE) |
||||
@TableField(exist = false) |
||||
private LocalDate endTime; |
||||
|
||||
} |
@ -0,0 +1,59 @@
|
||||
package com.hnac.hzims.message.entity.config; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.support.QueryField; |
||||
import org.springblade.core.mp.support.SqlCondition; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@ApiModel("消息配置") |
||||
@TableName("hzims_message_template") |
||||
@EqualsAndHashCode(callSuper = false) |
||||
public class MessageTemplateEntity extends TenantEntity implements Serializable { |
||||
|
||||
@ApiModelProperty(value = "消息类型") |
||||
@NotNull(message = "消息类型不能为空") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String type; |
||||
|
||||
@ApiModelProperty(value = "业务分类。系统通知:system,事务消息:business,日常提醒:dailyRemind,巡检消息:inspect",required = true) |
||||
@NotNull(message = "业务分类不能为空") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String businessClassify; |
||||
|
||||
@ApiModelProperty(value = "业务关键字",required = true) |
||||
@NotNull(message = "业务关键字不能为空") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
private String businessKey; |
||||
|
||||
@ApiModelProperty(value = "主题",required = true) |
||||
@NotNull(message = "主题不能为空") |
||||
@QueryField(condition = SqlCondition.LIKE) |
||||
private String subject; |
||||
|
||||
@ApiModelProperty(value = "集中推送时长") |
||||
private Integer concentratedDuration; |
||||
|
||||
@ApiModelProperty(value = "集中推送单位") |
||||
private String concentratedTimeUnit; |
||||
|
||||
@ApiModelProperty(value = "提前推送时长") |
||||
private Integer advanceDuration; |
||||
|
||||
@ApiModelProperty(value = "提前推送单位") |
||||
@QueryField(condition = SqlCondition.EQUAL) |
||||
private String advanceTimeUnit; |
||||
|
||||
@TableField(exist = false) |
||||
@ApiModelProperty(value = "创建人名称") |
||||
private String creatorName; |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.message.enums; |
||||
|
||||
import lombok.Data; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 15:45 |
||||
*/ |
||||
public enum PushStatEnum { |
||||
|
||||
UNPUSHED(0, "未推送"), |
||||
|
||||
SUCCESS(1, "推送成功"), |
||||
FAIL(2, "推送失败"), |
||||
CONFIRMED(3, "已确认"); |
||||
|
||||
|
||||
@Setter |
||||
private Integer code; |
||||
|
||||
@Getter |
||||
private String value; |
||||
|
||||
PushStatEnum(Integer code, String value) { |
||||
this.code = code; |
||||
this.value = value; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 16:41 |
||||
*/ |
||||
@Data |
||||
public class BusinessTypeStatVo { |
||||
|
||||
/** |
||||
* 业务类型 |
||||
*/ |
||||
private String businessClassify; |
||||
|
||||
|
||||
/** |
||||
* 业务类型 名称 |
||||
*/ |
||||
private String businessClassifyName; |
||||
|
||||
/** |
||||
* 统计数量 |
||||
*/ |
||||
private Long power; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/8 11:58 |
||||
*/ |
||||
@Data |
||||
public class MessagePushRecordEntityVo { |
||||
|
||||
/** |
||||
* 站点编号 |
||||
*/ |
||||
private String stationCode; |
||||
|
||||
/** |
||||
* 月份 |
||||
*/ |
||||
private Integer month; |
||||
|
||||
|
||||
/** |
||||
* type |
||||
*/ |
||||
private String type; |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 14:41 |
||||
*/ |
||||
@Data |
||||
public class MessagePushRecordTypeVo { |
||||
|
||||
/** |
||||
* 消息类型 |
||||
*/ |
||||
private String type; |
||||
|
||||
private List<MessagePushRecordVo> messagePushRecordList; |
||||
} |
@ -0,0 +1,47 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
import java.time.YearMonth; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 9:02 |
||||
*/ |
||||
@Data |
||||
public class MessagePushRecordVo implements Serializable { |
||||
|
||||
|
||||
/** |
||||
* 年 |
||||
*/ |
||||
private Integer year; |
||||
|
||||
|
||||
/** |
||||
* 月份 |
||||
*/ |
||||
private Integer month; |
||||
|
||||
|
||||
/** |
||||
* 实现推送时间 |
||||
*/ |
||||
private YearMonth strMonth; |
||||
|
||||
|
||||
/** |
||||
* 消息类型 |
||||
*/ |
||||
private String type; |
||||
|
||||
/** |
||||
* 统计数量 |
||||
*/ |
||||
private Long power; |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 推送成功失败 Vo |
||||
* |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 15:35 |
||||
*/ |
||||
@Data |
||||
public class PushStatTypeVo { |
||||
|
||||
|
||||
/** |
||||
* 业务分类 |
||||
*/ |
||||
private String businessClassify; |
||||
|
||||
|
||||
/** |
||||
* 业务名称 |
||||
*/ |
||||
private String businessClassifyName; |
||||
|
||||
|
||||
/** |
||||
* 业务分类统计 |
||||
*/ |
||||
private List<PushStatVo> pushStatList; |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import com.hnac.hzims.message.enums.PushStatEnum; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 15:36 |
||||
*/ |
||||
@Data |
||||
public class PushStatVo { |
||||
|
||||
/** |
||||
* 业务分类 |
||||
*/ |
||||
private String businessClassify; |
||||
|
||||
|
||||
/** |
||||
* 业务分类 |
||||
*/ |
||||
private String businessClassifyName; |
||||
|
||||
|
||||
/** |
||||
* 状态 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 状态名称 |
||||
*/ |
||||
private String statusName; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 统计数量 |
||||
*/ |
||||
private Long power; |
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 15:05 |
||||
*/ |
||||
@Data |
||||
public class UserPushStatTypeVo { |
||||
|
||||
/** |
||||
* 推送人名称 |
||||
*/ |
||||
private String pusherName; |
||||
|
||||
/** |
||||
* 推送业务分类数组 |
||||
*/ |
||||
private List<UserPushStatVo> pushStatList; |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.hnac.hzims.message.vo.msgpushrecord; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/7 15:06 |
||||
*/ |
||||
@Data |
||||
public class UserPushStatVo { |
||||
|
||||
|
||||
/** |
||||
* 推送人名称 |
||||
*/ |
||||
private String pusherName; |
||||
|
||||
/** |
||||
* 业务分类 |
||||
*/ |
||||
private String businessClassify; |
||||
|
||||
|
||||
/** |
||||
* 业务分类 名称 |
||||
*/ |
||||
private String businessClassifyName; |
||||
|
||||
/** |
||||
* 统计数量 |
||||
*/ |
||||
private Long power; |
||||
} |
@ -1,117 +0,0 @@
|
||||
/* |
||||
* Copyright 2007-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
import java.net.*; |
||||
import java.io.*; |
||||
import java.nio.channels.*; |
||||
import java.util.Properties; |
||||
|
||||
public class MavenWrapperDownloader { |
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6"; |
||||
/** |
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. |
||||
*/ |
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" |
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; |
||||
|
||||
/** |
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to |
||||
* use instead of the default one. |
||||
*/ |
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = |
||||
".mvn/wrapper/maven-wrapper.properties"; |
||||
|
||||
/** |
||||
* Path where the maven-wrapper.jar will be saved to. |
||||
*/ |
||||
private static final String MAVEN_WRAPPER_JAR_PATH = |
||||
".mvn/wrapper/maven-wrapper.jar"; |
||||
|
||||
/** |
||||
* Name of the property which should be used to override the default download url for the wrapper. |
||||
*/ |
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; |
||||
|
||||
public static void main(String args[]) { |
||||
System.out.println("- Downloader started"); |
||||
File baseDirectory = new File(args[0]); |
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); |
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); |
||||
String url = DEFAULT_DOWNLOAD_URL; |
||||
if(mavenWrapperPropertyFile.exists()) { |
||||
FileInputStream mavenWrapperPropertyFileInputStream = null; |
||||
try { |
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); |
||||
Properties mavenWrapperProperties = new Properties(); |
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); |
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); |
||||
} catch (IOException e) { |
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); |
||||
} finally { |
||||
try { |
||||
if(mavenWrapperPropertyFileInputStream != null) { |
||||
mavenWrapperPropertyFileInputStream.close(); |
||||
} |
||||
} catch (IOException e) { |
||||
// Ignore ...
|
||||
} |
||||
} |
||||
} |
||||
System.out.println("- Downloading from: " + url); |
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); |
||||
if(!outputFile.getParentFile().exists()) { |
||||
if(!outputFile.getParentFile().mkdirs()) { |
||||
System.out.println( |
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); |
||||
} |
||||
} |
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); |
||||
try { |
||||
downloadFileFromURL(url, outputFile); |
||||
System.out.println("Done"); |
||||
System.exit(0); |
||||
} catch (Throwable e) { |
||||
System.out.println("- Error downloading"); |
||||
e.printStackTrace(); |
||||
System.exit(1); |
||||
} |
||||
} |
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception { |
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { |
||||
String username = System.getenv("MVNW_USERNAME"); |
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); |
||||
Authenticator.setDefault(new Authenticator() { |
||||
@Override |
||||
protected PasswordAuthentication getPasswordAuthentication() { |
||||
return new PasswordAuthentication(username, password); |
||||
} |
||||
}); |
||||
} |
||||
URL website = new URL(urlString); |
||||
ReadableByteChannel rbc; |
||||
rbc = Channels.newChannel(website.openStream()); |
||||
FileOutputStream fos = new FileOutputStream(destination); |
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); |
||||
fos.close(); |
||||
rbc.close(); |
||||
} |
||||
|
||||
} |
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip |
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue