站控初始版本提交
This commit is contained in:
parent
aefde7ee5f
commit
c422c4435e
38
.gitignore
vendored
38
.gitignore
vendored
@ -24,3 +24,41 @@
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
0
.idea/.gitignore
vendored
Normal file
0
.idea/.gitignore
vendored
Normal file
12
.idea/encodings.xml
Normal file
12
.idea/encodings.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
|
||||
<file url="file://$PROJECT_DIR$/commoms/core/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/commoms/mongodb/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/commoms/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/commoms/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="file://$PROJECT_DIR$/web-server/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
15
.idea/misc.xml
Normal file
15
.idea/misc.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?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$/web-server/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
368
.idea/workspace.xml
Normal file
368
.idea/workspace.xml
Normal file
@ -0,0 +1,368 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ec76006e-5a88-4766-9722-bc8eda172857" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="spring-beans.schema" />
|
||||
<option value="package-info" />
|
||||
<option value="Enum" />
|
||||
<option value="Interface" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="localRepository" value="D:\andy\apache-maven-3.6.3\repository" />
|
||||
<option name="userSettingsFile" value="D:\andy\apache-maven-3.6.3\conf\settings.xml" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MavenRunner">
|
||||
<option name="skipTests" value="true" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 1
|
||||
}</component>
|
||||
<component name="ProjectId" id="318SnCahpegtyFAWIj2TAVuoxuX" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Application.CloudSendInfoUtils.executor": "Debug",
|
||||
"Application.DataUtils.executor": "Debug",
|
||||
"Application.Group.executor": "Run",
|
||||
"Application.InstructionSendInfoUtils.executor": "Run",
|
||||
"Application.TestController.executor": "Run",
|
||||
"Application.XmlRpcHttpDirectCall.executor": "Run",
|
||||
"Application.test111.executor": "Run",
|
||||
"Maven.commoms [clean].executor": "Run",
|
||||
"Maven.commoms [package].executor": "Run",
|
||||
"Maven.core [clean].executor": "Run",
|
||||
"Maven.core [install].executor": "Run",
|
||||
"Maven.core [package].executor": "Run",
|
||||
"Maven.station_control [clean,install,-U].executor": "Run",
|
||||
"Maven.station_control [clean].executor": "Run",
|
||||
"Maven.station_control [dependency:resolve,-U].executor": "Run",
|
||||
"Maven.station_control [dependency:tree].executor": "Run",
|
||||
"Maven.station_control [install].executor": "Run",
|
||||
"Maven.station_control [package].executor": "Run",
|
||||
"Maven.station_control [tree].executor": "Run",
|
||||
"Maven.web-server [clean,install,-U].executor": "Run",
|
||||
"Maven.web-server [clean].executor": "Run",
|
||||
"Maven.web-server [compile].executor": "Run",
|
||||
"Maven.web-server [dependency:resolve,-U].executor": "Run",
|
||||
"Maven.web-server [package].executor": "Run",
|
||||
"RequestMappingsPanelOrder0": "0",
|
||||
"RequestMappingsPanelOrder1": "1",
|
||||
"RequestMappingsPanelWidth0": "75",
|
||||
"RequestMappingsPanelWidth1": "75",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"Spring Boot.WebServerApplication.executor": "Debug",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/andy/ideaWorker/my/station-control/web-server/src/main/resources",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"project.structure.last.edited": "Project",
|
||||
"project.structure.proportion": "0.15",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
"settings.editor.selected.configurable": "fileTemplates",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
<component name="ReactorSettings">
|
||||
<option name="notificationShown" value="true" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\web-server\src\main\resources" />
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\web-server\src\main\resources\mapper" />
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\commoms\mongodb\src\main\resources" />
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\web-server\src\main\java\com\evotech\hd\webserver\config\swagger" />
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\web-server\src\main\java\com\evotech\hd\webserver" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="D:\andy\ideaWorker\my\station-control\web-server\src\main\resources" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="com.evotech.hd.webserver.config.mqtt" />
|
||||
<recent name="com.evotech.hd.webserver.job.service" />
|
||||
<recent name="com.evotech.hd.exception" />
|
||||
<recent name="com.evotech.hd.webserver.config.handler" />
|
||||
<recent name="com.evotech.hd.core.dtos.system" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunAnythingCache">
|
||||
<option name="myCommands">
|
||||
<command value="mvn tree" />
|
||||
<command value="mvn dependency:tree" />
|
||||
<command value="mvn dependency:resolve -U" />
|
||||
<command value="mvn clean install -U" />
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager" selected="Spring Boot.WebServerApplication">
|
||||
<configuration name="CloudSendInfoUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.evotech.hd.webserver.utils.sendCloud.CloudSendInfoUtils" />
|
||||
<module name="web-server" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.evotech.hd.webserver.utils.sendCloud.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="DataUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.evotech.hd.utils.DataUtils" />
|
||||
<module name="core" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.evotech.hd.utils.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="TestController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.evotech.hd.webserver.controller.TestController" />
|
||||
<module name="web-server" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.evotech.hd.webserver.controller.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="XmlRpcHttpDirectCall" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.evotech.hd.webserver.utils.instruction.XmlRpcHttpDirectCall" />
|
||||
<module name="web-server" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.evotech.hd.webserver.utils.instruction.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="test111" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.evotech.hd.webserver.utils.instruction.test111" />
|
||||
<module name="web-server" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.evotech.hd.webserver.utils.instruction.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="WebServerApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<envs>
|
||||
<env name="--profiles.active" value="dev" />
|
||||
</envs>
|
||||
<module name="web-server" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.evotech.hd.webserver.WebServerApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="WebServerApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<module name="web-server" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.evotech.hd.webserver.WebServerApplication" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="Application.CloudSendInfoUtils" />
|
||||
<item itemvalue="Application.DataUtils" />
|
||||
<item itemvalue="Application.test111" />
|
||||
<item itemvalue="Application.TestController" />
|
||||
<item itemvalue="Application.XmlRpcHttpDirectCall" />
|
||||
<item itemvalue="Spring Boot.WebServerApplication" />
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.TestController" />
|
||||
<item itemvalue="Application.CloudSendInfoUtils" />
|
||||
<item itemvalue="Application.XmlRpcHttpDirectCall" />
|
||||
<item itemvalue="Application.test111" />
|
||||
<item itemvalue="Application.DataUtils" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-jdk-9823dce3aa75-a94e463ab2e7-intellij.indexing.shared.core-IU-243.26053.27" />
|
||||
<option value="bundled-js-predefined-d6986cc7102b-1632447f56bf-JavaScript-IU-243.26053.27" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="StructureViewState">
|
||||
<option name="selectedTab" value="Logical" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="ec76006e-5a88-4766-9722-bc8eda172857" name="Changes" comment="" />
|
||||
<created>1754904370788</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1754904370788</updated>
|
||||
<workItem from="1754904371877" duration="743000" />
|
||||
<workItem from="1754958488060" duration="16363000" />
|
||||
<workItem from="1754979455501" duration="11053000" />
|
||||
<workItem from="1755045648553" duration="11852000" />
|
||||
<workItem from="1755136900591" duration="1234000" />
|
||||
<workItem from="1755235227207" duration="5615000" />
|
||||
<workItem from="1755308346989" duration="5067000" />
|
||||
<workItem from="1755477815911" duration="26051000" />
|
||||
<workItem from="1755563670044" duration="23930000" />
|
||||
<workItem from="1755597577227" duration="1185000" />
|
||||
<workItem from="1755650246466" duration="18182000" />
|
||||
<workItem from="1755736651882" duration="28457000" />
|
||||
<workItem from="1755823071440" duration="22965000" />
|
||||
<workItem from="1755910155093" duration="26584000" />
|
||||
<workItem from="1756081786182" duration="17422000" />
|
||||
<workItem from="1756168461482" duration="24825000" />
|
||||
<workItem from="1756255183228" duration="23220000" />
|
||||
<workItem from="1756341473821" duration="14384000" />
|
||||
<workItem from="1756362011482" duration="9363000" />
|
||||
<workItem from="1756515516454" duration="16460000" />
|
||||
<workItem from="1756687082458" duration="19618000" />
|
||||
<workItem from="1756773270517" duration="12348000" />
|
||||
<workItem from="1756860225586" duration="27149000" />
|
||||
<workItem from="1756946534886" duration="20640000" />
|
||||
<workItem from="1756976394856" duration="2350000" />
|
||||
<workItem from="1757032265599" duration="27359000" />
|
||||
<workItem from="1757119580657" duration="11710000" />
|
||||
<workItem from="1757151799688" duration="77000" />
|
||||
<workItem from="1757379021354" duration="14865000" />
|
||||
<workItem from="1757465487181" duration="17140000" />
|
||||
<workItem from="1757551115764" duration="17826000" />
|
||||
<workItem from="1757724335622" duration="16199000" />
|
||||
<workItem from="1757901997554" duration="16546000" />
|
||||
<workItem from="1757982208104" duration="18591000" />
|
||||
<workItem from="1758068903134" duration="22927000" />
|
||||
<workItem from="1758158708232" duration="15977000" />
|
||||
<workItem from="1758243284991" duration="6209000" />
|
||||
<workItem from="1758327544918" duration="9266000" />
|
||||
<workItem from="1758338426789" duration="6411000" />
|
||||
<workItem from="1758348257881" duration="375000" />
|
||||
<workItem from="1758348645502" duration="10565000" />
|
||||
<workItem from="1758501626389" duration="16505000" />
|
||||
<workItem from="1758587688210" duration="21173000" />
|
||||
<workItem from="1758673603744" duration="24606000" />
|
||||
<workItem from="1758760764341" duration="18449000" />
|
||||
<workItem from="1758846799089" duration="18706000" />
|
||||
<workItem from="1758933115452" duration="20073000" />
|
||||
<workItem from="1759019658026" duration="17797000" />
|
||||
<workItem from="1759106275218" duration="22020000" />
|
||||
<workItem from="1759192995088" duration="21426000" />
|
||||
<workItem from="1759796490468" duration="27481000" />
|
||||
<workItem from="1759883643456" duration="22264000" />
|
||||
<workItem from="1759970776795" duration="22551000" />
|
||||
<workItem from="1760013212841" duration="2414000" />
|
||||
<workItem from="1760023024542" duration="4000" />
|
||||
<workItem from="1760056570341" duration="10242000" />
|
||||
<workItem from="1760104385703" duration="1106000" />
|
||||
<workItem from="1760143937394" duration="9209000" />
|
||||
<workItem from="1760332317876" duration="8751000" />
|
||||
<workItem from="1760401860542" duration="21454000" />
|
||||
<workItem from="1760489068815" duration="15159000" />
|
||||
<workItem from="1760576368283" duration="7198000" />
|
||||
<workItem from="1760663498023" duration="11189000" />
|
||||
<workItem from="1760747534139" duration="14528000" />
|
||||
<workItem from="1760864303786" duration="5000" />
|
||||
<workItem from="1760864323204" duration="1740000" />
|
||||
<workItem from="1760920858919" duration="13998000" />
|
||||
<workItem from="1761007457205" duration="10276000" />
|
||||
<workItem from="1761093067491" duration="22018000" />
|
||||
<workItem from="1761120452479" duration="3461000" />
|
||||
<workItem from="1761179546969" duration="25861000" />
|
||||
<workItem from="1761266125784" duration="24575000" />
|
||||
<workItem from="1761352436825" duration="20894000" />
|
||||
<workItem from="1761388932742" duration="713000" />
|
||||
<workItem from="1761524984426" duration="23594000" />
|
||||
<workItem from="1761567062796" duration="548000" />
|
||||
<workItem from="1761616200781" duration="5646000" />
|
||||
<workItem from="1761697745414" duration="16933000" />
|
||||
<workItem from="1761784288639" duration="4690000" />
|
||||
<workItem from="1761870857623" duration="8073000" />
|
||||
<workItem from="1761957222294" duration="13504000" />
|
||||
<workItem from="1762130388136" duration="15743000" />
|
||||
<workItem from="1762216180044" duration="23720000" />
|
||||
<workItem from="1762304995435" duration="13388000" />
|
||||
<workItem from="1762326412021" duration="4646000" />
|
||||
<workItem from="1762331368235" duration="526000" />
|
||||
<workItem from="1762332202006" duration="3610000" />
|
||||
<workItem from="1762389342226" duration="1678000" />
|
||||
<workItem from="1762391419017" duration="10099000" />
|
||||
<workItem from="1762475748028" duration="14681000" />
|
||||
<workItem from="1762562011294" duration="2069000" />
|
||||
<workItem from="1762735090118" duration="49875000" />
|
||||
<workItem from="1762907743242" duration="11427000" />
|
||||
<workItem from="1762994586393" duration="15377000" />
|
||||
<workItem from="1763080099094" duration="13000" />
|
||||
<workItem from="1763080575492" duration="35017000" />
|
||||
<workItem from="1763215858078" duration="590000" />
|
||||
<workItem from="1763279712045" duration="12969000" />
|
||||
<workItem from="1763425849123" duration="12906000" />
|
||||
<workItem from="1763524012800" duration="6829000" />
|
||||
<workItem from="1763599473111" duration="5976000" />
|
||||
<workItem from="1763642224714" duration="1319000" />
|
||||
<workItem from="1763685339681" duration="33967000" />
|
||||
<workItem from="1763944462582" duration="13255000" />
|
||||
<workItem from="1763978445210" duration="7894000" />
|
||||
<workItem from="1764121236140" duration="3198000" />
|
||||
<workItem from="1764290191065" duration="19377000" />
|
||||
<workItem from="1764379078325" duration="20655000" />
|
||||
<workItem from="1764549562892" duration="24031000" />
|
||||
<workItem from="1764635379196" duration="19521000" />
|
||||
<workItem from="1764722270770" duration="13305000" />
|
||||
<workItem from="1764895045816" duration="8587000" />
|
||||
<workItem from="1764981749573" duration="15080000" />
|
||||
<workItem from="1765154508002" duration="107521000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<watches-manager>
|
||||
<configuration name="SpringBootApplicationConfigurationType">
|
||||
<watch expression="import com.evotech.hd.entity.system.Params; " />
|
||||
<watch expression=" @Override public Boolean addOrderSwapBatteryStepBySwapComplete(Integer orderId, Integer step, Date stepTime, String humanOperation) { BatterySwapStep orderSwapBatteryStep = getOne(new LambdaQueryWrapper<BatterySwapStep>().eq(BatterySwapStep::getOrderId, orderId).eq(BatterySwapStep::getStep,step)); if(ObjectUtils.isEmpty(orderSwapBatteryStep)){ orderSwapBatteryStep = new BatterySwapStep(); } orderSwapBatteryStep.setOrderId(orderId); orderSwapBatteryStep.setStep(step); orderSwapBatteryStep.setStepTime(stepTime); orderSwapBatteryStep.setHumanOperation(humanOperation); if(orderSwapBatteryStep.getId() == null){ return save(orderSwapBatteryStep); }else{ return updateById(orderSwapBatteryStep); } } @Override public List<BatterySwapStepDTO> findListByOrderId(Integer orderId) { List<BatterySwapStepDTO> list = getBaseMapper().findListByOrderId(orderId); if(Collections.isNotEmpty(list)){ list.forEach(data ->{ data.setStepName(SwapBatteryStepEnum.getName(data.getStep())); }); } return list;" />
|
||||
<watch expression="errorCheck(rgvNo, category, runNun);" />
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
</project>
|
||||
59
commoms/core/pom.xml
Normal file
59
commoms/core/pom.xml
Normal file
@ -0,0 +1,59 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>commoms</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>core</name>
|
||||
<description>core</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.38</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>1.4.2.Final</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>1.4.2.Final</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.14.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -0,0 +1,24 @@
|
||||
package com.evotech.hd.core.converter;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* ObjectToStringDeserializer
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:ObjectToStringDeserializer
|
||||
* @date: 2025年10月25日 8:50
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
public class ObjectToStringDeserializer extends JsonDeserializer<String> {
|
||||
@Override
|
||||
public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
// 将 JSON 对象转为字符串(如 {"key":"value"} → "{\"key\":\"value\"}")
|
||||
return p.readValueAsTree().toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.evotech.hd.core.converter.ObjectToStringDeserializer;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.ALWAYS)
|
||||
public abstract class BaseDTO<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 实体主键
|
||||
*/
|
||||
@ApiModelProperty("唯一标识")
|
||||
private Integer id;
|
||||
@ApiModelProperty("name")
|
||||
@Query(javaField = "name", tableColumn = "a.name", type = QueryType.LIKE)
|
||||
String name;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@TableField(typeHandler = JacksonTypeHandler.class, jdbcType = JdbcType.OTHER)
|
||||
@JsonDeserialize(using = ObjectToStringDeserializer.class)
|
||||
private String extendeds;
|
||||
|
||||
|
||||
public Map<String, Object> getExtendeds() {
|
||||
if(StringUtils.isNotEmpty(extendeds)){
|
||||
try {
|
||||
// ObjectMapper 是 Jackson 库的核心类,用于处理 JSON 数据的序列化和反序列化。它提供了多种方法来将 Java 对象转换为 JSON 字符串,以及将 JSON 字符串转换为 Java 对象
|
||||
// 使用 Jackson 库将 JSON 字符串反序列化为 Map<String, Object> 类型的代码
|
||||
return new ObjectMapper().readValue(extendeds, Map.class);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to parse JSON", e);
|
||||
}
|
||||
}
|
||||
return new LinkedHashMap<>();
|
||||
}
|
||||
public void setParams(Map<String, Object> params) {
|
||||
if (params == null) {
|
||||
this.extendeds = null;
|
||||
} else {
|
||||
try {
|
||||
// 将 params(一个 Map 类型的对象)转换为 JSON 格式的字符串,并将其存储在 paramsJson 字段中
|
||||
this.extendeds = new ObjectMapper().writeValueAsString(params);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to serialize JSON", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public BaseDTO() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public BaseDTO(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("登录对象")
|
||||
@Data
|
||||
public class LoginForm {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty("密码")
|
||||
private String password;
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import com.evotech.hd.core.enums.BaseEnum;
|
||||
import com.evotech.hd.utils.Collections;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 下拉菜单 模版 类
|
||||
*
|
||||
* @ClassName:OptionDTO
|
||||
* @date: 2025年09月17日 9:23
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("下拉菜单模版")
|
||||
public class OptionDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty("下拉菜单name")
|
||||
String label;
|
||||
|
||||
@ApiModelProperty("下拉菜单value")
|
||||
String value;
|
||||
|
||||
List<OptionDTO> childList = Collections.emptyList();
|
||||
|
||||
public OptionDTO() {
|
||||
}
|
||||
|
||||
public OptionDTO(String label, String value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public OptionDTO(BaseEnum baseEnum) {
|
||||
this.label = String.valueOf(baseEnum.getLabel());
|
||||
this.value = String.valueOf(baseEnum.getValue());
|
||||
}
|
||||
|
||||
public OptionDTO(BaseEntity baseEntity) {
|
||||
this.label = baseEntity.getName();
|
||||
this.value = baseEntity.getKey();
|
||||
}
|
||||
|
||||
public static List<OptionDTO> getOptionDTOList(Map<String, String> params) {
|
||||
List<OptionDTO> optionList = Collections.emptyList();
|
||||
Iterator<Map.Entry<String, String>> paramsIt = params.entrySet().iterator();
|
||||
while (paramsIt.hasNext()){
|
||||
Map.Entry<String, String> entry = paramsIt.next();
|
||||
optionList.add(new OptionDTO(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
return optionList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:PageDTO
|
||||
* @date: 2025年08月20日 15:01
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("分页工具类")
|
||||
public class PageDTO {
|
||||
|
||||
@ApiModelProperty("当前页")
|
||||
Integer page;
|
||||
@ApiModelProperty("每页显示的条数")
|
||||
Integer pageSize;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:ParamMeta
|
||||
* @date: 2025年09月18日 13:38
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("MAP类型数据返回")
|
||||
public class ParamMeta<T> {
|
||||
@ApiModelProperty("Map的key")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty("特殊参数对象")
|
||||
private T value;
|
||||
|
||||
public ParamMeta() {
|
||||
}
|
||||
|
||||
public ParamMeta(String key, T value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:Params
|
||||
* @date: 2025年09月04日 15:37
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("请求接口参数")
|
||||
public class RequestParams<T>{
|
||||
@ApiModelProperty("请求条件")
|
||||
T params;
|
||||
@ApiModelProperty("分页")
|
||||
PageDTO page;
|
||||
}
|
||||
135
commoms/core/src/main/java/com/evotech/hd/core/dtos/Result.java
Normal file
135
commoms/core/src/main/java/com/evotech/hd/core/dtos/Result.java
Normal file
@ -0,0 +1,135 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.evotech.hd.core.enums.CodeMsg;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 请求返回对象
|
||||
* @ClassName:BaseResponse
|
||||
* @date: 2025年04月15日 16:37
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
@ApiModelProperty("请求处理状态")
|
||||
private Integer status;
|
||||
@ApiModelProperty("状态码")
|
||||
private String code;
|
||||
@ApiModelProperty("返回消息")
|
||||
private String msg;
|
||||
@ApiModelProperty(value = "返回数据", required = true)
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> getInstance(){
|
||||
return new Result<T>();
|
||||
}
|
||||
|
||||
public Result() {
|
||||
}
|
||||
|
||||
public <T> Result<T> build(Class<T> cls) {
|
||||
return (Result<T>) this;
|
||||
}
|
||||
public <T> Result<List<T>> buildList(Class<T> cls) {
|
||||
return (Result<List<T>>) this;
|
||||
}
|
||||
|
||||
public <T> Result<IPage<T>> buildIPage(Class<T> cls) {
|
||||
return (Result<IPage<T>>) this;
|
||||
}
|
||||
|
||||
public <T> Result<Map<String, T>> buildMap(Class<T> cls) {
|
||||
return (Result<Map<String, T>>) this;
|
||||
}
|
||||
|
||||
public <T> Result<Map<String, List<T>>> buildMap(List<T> cls) {
|
||||
return (Result<Map<String, List<T>>>) this;
|
||||
}
|
||||
|
||||
public Result<T> success() {
|
||||
this.status = 1;
|
||||
this.code = CodeMsg.SUCCESS.getCode();
|
||||
this.msg = CodeMsg.SUCCESS.getMsg();
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> success(T o) {
|
||||
this.status = 1;
|
||||
this.code = CodeMsg.SUCCESS.getCode();
|
||||
this.msg = CodeMsg.SUCCESS.getMsg();
|
||||
this.data = o;
|
||||
return this;
|
||||
}
|
||||
public Result<T> success(T o, String msg) {
|
||||
this.status = 1;
|
||||
this.code = CodeMsg.SUCCESS.getCode();
|
||||
this.msg = msg;
|
||||
this.data = o;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> error(String errMsg) {
|
||||
this.status = 1;
|
||||
this.code = CodeMsg.ERROR.getCode();
|
||||
this.msg = errMsg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> error(String errMsg, T data) {
|
||||
this.status = 1;
|
||||
this.code = CodeMsg.ERROR.getCode();
|
||||
this.msg = errMsg;
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> error(String code, String errMsg) {
|
||||
this.status = 1;
|
||||
this.code = code;
|
||||
this.msg = errMsg;
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> error(CodeMsg codeMsg) {
|
||||
this.status = 1;
|
||||
this.code = codeMsg.getCode();
|
||||
this.msg = codeMsg.getMsg();
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> error(CodeMsg codeMsg, String errorMsg) {
|
||||
this.status = 1;
|
||||
this.code = codeMsg.getCode();
|
||||
this.msg = errorMsg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> exception(T data) {
|
||||
this.status = -1;
|
||||
this.code = CodeMsg.ERROR.getCode();
|
||||
this.msg = CodeMsg.ERROR.getMsg();
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result<T> businessException(String code, String msg, T o) {
|
||||
this.status = -1;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = o;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
import com.evotech.hd.core.enums.CodeMsg;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 请求相应工具类
|
||||
* @ClassName:ResponseUtil
|
||||
* @date: 2025年04月22日 16:38
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class ResultUtil {
|
||||
|
||||
|
||||
public static <T> T getValue(Result<T> result){
|
||||
if(verifyCode(result)){
|
||||
return result.getData();
|
||||
}
|
||||
log.error("当前请求出现异常{}", result.getMsg());
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> Boolean verifyCode(Result<T> result){
|
||||
return CodeMsg.SUCCESS.getCode().equals(result.getCode());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Copyright © 2021-2026 space All rights reserved.
|
||||
*/
|
||||
package com.evotech.hd.core.dtos;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户Entity
|
||||
*
|
||||
* @author space
|
||||
* @version 2021-09-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserDTO extends BaseDTO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer gitUserId;
|
||||
|
||||
private String loginName;
|
||||
|
||||
private String loginFlag;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
|
||||
private String password;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
|
||||
|
||||
public UserDTO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public UserDTO(Integer id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 存储策略类
|
||||
*
|
||||
* @ClassName:AccessStrategy
|
||||
* @date: 2025年08月27日 15:59
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("存储策略类")
|
||||
public class AccessStrategyDTO extends BaseDTO<AccessStrategyDTO> {
|
||||
|
||||
@ApiModelProperty("存取策略: 1.存取相同, 2 顺序存续. 3间隔存储 4 随机存储")
|
||||
Integer strategy;
|
||||
/***
|
||||
* 电源策略
|
||||
*/
|
||||
@ApiModelProperty("电源策略")
|
||||
Integer powerStrategy;
|
||||
// /***
|
||||
// * 充电策略 1 即存即充, 2 按计划存储
|
||||
// */
|
||||
// @ApiModelProperty("充电策略")
|
||||
// Integer chargingStrategy;
|
||||
// /***
|
||||
// *即存即充功率
|
||||
// */
|
||||
@ApiModelProperty("即存即充功率")
|
||||
Integer instantChargePower;
|
||||
|
||||
@ApiModelProperty("最低安全库存")
|
||||
Integer minimumSafetyStock;
|
||||
|
||||
@ApiModelProperty("最低换电SOC")
|
||||
Integer lowestBatterySwapSoc;
|
||||
|
||||
@ApiModelProperty("充满界定soc")
|
||||
Integer fullOfLimitSoc;
|
||||
|
||||
@ApiModelProperty("生效的Rgv编号")
|
||||
String effectiveRgvNo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "数据是否有效: valid有效 invalid 无效", hidden = true)
|
||||
String valid;
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:Test
|
||||
* @date: 2025年09月19日 17:06
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
@ApiModel("电池仓详情")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.ALWAYS)
|
||||
public class BatteryCompartmentDTO extends BaseDTO<BatteryCompartmentDTO> {
|
||||
|
||||
@ApiModelProperty("电池仓编号")
|
||||
String batteryCompartmentNo;
|
||||
|
||||
@ApiModelProperty("电池仓状态:1-正常,2-检修, 3-坏")
|
||||
Integer status;
|
||||
|
||||
@ApiModelProperty("运行状态:1正常, 2-禁用")
|
||||
Integer state;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
Integer sort;
|
||||
|
||||
@ApiModelProperty("是否存在电池")
|
||||
Boolean existsBattery;
|
||||
|
||||
@ApiModelProperty("充电机状态, 0:空闲; 1:监控状态; 2:单功率充电; 3:双功率充电;4:辅助充电;5:调试状态;6:设备错误状态")
|
||||
Integer chargerStatus;
|
||||
|
||||
@ApiModelProperty("电池到位信号, 0 无电池 1电池正常 2, 电池错误")
|
||||
String batteryPlaceStatus;
|
||||
|
||||
@ApiModelProperty("电池通信状态")
|
||||
String batteryCommunicationStatus;
|
||||
|
||||
@ApiModelProperty("直流电表通信状态")
|
||||
String directCurrentCommunicationStatus;
|
||||
|
||||
@ApiModelProperty("电池低压电源状态")
|
||||
String lowPressurePowerSupplyStatus;
|
||||
|
||||
@ApiModelProperty("辅助电源状态")
|
||||
String auxiliaryPowerSupplyStatus;
|
||||
|
||||
@ApiModelProperty("最大充电功率")
|
||||
String maximumChargingPower;
|
||||
|
||||
@ApiModelProperty("直流电表压 (KW/H) 忘记是啥了, 到时候在说")
|
||||
String directCurrentMeterVoltage;
|
||||
|
||||
@ApiModelProperty("电池存入时间")
|
||||
Date depositTime;
|
||||
|
||||
@ApiModelProperty("电池信息")
|
||||
BatteryDTO battery;
|
||||
|
||||
@ApiModelProperty(value = "反向记录充电订单Id, 用于刷新数据",hidden = true)
|
||||
Integer orderChargingId;
|
||||
|
||||
@ApiModelProperty(value = "是否全功率充电",hidden = true)
|
||||
Boolean allPower;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 电池信息类
|
||||
*
|
||||
* @ClassName:Battery
|
||||
* @date: 2025年08月18日 12:00
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("电池信息类")
|
||||
@JsonInclude(JsonInclude.Include.ALWAYS)
|
||||
public class BatteryDTO extends BaseDTO<BatteryDTO> {
|
||||
|
||||
@ApiModelProperty("电池编号")
|
||||
private String batteryCode;
|
||||
|
||||
@ApiModelProperty("电池类型")
|
||||
String batteryType;
|
||||
|
||||
@ApiModelProperty("电池模式; 0:未上电;1:监控模式;2:充电初始化;3:单功充电;4:双功充电;5:暂停充电;6:停止充电;7:充电故障;8:充电错误")
|
||||
String batteryMode;
|
||||
|
||||
@ApiModelProperty("电池仓Id")
|
||||
Integer batteryCompartmentId;
|
||||
|
||||
@ApiModelProperty("电池状态在仓状态, 1在仓 0 离仓")
|
||||
Integer storageStatus;
|
||||
|
||||
@ApiModelProperty("电池健康度")
|
||||
String soh;
|
||||
|
||||
@ApiModelProperty("电池额定容量")
|
||||
String ratedCapacity;
|
||||
|
||||
|
||||
@ApiModelProperty("电池单体数量")
|
||||
Integer monomerQuantity;
|
||||
|
||||
@ApiModelProperty("探针数量")
|
||||
Integer numberOfProbes;
|
||||
|
||||
@ApiModelProperty("电池电量")
|
||||
String soc;
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 充电策略
|
||||
*
|
||||
* @ClassName:BatteryStrategyDTO
|
||||
* @date: 2025年09月27日 15:59
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("充电策略")
|
||||
public class BatteryStrategyDTO extends BaseDTO<AccessStrategyDTO> {
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String beginTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("充电功率")
|
||||
private Integer chargingPower;
|
||||
|
||||
@ApiModelProperty("删除标记")
|
||||
private Boolean del;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 换电步骤表类
|
||||
* @ClassName:BatterySwapStep
|
||||
* @date: 2025年08月18日 10:10
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("换电步骤表类")
|
||||
public class BatterySwapStepDTO extends BaseDTO<BatterySwapStepDTO> {
|
||||
|
||||
/***
|
||||
* 订单Id
|
||||
*/
|
||||
@ApiModelProperty(value = "订单Id", hidden = true)
|
||||
Integer orderId;
|
||||
/***
|
||||
* 换电步骤
|
||||
*/
|
||||
@ApiModelProperty(value = "换电步骤")
|
||||
Integer step;
|
||||
@ApiModelProperty(value = "换电步骤名称")
|
||||
String stepName;
|
||||
/***
|
||||
* 换电时间
|
||||
*/
|
||||
@ApiModelProperty(value = "换电时间")
|
||||
Date stepTime;
|
||||
/***
|
||||
* 是否人为操作
|
||||
*/
|
||||
@ApiModelProperty(value = "是否人为操作")
|
||||
String humanOperation;
|
||||
//是否出现错误
|
||||
@ApiModelProperty(value = "是否出现错误")
|
||||
Boolean error;
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 首页电池信息类
|
||||
*
|
||||
* @ClassName:HomeCompartmentDTO
|
||||
* @date: 2025年08月22日 11:43
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("首页电池仓信息")
|
||||
public class HomeCompartmentDTO extends BaseDTO<HomeCompartmentDTO> {
|
||||
|
||||
@ApiModelProperty("总电池仓位数")
|
||||
Integer totalNum;
|
||||
|
||||
@ApiModelProperty("空闲仓位数")
|
||||
Integer idleNum;
|
||||
|
||||
@ApiModelProperty("可用仓位数")
|
||||
Integer fullyChargedNum;
|
||||
|
||||
@ApiModelProperty("充电中的仓位数")
|
||||
Integer chargingNum;
|
||||
|
||||
@ApiModelProperty("损坏仓位数")
|
||||
Integer damagedNum;
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 充电订单
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:OrderCharging
|
||||
* @date: 2025年09月30日 14:21
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("充电订单")
|
||||
public class OrderChargingDTO extends BaseDTO<OrderChargingDTO> {
|
||||
|
||||
@ApiModelProperty("充电单号")
|
||||
String chargingNo;
|
||||
|
||||
@ApiModelProperty("电池编号")
|
||||
String batteryCode;
|
||||
|
||||
@ApiModelProperty("电池仓Id")
|
||||
Integer batteryCompartmentId;
|
||||
|
||||
@ApiModelProperty("策略信息")
|
||||
String strategyInfo;
|
||||
|
||||
@ApiModelProperty("充电状态 1:充电结束 2 充电中")
|
||||
Integer status;
|
||||
|
||||
@ApiModelProperty("耗电量;如果soc的话为soc")
|
||||
Integer powerConsumption;
|
||||
|
||||
@ApiModelProperty("开始电量; 如果soc的话为开始soc")
|
||||
Integer startElectric;
|
||||
|
||||
@ApiModelProperty("结束电量; 如果soc的话为开始soc")
|
||||
Integer endElectric;
|
||||
|
||||
@ApiModelProperty("充电开始时间")
|
||||
Date beginTime;
|
||||
|
||||
@ApiModelProperty("充电结束时间")
|
||||
Date endTime;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 预约订单类
|
||||
* @ClassName:OrderReservationDTO
|
||||
* @date: 2025年08月18日 11:00
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("预约订单类")
|
||||
public class OrderReservationDTO extends BaseDTO<OrderReservationDTO> {
|
||||
@ApiModelProperty("数据来源")
|
||||
String source;
|
||||
|
||||
@ApiModelProperty(value = "云平台预约Id", hidden = true)
|
||||
Integer cloudReservationId;
|
||||
|
||||
@ApiModelProperty("预约人姓名")
|
||||
String reservationName;
|
||||
|
||||
@ApiModelProperty("预约人电话")
|
||||
String reservationPhone;
|
||||
|
||||
@ApiModelProperty("车牌号")
|
||||
String plateNum;
|
||||
|
||||
@ApiModelProperty(value = "微信预约人Id", hidden = true)
|
||||
String wechatUserId;
|
||||
|
||||
@ApiModelProperty(value = "微信预约人姓名")
|
||||
String wechatUserName;
|
||||
|
||||
@ApiModelProperty(value = "预约时间")
|
||||
Date reservationTime;
|
||||
|
||||
@ApiModelProperty(value = "预约换电日期")
|
||||
String swapDay;
|
||||
|
||||
@ApiModelProperty(value = "预约换电时间段")
|
||||
String swapDuration;
|
||||
|
||||
@ApiModelProperty(value = "状态:1-预约成功,2-到店使用,3-取消,4-过期")
|
||||
Integer status;
|
||||
|
||||
// @ApiModelProperty(value = "推送状态:1-成功, 2-失败")
|
||||
// Integer pushStatus; 预约单是特殊的订单, 需要验证云平台是否成功, 所以不存在说推送失败的情况
|
||||
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.utils.Collections;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 换电订单表
|
||||
* @ClassName:OrderSwap
|
||||
* @date: 2025年08月18日 11:11
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("换电订单类")
|
||||
public class OrderSwapDTO extends BaseDTO<OrderSwapDTO> {
|
||||
|
||||
@ApiModelProperty(value = "云平台订单id", hidden = true)
|
||||
Integer cloudOrderId;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "预约人微信Id", hidden = true)
|
||||
String preWechatId;
|
||||
|
||||
@ApiModelProperty(value = "预约订单Id", hidden = true)
|
||||
String orderPreId;
|
||||
|
||||
@ApiModelProperty(value = "预约用户名称")
|
||||
String orderPreName;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
String orderType;
|
||||
|
||||
@ApiModelProperty(value = "车牌号")
|
||||
String plateNum;
|
||||
|
||||
@ApiModelProperty(value = "订单时间")
|
||||
Date orderTime;
|
||||
|
||||
@ApiModelProperty(value = "订单总金额 (分)")
|
||||
Integer orderAmount;
|
||||
|
||||
@ApiModelProperty(value = "订单状态:1-已创建,2-换电中,3-换电完成,4-充电中,5-充电完成,6-待结算,7-已完成,9-已取消")
|
||||
Integer status;
|
||||
|
||||
@ApiModelProperty(value = "支付方式 1余额, 2微信, 3支付宝")
|
||||
String payType;
|
||||
|
||||
@ApiModelProperty(value = "支付状态")
|
||||
String payStatus;
|
||||
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
Date payTime;
|
||||
|
||||
@ApiModelProperty(value = "计算费用方式:1-ODO,2-SOC,3-按电量")
|
||||
String feeType;
|
||||
|
||||
@ApiModelProperty(value = "订单金额 (分)")
|
||||
Integer orderFee;
|
||||
|
||||
@ApiModelProperty(value = "服务金额 (分)")
|
||||
Integer serviceFee;
|
||||
|
||||
@ApiModelProperty(value = "服务开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
Date serviceTimeBegin;
|
||||
|
||||
@ApiModelProperty(value = "服务结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
Date serviceTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "消耗电量;如果是soc结算 则是soc的差值")
|
||||
String electricityQuantity;
|
||||
|
||||
@ApiModelProperty(value = "租借电池包仓位")
|
||||
String rentBatNo;
|
||||
|
||||
@ApiModelProperty(value = "租用电池包编码")
|
||||
String rentBatCode;
|
||||
|
||||
@ApiModelProperty(value = "租用电池包SOC")
|
||||
String rentBatSoc;
|
||||
|
||||
@ApiModelProperty(value = "归还电池包仓位")
|
||||
String returnBatNo;
|
||||
|
||||
@ApiModelProperty(value = "归还电池包编码")
|
||||
String returnBatCode;
|
||||
|
||||
@ApiModelProperty(value = "归还电池包SOC")
|
||||
String returnBatSoc;
|
||||
|
||||
@ApiModelProperty(value = "换电模式:1-全自动,2-半自动,3-人工干预")
|
||||
String changeMode;
|
||||
|
||||
@ApiModelProperty(value = "换电车道 1-A 车道;2-B 车道")
|
||||
String changeLane;
|
||||
|
||||
@ApiModelProperty(value = "换电步骤")
|
||||
List<BatterySwapStepDTO> batterySwapStepDTOList = Collections.emptyList();
|
||||
|
||||
@ApiModelProperty(value = "推送状态:1-成功, 2-失败")
|
||||
Integer pushStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "当前站端使用的rgv数量")
|
||||
Integer rgvNum;
|
||||
|
||||
public OrderSwapDTO() {
|
||||
}
|
||||
|
||||
public OrderSwapDTO(Integer rgvNum) {
|
||||
this.rgvNum = rgvNum;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 物理指令步骤类
|
||||
*
|
||||
* @ClassName:DictDetailDTO
|
||||
* @date: 2025年08月26日 16:42
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@ApiModel("物理指令名称")
|
||||
@Data
|
||||
public class RunningInstructionsDTO extends BaseDTO<RunningInstructionsDTO> {
|
||||
|
||||
@ApiModelProperty("指令编码")
|
||||
String code;
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 物理指令步骤类
|
||||
*
|
||||
* @ClassName:DictDetailDTO
|
||||
* @date: 2025年08月26日 16:42
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@ApiModel("物理指令步骤")
|
||||
@Data
|
||||
public class RunningInstructionsDetailDTO extends BaseDTO<RunningInstructionsDetailDTO> {
|
||||
|
||||
@ApiModelProperty("指令的paramCode")
|
||||
String dictValue;
|
||||
|
||||
@ApiModelProperty("指令的分类")
|
||||
@Query(javaField = "typeCode", tableColumn = "a.type_code", type = QueryType.EQ)
|
||||
String typeCode;
|
||||
|
||||
@ApiModelProperty("指令的默认值")
|
||||
Integer defaultValue;
|
||||
|
||||
@ApiModelProperty("执行顺序, 数值越靠前")
|
||||
Integer sort;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.evotech.hd.core.dtos.business;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:Test2
|
||||
* @date: 2025年09月19日 17:06
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@ApiModel("二层测试")
|
||||
@Data
|
||||
public class Test2 extends BaseDTO<Test2> {
|
||||
@ApiModelProperty("二层名称")
|
||||
String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:基本属性
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningBaseDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:基本属性")
|
||||
public class AirConditioningBaseDTO {
|
||||
|
||||
@ApiModelProperty("空调连接状态")
|
||||
Boolean connectDeviceStatus;
|
||||
|
||||
@ApiModelProperty("运行状态")
|
||||
Boolean runStatus;
|
||||
|
||||
@ApiModelProperty("自检状态")
|
||||
Boolean selfCheckStatus;
|
||||
|
||||
@ApiModelProperty("轴流风机状态")
|
||||
Boolean axialFlowFanStatus;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:压缩机
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningBaseDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:压缩机")
|
||||
public class AirConditioningCompressorDTO {
|
||||
|
||||
@ApiModelProperty("压缩机运行状态")
|
||||
Boolean airConCmpStatus;
|
||||
|
||||
@ApiModelProperty("压缩机欠流故障")
|
||||
Boolean airConCmpLowCurError;
|
||||
|
||||
@ApiModelProperty("压缩机过载故障")
|
||||
Boolean airConCmpOverLoadError;
|
||||
|
||||
@ApiModelProperty("压缩机电流")
|
||||
String airConCmpCurrent;
|
||||
|
||||
@ApiModelProperty("压缩机启动温度")
|
||||
String airConCmpStartTemp;
|
||||
|
||||
@ApiModelProperty("压缩机停止回差值")
|
||||
String airConCmpStopTemp;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:柜外
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningExtDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:柜外")
|
||||
public class AirConditioningExtDTO {
|
||||
|
||||
@ApiModelProperty("柜外温度传感器故障")
|
||||
Boolean airConExtTempSensorError;
|
||||
|
||||
@ApiModelProperty("柜外环境温度")
|
||||
String airConExtTemp;
|
||||
|
||||
@ApiModelProperty("外部故障告警")
|
||||
Boolean airConExtErrorAlarm;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:外风机
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningExternalFanDTO
|
||||
* @date: 2025年09月24日 15:46
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:外风机")
|
||||
public class AirConditioningExternalFanDTO {
|
||||
|
||||
@ApiModelProperty("外风机运行状态")
|
||||
Boolean airConExtFanStatus;
|
||||
|
||||
@ApiModelProperty("外风机告警")
|
||||
Boolean airConExtFanAlarm;
|
||||
|
||||
@ApiModelProperty("外风机电流")
|
||||
String airConExtFanCurrent;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:加热器
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningHeaterDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:加热器")
|
||||
public class AirConditioningHeaterDTO {
|
||||
|
||||
@ApiModelProperty("加热器运行状态")
|
||||
Boolean airConHeatStatus;
|
||||
|
||||
@ApiModelProperty("加热器欠流故障")
|
||||
Boolean airConHeatLowCurError;
|
||||
|
||||
@ApiModelProperty("加热器过载故障")
|
||||
Boolean airConHeatOverLoadError;
|
||||
|
||||
@ApiModelProperty("加热器电流")
|
||||
String airConHeatCurrent;
|
||||
|
||||
@ApiModelProperty("加热器启动温度")
|
||||
String airConHeatStartTemp;
|
||||
|
||||
@ApiModelProperty("加热器停止回差值")
|
||||
String airConHeatStopTemp;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:柜内
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningIntDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:柜内")
|
||||
public class AirConditioningIntDTO {
|
||||
|
||||
@ApiModelProperty("柜内温度传感器故障")
|
||||
Boolean airConIntTempSensorError;
|
||||
|
||||
@ApiModelProperty("柜内湿度传感器故障")
|
||||
Boolean airConIntHumSensorError;
|
||||
|
||||
@ApiModelProperty("柜内高温告警")
|
||||
Boolean airConIntOverTempAlarm;
|
||||
|
||||
@ApiModelProperty("柜内低温告警")
|
||||
Boolean airConIntLowTempAlarm;
|
||||
|
||||
@ApiModelProperty("柜内回风温度")
|
||||
String airConIntTemp;
|
||||
|
||||
@ApiModelProperty("柜内湿度")
|
||||
String airConIntHum;
|
||||
|
||||
@ApiModelProperty("柜内温度变送电流值")
|
||||
String airConIntTempSedCurrent;
|
||||
|
||||
@ApiModelProperty("柜内湿度变送电流值")
|
||||
String airConIntHumSedCurrent;
|
||||
|
||||
@ApiModelProperty("柜内高温告警温度值")
|
||||
String airConOverAlmTemp;
|
||||
|
||||
@ApiModelProperty("柜内低温告警温度值")
|
||||
String airConLowAlmTemp;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:内风机
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningBaseDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:内风机")
|
||||
public class AirConditioningInternalFanDTO {
|
||||
|
||||
@ApiModelProperty("内风机运行状态")
|
||||
Boolean airConIntFanStatus;
|
||||
|
||||
@ApiModelProperty("内风机告警")
|
||||
Boolean airConIntFanAlarm;
|
||||
|
||||
@ApiModelProperty("内风机电流")
|
||||
String airConIntFanCurrent;
|
||||
|
||||
@ApiModelProperty("内风机待机开启温度")
|
||||
String airConIntFanStartTemp;
|
||||
|
||||
@ApiModelProperty("内风机待机停止回差温度")
|
||||
String airConIntFanStopTemp;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.evotech.hd.core.dtos.business.airconditioning;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空调控制:其他
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:AirConditioningOtherDTO
|
||||
* @date: 2025年09月23日 14:43
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("空调控制:其他")
|
||||
public class AirConditioningOtherDTO {
|
||||
|
||||
@ApiModelProperty("冷凝盘管温度传感器故障")
|
||||
Boolean airConCondTempSensorError;
|
||||
|
||||
@ApiModelProperty("系统供电电压")
|
||||
String airConSrcVol;
|
||||
|
||||
@ApiModelProperty("电源电压超限告警")
|
||||
Boolean airConSrcVolOverAlarm;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.evotech.hd.core.dtos.business.electricitymeter;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ElectricityMeterBaseDTO
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:ElectricityMeterBaseDTO
|
||||
* @date: 2025年09月25日 14:49
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("电表箱:基本属性")
|
||||
public class ElectricityMeterBaseDTO extends BaseDTO<ElectricityMeterBaseDTO> {
|
||||
|
||||
@ApiModelProperty("电箱温湿度传感器连接状态")
|
||||
Boolean htSensorDevConnect;
|
||||
|
||||
@ApiModelProperty("电箱内湿度值")
|
||||
String htSensorHumidity;
|
||||
|
||||
@ApiModelProperty("电箱内温度值")
|
||||
String htSensorTemperature;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.evotech.hd.core.dtos.system;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 指令日志类
|
||||
*
|
||||
* @ClassName:Log
|
||||
* @date: 2025年08月18日 10:06
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("指令日志类")
|
||||
public class InstructionLogDTO extends BaseDTO<InstructionLogDTO> {
|
||||
|
||||
@ApiModelProperty(value = "指令地址")
|
||||
private String requestUri;
|
||||
|
||||
@ApiModelProperty(value = "指令方式")
|
||||
@Query(javaField = "method", tableColumn = "a.method", type = QueryType.EQ)
|
||||
private String method;
|
||||
|
||||
@ApiModelProperty(value = "指令类型")
|
||||
@Query(javaField = "params", tableColumn = "a.params", type = QueryType.LIKE)
|
||||
private String params;
|
||||
/**
|
||||
* 返回值
|
||||
*/
|
||||
@ApiModelProperty(value = "返回结果")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "异常信息")
|
||||
private String exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.evotech.hd.core.dtos.system;
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 系统日志类
|
||||
*
|
||||
* @ClassName:Log
|
||||
* @date: 2025年08月18日 10:06
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("日志类型")
|
||||
public class LogDTO extends BaseDTO<LogDTO> {
|
||||
|
||||
@ApiModelProperty(value = "类型", allowableValues = "1-登录日志, 2-访问日志, 3-异常日志, 4-操作日志,5-推送云日志, 6-报警日志")
|
||||
@Query(javaField = "type", tableColumn = "a.type", type = QueryType.EQ)
|
||||
String type;
|
||||
|
||||
@ApiModelProperty(value = "操作用户的IP地址")
|
||||
private String remoteAddr;
|
||||
|
||||
@ApiModelProperty(value = "请求uri")
|
||||
private String requestUri;
|
||||
|
||||
@ApiModelProperty(value = "请求类型")
|
||||
private String requestType;
|
||||
|
||||
@ApiModelProperty(value = "操作的方式")
|
||||
private String method;
|
||||
|
||||
@ApiModelProperty(value = "操作提交的数据")
|
||||
private String params;
|
||||
|
||||
@ApiModelProperty(value = "返回结果")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "操作用户代理信息")
|
||||
private String userAgent;
|
||||
|
||||
@ApiModelProperty(value = "异常信息")
|
||||
private String exception;
|
||||
|
||||
@ApiModelProperty(value = "耗时 (毫秒)")
|
||||
private Long recordTime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.evotech.hd.core.dtos.system;
|
||||
|
||||
import com.evotech.hd.core.dtos.BaseDTO;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:ParamsDTO
|
||||
* @date: 2025年08月18日 16:10
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@ApiModel("属性类型")
|
||||
@Data
|
||||
public class ParamsDTO extends BaseDTO<ParamsDTO> {
|
||||
|
||||
@ApiModelProperty("所属分类")
|
||||
@Query(javaField = "groupId", tableColumn = "a.group_id", type = QueryType.EQ)
|
||||
Integer groupId;
|
||||
|
||||
@ApiModelProperty("参数code")
|
||||
@Query(javaField = "paramCode", tableColumn = "a.param_code", type = QueryType.LIKE)
|
||||
String paramCode;
|
||||
|
||||
@ApiModelProperty("参数值")
|
||||
@Query(javaField = "paramValue", tableColumn = "a.param_value", type = QueryType.LIKE)
|
||||
String paramValue;
|
||||
|
||||
@ApiModelProperty("预期结果, 不满足预期返回错误信息")
|
||||
String expectedResults;
|
||||
|
||||
@ApiModelProperty("是否需要核实结果")
|
||||
Boolean verifyResult;
|
||||
|
||||
@ApiModelProperty("错误信息")
|
||||
String errMessage;
|
||||
|
||||
/** 说明 */
|
||||
@ApiModelProperty("说明")
|
||||
private String description;
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.evotech.hd.core.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* 数据Entity类
|
||||
* @author space
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
public abstract class BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 实体主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("name")
|
||||
String name;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "扩展字段")
|
||||
@TableField(typeHandler = JacksonTypeHandler.class, jdbcType = JdbcType.OTHER)
|
||||
private String extendeds;
|
||||
|
||||
|
||||
public Map<String, Object> getExtendeds() {
|
||||
if(StringUtils.isNotEmpty(extendeds)){
|
||||
try {
|
||||
// ObjectMapper 是 Jackson 库的核心类,用于处理 JSON 数据的序列化和反序列化。它提供了多种方法来将 Java 对象转换为 JSON 字符串,以及将 JSON 字符串转换为 Java 对象
|
||||
// 使用 Jackson 库将 JSON 字符串反序列化为 Map<String, Object> 类型的代码
|
||||
return new ObjectMapper().readValue(extendeds, Map.class);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to parse JSON", e);
|
||||
}
|
||||
}
|
||||
return new LinkedHashMap<>();
|
||||
}
|
||||
public void setParams(Map<String, Object> params) {
|
||||
if (params == null) {
|
||||
this.extendeds = null;
|
||||
} else {
|
||||
try {
|
||||
// 将 params(一个 Map 类型的对象)转换为 JSON 格式的字符串,并将其存储在 paramsJson 字段中
|
||||
this.extendeds = new ObjectMapper().writeValueAsString(params);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to serialize JSON", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getKey(){
|
||||
return String.valueOf(this.id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 电池信息类
|
||||
*
|
||||
* @ClassName:Battery
|
||||
* @date: 2025年08月18日 12:00
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_battery")
|
||||
public class Battery extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 电池编号
|
||||
*/
|
||||
String batteryCode;
|
||||
/***
|
||||
* 电池类型
|
||||
*/
|
||||
String batteryType;
|
||||
/***
|
||||
* 电池模式
|
||||
* 0:未上电
|
||||
* 1:监控模式
|
||||
* 2:充电初始化
|
||||
* 3:单功充电
|
||||
* 4:双功充电
|
||||
* 5:暂停充电
|
||||
* 6:停止充电
|
||||
* 7:充电故障
|
||||
* 8:充电错误
|
||||
*/
|
||||
String batteryMode;
|
||||
/***
|
||||
* 电池仓Id
|
||||
*/
|
||||
Integer batteryCompartmentId;
|
||||
/***
|
||||
* 电池状态在仓状态
|
||||
* 1在仓 0 离仓
|
||||
*/
|
||||
Integer storageStatus;
|
||||
|
||||
/***
|
||||
* 电池健康度
|
||||
*/
|
||||
String soh;
|
||||
|
||||
/***
|
||||
* 电池额定容量
|
||||
*/
|
||||
String ratedCapacity;
|
||||
|
||||
/***
|
||||
* 电池单体数量
|
||||
*/
|
||||
Integer monomerQuantity;
|
||||
|
||||
/***
|
||||
* 探针数量
|
||||
*/
|
||||
Integer numberOfProbes;
|
||||
|
||||
/***
|
||||
* 电池电量
|
||||
*/
|
||||
String soc;
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 电池仓信息类
|
||||
*
|
||||
* @ClassName:BatteryCompartment
|
||||
* @date: 2025年08月18日 11:39
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_battery_compartment")
|
||||
public class BatteryCompartment extends BaseEntity {
|
||||
|
||||
//
|
||||
/***
|
||||
* 取消电池仓编号信息, 默认使用id
|
||||
* 电池仓编号
|
||||
* 推送站端, 只用电池仓编号
|
||||
*/
|
||||
String batteryCompartmentNo;
|
||||
/***
|
||||
* 状态:1-正常,2-检修, 3-坏,
|
||||
*/
|
||||
Integer status;
|
||||
/***
|
||||
* 运行状态:1正常, 2-禁用
|
||||
*/
|
||||
Integer state;
|
||||
/***
|
||||
* 排序
|
||||
*/
|
||||
Integer sort;
|
||||
/***
|
||||
* 是否存在电池
|
||||
*/
|
||||
Boolean existsBattery;
|
||||
/***
|
||||
* 充电机状态
|
||||
* 0:空闲(电池低压未上电,无法读取电池数据)
|
||||
* 1:监控状态(电池低压上电后为监控状态可实时读取电池数据)
|
||||
* 2:单功率充电
|
||||
* 3:双功率充电
|
||||
* 4:辅助充电(本仓位电池未充电,为同组内其它电池提供充电辅助,此状态下本仓位不能充电,上位机发送充电命令将不响应)
|
||||
* 5:调试状态(不响应上位机充电命令)
|
||||
* 6:设备错误状态
|
||||
*/
|
||||
Integer chargerStatus;
|
||||
/***
|
||||
* 电池到位信号
|
||||
* 0 无电池 1电池正常 2, 电池错误
|
||||
*/
|
||||
Integer batteryPlaceStatus;
|
||||
/***
|
||||
* 电池通信状态
|
||||
*/
|
||||
Boolean batteryCommunicationStatus;
|
||||
/***
|
||||
* 直流电表通信状态
|
||||
*/
|
||||
Boolean directCurrentCommunicationStatus;
|
||||
/***
|
||||
* 电池低压电源状态
|
||||
*/
|
||||
String lowPressurePowerSupplyStatus;
|
||||
/***
|
||||
* 辅助电源状态
|
||||
*/
|
||||
String auxiliaryPowerSupplyStatus;
|
||||
/***
|
||||
* 最大充电功率
|
||||
*/
|
||||
Integer maximumChargingPower;
|
||||
/***
|
||||
* 直流电表压 (KW/H) 忘记是啥了, 到时候在说
|
||||
*/
|
||||
String directCurrentMeterVoltage;
|
||||
/***
|
||||
* 电池存入时间
|
||||
*/
|
||||
Date depositTime;
|
||||
/***
|
||||
* 反向记录充电订单Id, 用于刷新数据
|
||||
*/
|
||||
Integer orderChargingId;
|
||||
/***
|
||||
* 是否全功率充电
|
||||
*/
|
||||
Boolean allPower;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 换电步骤表类
|
||||
* @ClassName:BatterySwapStep
|
||||
* @date: 2025年08月18日 10:10
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_battery_swap_step")
|
||||
public class BatterySwapStep extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 订单Id
|
||||
*/
|
||||
Integer orderId;
|
||||
/***
|
||||
* 换电步骤
|
||||
*/
|
||||
Integer step;
|
||||
/***
|
||||
* 换电时间
|
||||
*/
|
||||
Date stepTime;
|
||||
/***
|
||||
* 是否人为操作
|
||||
*/
|
||||
Boolean humanOperation;
|
||||
//是否出现错误
|
||||
Boolean error;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 充电订单
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:OrderCharging
|
||||
* @date: 2025年09月30日 14:21
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_order_charging")
|
||||
public class OrderCharging extends BaseEntity {
|
||||
/***
|
||||
* 充电单号
|
||||
*/
|
||||
String chargingNo;
|
||||
/***
|
||||
* 电池编号
|
||||
*/
|
||||
String batteryCode;
|
||||
/***
|
||||
* 电池仓Id
|
||||
*/
|
||||
Integer batteryCompartmentId;
|
||||
/***
|
||||
* 策略信息
|
||||
*/
|
||||
String strategyInfo;
|
||||
/***
|
||||
* 充电状态 1:充电结束 2 充电中
|
||||
*/
|
||||
Integer status;
|
||||
/***
|
||||
* 耗电量;如果soc的话为soc
|
||||
*/
|
||||
Integer powerConsumption;
|
||||
/***
|
||||
* 开始电量; 如果soc的话为开始soc
|
||||
*/
|
||||
Integer startElectric;
|
||||
/***
|
||||
* 结束电量; 如果soc的话为开始soc
|
||||
*/
|
||||
Integer endElectric;
|
||||
/***
|
||||
* 充电开始时间
|
||||
*/
|
||||
Date beginTime;
|
||||
/***
|
||||
* 充电结束时间
|
||||
*/
|
||||
Date endTime;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 充电过程中使用的策略记录
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:OrderCharging
|
||||
* @date: 2025年09月30日 14:21
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_order_charging_strategy_log")
|
||||
public class OrderChargingStrategyLog extends BaseEntity {
|
||||
/***
|
||||
* 充电订单Id
|
||||
*/
|
||||
Integer orderChargingId;
|
||||
/***
|
||||
* 策略类
|
||||
*/
|
||||
String className;
|
||||
/***
|
||||
* 策略信息
|
||||
*/
|
||||
String strategyInfo;
|
||||
|
||||
public OrderChargingStrategyLog() {
|
||||
}
|
||||
|
||||
public OrderChargingStrategyLog(Integer orderChargingId, String className, String strategyInfo) {
|
||||
this.orderChargingId = orderChargingId;
|
||||
this.className = className;
|
||||
this.strategyInfo = strategyInfo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 预约订单类
|
||||
* @ClassName:OrderReservation
|
||||
* @date: 2025年08月18日 11:00
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_order_reservation")
|
||||
public class OrderReservation extends BaseEntity {
|
||||
/***
|
||||
* 数据来源
|
||||
*/
|
||||
String source;
|
||||
/***
|
||||
* 云平台预约Id
|
||||
*/
|
||||
Integer cloudReservationId;
|
||||
|
||||
String reservationName;
|
||||
|
||||
String reservationPhone;
|
||||
/***
|
||||
* 车牌号
|
||||
*/
|
||||
String plateNum;
|
||||
/***
|
||||
* 微信预约人Id
|
||||
*/
|
||||
String wechatUserId;
|
||||
/***
|
||||
* 微信预约人姓名
|
||||
*/
|
||||
String wechatUserName;
|
||||
/***
|
||||
* 预约时间
|
||||
*/
|
||||
Date reservationTime;
|
||||
/***
|
||||
* 预约换电日期
|
||||
*/
|
||||
String swapDay;
|
||||
/***
|
||||
* 预约换电时间段
|
||||
*/
|
||||
String swapDuration;
|
||||
/***
|
||||
* 状态:1-预约成功,2-到店使用,3-取消,4-过期
|
||||
*/
|
||||
Integer status;
|
||||
|
||||
/***
|
||||
* 推送状态:1-成功, 2-失败
|
||||
*/
|
||||
Integer pushStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 换电订单表
|
||||
*
|
||||
* @ClassName:OrderSwap
|
||||
* @date: 2025年08月18日 11:11
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_order_swap")
|
||||
public class OrderSwap extends BaseEntity {
|
||||
/***
|
||||
* 云平台订单id
|
||||
*/
|
||||
Integer cloudOrderId;
|
||||
/***
|
||||
* 订单编号
|
||||
*/
|
||||
String orderNo;
|
||||
/***
|
||||
* 预约人微信Id
|
||||
*/
|
||||
String preWechatId;
|
||||
/***
|
||||
* 预约订单Id
|
||||
*/
|
||||
Integer orderPreId;
|
||||
/***
|
||||
* 预约用户名称
|
||||
*/
|
||||
String orderPreName;
|
||||
/***
|
||||
* 类型
|
||||
*/
|
||||
String orderType;
|
||||
/***
|
||||
* 车牌号
|
||||
*/
|
||||
String plateNum;
|
||||
/***
|
||||
* 订单时间
|
||||
*/
|
||||
Date orderTime;
|
||||
/***
|
||||
* 订单总金额 (分)
|
||||
*/
|
||||
Integer orderAmount;
|
||||
/***
|
||||
* 订单状态:1-已创建,2-换电中,3-换电完成,4-充电中,5-充电完成,6-待结算,7-已完成,9-已取消
|
||||
*/
|
||||
Integer status;
|
||||
/***
|
||||
* 支付方式 1余额, 2微信, 3支付宝
|
||||
*/
|
||||
String payType;
|
||||
/***
|
||||
* 支付状态
|
||||
*/
|
||||
String payStatus;
|
||||
/***
|
||||
* 支付时间
|
||||
*/
|
||||
Date payTime;
|
||||
/***
|
||||
* 计算费用方式:1-ODO,2-SOC,3-按电量
|
||||
*/
|
||||
String feeType;
|
||||
/***
|
||||
* 订单金额 (分)
|
||||
*/
|
||||
Integer orderFee;
|
||||
/***
|
||||
* 服务金额 (分)
|
||||
*/
|
||||
Integer serviceFee;
|
||||
/***
|
||||
* 服务开始时间
|
||||
*/
|
||||
Date serviceTimeBegin;
|
||||
/***
|
||||
* 服务结束时间
|
||||
*/
|
||||
Date serviceTimeEnd;
|
||||
/***
|
||||
* 消耗电量;如果是soc结算 则是soc的差值
|
||||
*/
|
||||
String electricityQuantity;
|
||||
|
||||
/***
|
||||
* 租借电池包仓位
|
||||
*/
|
||||
String rentBatNo;
|
||||
/***
|
||||
* 租用电池包编码
|
||||
*/
|
||||
String rentBatCode;
|
||||
/***
|
||||
*租用电池包SOC
|
||||
*/
|
||||
String rentBatSoc;
|
||||
/***
|
||||
* 归还电池包仓位
|
||||
*/
|
||||
String returnBatNo;
|
||||
/***
|
||||
* 归还电池包编码
|
||||
*/
|
||||
String returnBatCode;
|
||||
/***
|
||||
* 归还电池包SOC
|
||||
*/
|
||||
String returnBatSoc;
|
||||
/***
|
||||
* 换电模式:1-全自动,2-半自动,3-人工干预
|
||||
*/
|
||||
String changeMode = "1";
|
||||
/***
|
||||
* 换电车道 1-A 车道;2-B 车道
|
||||
*/
|
||||
String changeLane;
|
||||
|
||||
/***
|
||||
* 推送状态:1-成功, 2-失败
|
||||
*/
|
||||
Integer pushStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 运行指令
|
||||
*
|
||||
* @ClassName:RunningInstructions
|
||||
* @date: 2025年08月18日 8:58
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_running_instructions")
|
||||
public class RunningInstructions extends BaseEntity {
|
||||
|
||||
String code;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.evotech.hd.core.entity.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 运行指令详情
|
||||
*
|
||||
* @ClassName:RunningInstructionsDetail
|
||||
* @date: 2025年08月18日 9:20
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_running_instructions_detail")
|
||||
public class RunningInstructionsDetail extends BaseEntity {
|
||||
|
||||
String dictValue;
|
||||
|
||||
String typeCode;
|
||||
|
||||
Integer defaultValue;
|
||||
|
||||
Integer sort;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 存储策略类
|
||||
*
|
||||
* @ClassName:AccessStrategy
|
||||
* @date: 2025年08月27日 15:59
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_access_strategy")
|
||||
public class AccessStrategy extends BaseEntity {
|
||||
/***
|
||||
* 存取策略: 1.存取相同, 2 顺序存续. 3间隔存储 4 随机存储
|
||||
*/
|
||||
Integer strategy;
|
||||
/***
|
||||
* 电源策略
|
||||
*/
|
||||
Integer powerStrategy;
|
||||
// /***
|
||||
// * 充电策略
|
||||
// */
|
||||
// Integer chargingStrategy;
|
||||
/***
|
||||
*即存即充功率
|
||||
*/
|
||||
Integer instantChargePower;
|
||||
/***
|
||||
*最低安全库存
|
||||
*/
|
||||
Integer minimumSafetyStock;
|
||||
/***
|
||||
*最低换电SOC
|
||||
*/
|
||||
Integer lowestBatterySwapSoc;
|
||||
/***
|
||||
*充满界定soc
|
||||
*/
|
||||
Integer fullOfLimitSoc;
|
||||
/***
|
||||
*生效的RGV编号
|
||||
*/
|
||||
String effectiveRgvNo;
|
||||
/***
|
||||
* 数据是否有效: valid有效 invalid 无效
|
||||
*/
|
||||
String valid;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 充电策略
|
||||
*
|
||||
* @ClassName:BatteryStrategy
|
||||
* @date: 2025年08月27日 15:59
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_battery_strategy")
|
||||
public class BatteryStrategy extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 云数据id
|
||||
*/
|
||||
private Integer cloudId;
|
||||
/***
|
||||
* 开始时间
|
||||
*/
|
||||
private String beginTime;
|
||||
/***
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/***
|
||||
* 充电功率
|
||||
*/
|
||||
private Integer chargingPower;
|
||||
|
||||
private Boolean del;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import com.evotech.hd.utils.Collections;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数分组类
|
||||
*
|
||||
* @ClassName:Group
|
||||
* @date: 2025年08月16日 17:28
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_groups")
|
||||
public class Group extends BaseEntity {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 指令日志类
|
||||
*
|
||||
* @ClassName:Log
|
||||
* @date: 2025年08月18日 10:06
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_instruction_log")
|
||||
public class InstructionLog extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 类型, 参考字典
|
||||
*/
|
||||
String type;
|
||||
|
||||
/**
|
||||
* 请求uri
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作的方式
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
private String params;
|
||||
/**
|
||||
* 返回值
|
||||
*/
|
||||
private String result;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String exception;
|
||||
/**
|
||||
* 耗时
|
||||
*/
|
||||
private Long recordTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/***
|
||||
* 执行时间戳
|
||||
*/
|
||||
private String executionTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 系统日志类
|
||||
*
|
||||
* @ClassName:Log
|
||||
* @date: 2025年08月18日 10:06
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_log")
|
||||
public class Log extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 类型, 参考字典
|
||||
*/
|
||||
String type;
|
||||
/**
|
||||
* 操作用户的IP地址
|
||||
*/
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求uri
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 请求类型
|
||||
*/
|
||||
private String requestType;
|
||||
|
||||
/**
|
||||
* 操作的方式
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
private String params;
|
||||
/**
|
||||
* 返回值
|
||||
*/
|
||||
private String result;
|
||||
/**
|
||||
* 操作用户代理信息
|
||||
*/
|
||||
private String userAgent;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String exception;
|
||||
/**
|
||||
* 耗时
|
||||
*/
|
||||
private Long recordTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 操作日志表, 隐藏表类
|
||||
*
|
||||
* @ClassName:OperationLog
|
||||
* @date: 2025年08月18日 9:26
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_operation_log")
|
||||
public class OperationLog extends BaseEntity {
|
||||
|
||||
/***
|
||||
* 操作方法
|
||||
*/
|
||||
String operationMethod;
|
||||
/***
|
||||
* 操作参数
|
||||
*/
|
||||
String operationParams;
|
||||
/***
|
||||
* 操作信息
|
||||
*/
|
||||
String operationContent;
|
||||
/***
|
||||
* 操作时间
|
||||
*/
|
||||
Date operationTime;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import com.evotech.hd.query.Query;
|
||||
import com.evotech.hd.query.QueryType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 站端参数配置类
|
||||
*
|
||||
* @ClassName:params
|
||||
* @date: 2025年08月16日 17:30
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sc_sys_params")
|
||||
public class Params extends BaseEntity {
|
||||
|
||||
// @ApiModelProperty("所属分类")
|
||||
@Query(javaField = "groupId", tableColumn = "a.group_id", type = QueryType.EQ)
|
||||
Integer groupId;
|
||||
|
||||
String paramCode;
|
||||
|
||||
// @ApiModelProperty("参数值")
|
||||
String paramValue;
|
||||
|
||||
String expectedResults;
|
||||
|
||||
Boolean verifyResult;
|
||||
|
||||
String errMessage;
|
||||
|
||||
/** 说明 */
|
||||
private String description;
|
||||
|
||||
public Params() {
|
||||
}
|
||||
|
||||
public Params(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return (this.paramValue.contains(":num") ? this.paramValue.substring(this.paramValue.indexOf(":num"), this.paramValue.length()-1) : this.paramValue);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright © 2021-2026 space All rights reserved.
|
||||
*/
|
||||
package com.evotech.hd.core.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.evotech.hd.core.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户Entity
|
||||
* @ClassName:User
|
||||
* @date: 2025年08月16日 17:28
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_user")
|
||||
public class User extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 登录名
|
||||
*/
|
||||
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
/**
|
||||
* 是否允许登陆
|
||||
*/
|
||||
private String loginFlag;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
/**
|
||||
* 枚举
|
||||
*
|
||||
* @ClassName:BaseEnum
|
||||
* @date: 2025年05月19日 15:36
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface BaseEnum<K, V> {
|
||||
|
||||
K getLabel();
|
||||
V getValue();
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
/**
|
||||
* 缓存名称定义
|
||||
* 缓存设置的标准:
|
||||
* 1 频繁读取,但是很少修改的内容,例如用户菜单,用户,字典
|
||||
* 2 读取频率不高,但是数据量很大也很少修改的内容,比如机构,区域
|
||||
*/
|
||||
public interface CacheNames {
|
||||
|
||||
String USER_CACHE_TOKEN = "user:cache:token:";
|
||||
|
||||
String USER_CACHE_LOGIN_NAME = "user:cache:loginName:"; //根据登录名关联用户
|
||||
|
||||
String SYSTEM_RUNNING_PARAMS = "system:running:params:";
|
||||
String SYSTEM_RUNNING_DICT_DETAIL = "system:running:dict:detail:"; //系统运行的指令参数
|
||||
|
||||
String SYSTEM_LOCK_PLATE = "system:lock_plate:"; //根据登录名关联用户
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
/**
|
||||
* 枚举
|
||||
*
|
||||
* @ClassName:ChargerStatusEnums
|
||||
* @date: 2025年08月22日 14:33
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public enum ChargerStatusEnums {
|
||||
|
||||
UNKNOWN(-1, "未知"),
|
||||
|
||||
IDLE(0, "空闲"),
|
||||
|
||||
MONITORING(1, "监控"),
|
||||
|
||||
SINGLE_POWER(2, "单功率充电"),
|
||||
|
||||
DOUBLE_POWER(3, "双功率充电"),
|
||||
|
||||
AUXILIARY_CHARGING(4, "辅助充电"),
|
||||
|
||||
DEBUGGING_MODE(5, "调试模式"),
|
||||
|
||||
ERROR(6, "设备错误状态"),
|
||||
;
|
||||
|
||||
Integer code;
|
||||
|
||||
String name;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
ChargerStatusEnums(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static ChargerStatusEnums getByCode(Integer code){
|
||||
if(code == null){
|
||||
return UNKNOWN;
|
||||
}
|
||||
for (ChargerStatusEnums en : ChargerStatusEnums.values()){
|
||||
if(en.getCode().equals(code)){
|
||||
return en;
|
||||
}
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 100 Continue 继续。客户端应继续其请求
|
||||
101 Switching Protocols 切换协议。服务器根据客户端的请求切换协议。只能切换到更高级的协议,例如,切换到HTTP的新版本协议
|
||||
200 OK 请求成功。一般用于GET与POST请求
|
||||
201 Created 已创建。成功请求并创建了新的资源
|
||||
202 Accepted 已接受。已经接受请求,但未处理完成
|
||||
203 Non-Authoritative Information 非授权信息。请求成功。但返回的meta信息不在原始的服务器,而是一个副本
|
||||
204 No Content 无内容。服务器成功处理,但未返回内容。在未更新网页的情况下,可确保浏览器继续显示当前文档
|
||||
205 Reset Content 重置内容。服务器处理成功,用户终端(例如:浏览器)应重置文档视图。可通过此返回码清除浏览器的表单域
|
||||
206 Partial Content 部分内容。服务器成功处理了部分GET请求
|
||||
300 Multiple Choices 多种选择。请求的资源可包括多个位置,相应可返回一个资源特征与地址的列表用于用户终端(例如:浏览器)选择
|
||||
301 Moved Permanently 永久移动。请求的资源已被永久的移动到新URI,返回信息会包括新的URI,浏览器会自动定向到新URI。今后任何新的请求都应使用新的URI代替
|
||||
302 Found 临时移动。与301类似。但资源只是临时被移动。客户端应继续使用原有URI
|
||||
303 See Other 查看其它地址。与301类似。使用GET和POST请求查看
|
||||
304 Not Modified 未修改。所请求的资源未修改,服务器返回此状态码时,不会返回任何资源。客户端通常会缓存访问过的资源,通过提供一个头信息指出客户端希望只返回在指定日期之后修改的资源
|
||||
305 Use Proxy 使用代理。所请求的资源必须通过代理访问
|
||||
306 Unused 已经被废弃的HTTP状态码
|
||||
307 Temporary Redirect 临时重定向。与302类似。使用GET请求重定向
|
||||
400 Bad Request 客户端请求的语法错误,服务器无法理解
|
||||
401 Unauthorized 请求要求用户的身份认证
|
||||
402 Payment Required 保留,将来使用
|
||||
403 Forbidden 服务器理解请求客户端的请求,但是拒绝执行此请求
|
||||
404 Not Found 服务器无法根据客户端的请求找到资源(网页)。通过此代码,网站设计人员可设置"您所请求的资源无法找到"的个性页面
|
||||
405 Method Not Allowed 客户端请求中的方法被禁止
|
||||
406 Not Acceptable 服务器无法根据客户端请求的内容特性完成请求
|
||||
407 Proxy Authentication Required 请求要求代理的身份认证,与401类似,但请求者应当使用代理进行授权
|
||||
408 Request Time-out 服务器等待客户端发送的请求时间过长,超时
|
||||
409 Conflict 服务器完成客户端的 PUT 请求时可能返回此代码,服务器处理请求时发生了冲突
|
||||
410 Gone 客户端请求的资源已经不存在。410不同于404,如果资源以前有现在被永久删除了可使用410代码,网站设计人员可通过301代码指定资源的新位置
|
||||
411 Length Required 服务器无法处理客户端发送的不带Content-Length的请求信息
|
||||
412 Precondition Failed 客户端请求信息的先决条件错误
|
||||
413 Request Entity Too Large 由于请求的实体过大,服务器无法处理,因此拒绝请求。为防止客户端的连续请求,服务器可能会关闭连接。如果只是服务器暂时无法处理,则会包含一个Retry-After的响应信息
|
||||
414 Request-URI Too Large 请求的URI过长(URI通常为网址),服务器无法处理
|
||||
415 Unsupported Media Type 服务器无法处理请求附带的媒体格式
|
||||
416 Requested range not satisfiable 客户端请求的范围无效
|
||||
417 Expectation Failed 服务器无法满足Expect的请求头信息
|
||||
500 Internal Server Error 服务器内部错误,无法完成请求
|
||||
501 Not Implemented 服务器不支持请求的功能,无法完成请求
|
||||
502 Bad Gateway 作为网关或者代理工作的服务器尝试执行请求时,从远程服务器接收到了一个无效的响应
|
||||
503 Service Unavailable 由于超载或系统维护,服务器暂时的无法处理客户端的请求。延时的长度可包含在服务器的Retry-After头信息中
|
||||
504 Gateway Time-out 充当网关或代理的服务器,未及时从远端服务器获取请求
|
||||
505 HTTP Version not supported 服务器不支持请求的HTTP协议的版本,无法完成处理
|
||||
*/
|
||||
public enum CodeMsg {
|
||||
// 统一回复
|
||||
SUCCESS("1000", "OK"),
|
||||
ERROR("4000", "ERROR"),
|
||||
// 系统错误 S
|
||||
USERNAME_OR_PASSWORD_ERROR("S0400", "用户名或密码错误!"),
|
||||
PASSWORD_ENTER_EXCEED_LIMIT("S0401", "用户输入密码次数超限!"),
|
||||
USER_NOT_LOGIN("S0402", "用户未登陆!"),
|
||||
AUTHENTICATION_FAILED("S0403", "认证失败!"),
|
||||
TOKEN_INVALID("S0404", "无效token!"),
|
||||
TOKEN_EXPIRED("S0405", "token已过期!"),
|
||||
ACCESS_DENY("S0406", "访问未授权!"),
|
||||
ACCESS_SCOPE_ERROR("S0407", "客户端权限范围出错"),
|
||||
GATEWAY_EXECUTION_TIMEOUT("S0408", "网关执行超时"),
|
||||
GATEWAY_EXECUTION_ERROR("S0409", "网关执行出错"),
|
||||
// 业务错误 B
|
||||
BUSSINESS_ERROR("B0400", "业务出错"),
|
||||
PARAM_IS_NULL("B0401", "请求参数为空"),
|
||||
PARAM_ERROR("B0402", "用户请求参数错误"),
|
||||
UPLOAD_FILE_ERROR("B0403", "用户上传文件异常"),
|
||||
UPLOAD_FILE_TYPE_NOT_MATCH("B0404", "用户上传文件类型不匹配"),
|
||||
UPLOAD_FILE_SIZE_EXCEEDS("B0405", "用户上传文件太大"),
|
||||
|
||||
// 数据库错误 D
|
||||
DATABASE_ERROR("D0400", "数据库服务出错"),
|
||||
DATA_EXIST("D0401", "此数据已存在!"),
|
||||
DATABASE_RESULT_NULL("D0402", "查询结果为空"),
|
||||
DATABASE_TABLE_NOT_EXIST("D0403", "表不存在"),
|
||||
DATABASE_COLUMN_NOT_EXIST("D0404", "列不存在"),
|
||||
SQL_RUN_ERROR("D0405", "sql运行异常"),
|
||||
REDIS_ERROR("D0410", "REDIS数据出错"),
|
||||
|
||||
// 小程序 w
|
||||
WECHAT_LOGIN_ERROR("W0400", "小程序登录异常"),
|
||||
WECHAT_SERRION_ERROR("W0401", "小程序登录态异常"),
|
||||
WECHAT_API_ERROR("W0402", "小程序接口调用异常"),
|
||||
WECHAT_NOT_LOGIN("W0403", "用户未登陆!"),
|
||||
WECHAT_TOKEN_INVALID("W0404", "无效token!"),
|
||||
WECHAT_TOKEN_EXPIRED("W0405", "token已过期!");
|
||||
|
||||
String code;
|
||||
|
||||
String msg;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
CodeMsg(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static CodeMsg getCodeMsgByCode(String code){
|
||||
Map<String, CodeMsg> map = Arrays.stream(CodeMsg.values()).collect(Collectors.toMap(CodeMsg::getCode, v->v));
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
|
||||
public final class ErrorConstants {
|
||||
|
||||
public static final String LOGIN_ERROR_NOT_LOGIN_IN = "您尚未登录,请登录后操作!";
|
||||
public static final String LOGIN_ERROR_FORBIDDEN = "该帐号已经被禁止登录!";
|
||||
public static final String LOGIN_ERROR_INCORRECT = "用户名或者密码错误!";
|
||||
public static final String LOGIN_ERROR_NOTFOUND = "用户名不存在!";
|
||||
public static final String LOGIN_ERROR_EXPIRED = "您的登录已过期,请重新登录!";
|
||||
public static final String LOGIN_ERROR_FORBID_LOGGED_IN_ELSEWHERE = "您的账号已在其它地方登录,您被禁止登录!";
|
||||
public static final String LOGIN_ERROR__KICK_OUT_LOGGED_IN_ELSEWHERE = "您的账号在另一台设备上登录,如非本人操作,请立即修改密码!";
|
||||
public static final String LOGIN_ERROR_ERROR_VALIDATE_CODE = "您输入的验证码不正确,请重新输入!";
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
public enum OrderStatusEnums {
|
||||
|
||||
CREATE(1, "已创建"),
|
||||
|
||||
SWAP(2, "换电中"),
|
||||
|
||||
SWAPOVER(3, "换电完成"),
|
||||
|
||||
CHARGING(4, "充电中"),
|
||||
|
||||
CHARGED(5, "充电完成"),
|
||||
|
||||
TOPAY(6, "待结算"),
|
||||
|
||||
FINISH(7, "已完成"),
|
||||
|
||||
SETTLEMENT_IN_PROGRESS(8, "结算中"),
|
||||
|
||||
CANCLE(9, "已取消"),
|
||||
|
||||
REFUND(-1, "订单退款"),
|
||||
|
||||
REFUND_PART(-2, "订单不分退款"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
Integer code;
|
||||
|
||||
String name;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
OrderStatusEnums(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.evotech.hd.core.enums;
|
||||
|
||||
/**
|
||||
* 枚举
|
||||
*
|
||||
* @ClassName:SwapBatteryStepEnum
|
||||
* @date: 2025年06月23日 16:08
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public enum SwapBatteryStepEnum{
|
||||
|
||||
// @Schema(description = "步骤:1-车辆进站,2-车辆到达指定位置,3-对中机构,4-取新电,5-拆旧电,6-装新电,7-放旧电,8-完成")
|
||||
VEHICLES_ENTER_STATION(1, "车辆进站"),
|
||||
|
||||
VEHICLE_POSITION(2, "车辆到达指定位置"),
|
||||
|
||||
INSTITUTIONS_FOR_CHINA(3, "对中机构"),
|
||||
|
||||
DISMANTLE_OLD_ELECTRICITY(4, "拆旧电"),
|
||||
|
||||
DISCHARGE_OLD_ELECTRICITY(5, "放旧电"),
|
||||
|
||||
GET_NEW_ELECTRICITY(6, "取新电"),
|
||||
|
||||
INSTALL_NEW_ELECTRICITY(7, "装新电"),
|
||||
|
||||
COMPLETED(8, "完成"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
Integer code;
|
||||
|
||||
String name;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
SwapBatteryStepEnum(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static String getName(Integer code){
|
||||
if(code == null){
|
||||
return "";
|
||||
}
|
||||
for(SwapBatteryStepEnum swapBatteryStep : values()){
|
||||
if(swapBatteryStep.getCode().equals(code)){
|
||||
return swapBatteryStep.getName();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.AccessStrategyDTO;
|
||||
import com.evotech.hd.core.entity.system.AccessStrategy;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface AccessStrategyWrapper extends EntityWrapper <AccessStrategyDTO, AccessStrategy> {
|
||||
|
||||
AccessStrategyWrapper INSTANCE = Mappers.getMapper ( AccessStrategyWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.BatteryCompartmentDTO;
|
||||
import com.evotech.hd.core.entity.business.BatteryCompartment;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface BatteryCompartmentWrapper extends EntityWrapper <BatteryCompartmentDTO, BatteryCompartment> {
|
||||
|
||||
BatteryCompartmentWrapper INSTANCE = Mappers.getMapper ( BatteryCompartmentWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.BatteryStrategyDTO;
|
||||
import com.evotech.hd.core.entity.system.BatteryStrategy;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface BatteryStrategyWrapper extends EntityWrapper <BatteryStrategyDTO, BatteryStrategy> {
|
||||
|
||||
BatteryStrategyWrapper INSTANCE = Mappers.getMapper ( BatteryStrategyWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.BatteryDTO;
|
||||
import com.evotech.hd.core.entity.business.Battery;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:BatteryWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface BatteryWrapper extends EntityWrapper <BatteryDTO, Battery> {
|
||||
|
||||
BatteryWrapper INSTANCE = Mappers.getMapper ( BatteryWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface EntityWrapper<D, E> {
|
||||
|
||||
@Mapping(target = "extendeds", source = "extendeds", qualifiedByName = "mapToString")
|
||||
E toEntity(D dto);
|
||||
|
||||
@Mapping(target = "extendeds", source = "extendeds", qualifiedByName = "mapToString")
|
||||
D toDTO(E entity);
|
||||
|
||||
List <E> toEntity(List <D> dtoList);
|
||||
|
||||
|
||||
List <D> toDTO(List <E> entityList);
|
||||
|
||||
|
||||
Page <E> toEntity(Page <D> page);
|
||||
|
||||
Page <D> toDTO(Page <E> page);
|
||||
|
||||
// 自定义转换方法:Map -> String (JSON)
|
||||
@Named("mapToString")
|
||||
default String mapToString(Map<String, Object> map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
return objectMapper.writeValueAsString(map);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException("Failed to convert map to JSON string", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.OrderChargingDTO;
|
||||
import com.evotech.hd.core.entity.business.OrderCharging;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface OrderChargingWrapper extends EntityWrapper <OrderChargingDTO, OrderCharging> {
|
||||
|
||||
OrderChargingWrapper INSTANCE = Mappers.getMapper ( OrderChargingWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.OrderReservationDTO;
|
||||
import com.evotech.hd.core.entity.business.OrderReservation;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface OrderReservationWrapper extends EntityWrapper <OrderReservationDTO, OrderReservation> {
|
||||
|
||||
OrderReservationWrapper INSTANCE = Mappers.getMapper ( OrderReservationWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
import com.evotech.hd.core.dtos.business.OrderReservationDTO;
|
||||
import com.evotech.hd.core.dtos.business.OrderSwapDTO;
|
||||
import com.evotech.hd.core.entity.business.OrderReservation;
|
||||
import com.evotech.hd.core.entity.business.OrderSwap;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:OrderReservationWrapper
|
||||
* @date: 2025年08月20日 15:17
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface OrderSwapWrapper extends EntityWrapper <OrderSwapDTO, OrderSwap> {
|
||||
|
||||
OrderSwapWrapper INSTANCE = Mappers.getMapper ( OrderSwapWrapper.class );
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
|
||||
*/
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
|
||||
import com.evotech.hd.core.dtos.system.ParamsDTO;
|
||||
import com.evotech.hd.core.entity.system.Params;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* ParamsWrapper
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface ParamsWrapper extends EntityWrapper <ParamsDTO, Params> {
|
||||
|
||||
ParamsWrapper INSTANCE = Mappers.getMapper ( ParamsWrapper.class );
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
|
||||
*/
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
|
||||
import com.evotech.hd.core.dtos.business.RunningInstructionsDetailDTO;
|
||||
import com.evotech.hd.core.entity.business.RunningInstructionsDetail;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* RunningInstructionsDetailWrapper
|
||||
*
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface RunningInstructionsDetailWrapper extends EntityWrapper <RunningInstructionsDetailDTO, RunningInstructionsDetail> {
|
||||
|
||||
RunningInstructionsDetailWrapper INSTANCE = Mappers.getMapper ( RunningInstructionsDetailWrapper.class );
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
|
||||
*/
|
||||
package com.evotech.hd.core.mapstruct;
|
||||
|
||||
|
||||
import com.evotech.hd.core.dtos.business.RunningInstructionsDTO;
|
||||
import com.evotech.hd.core.dtos.system.ParamsDTO;
|
||||
import com.evotech.hd.core.entity.business.RunningInstructions;
|
||||
import com.evotech.hd.core.entity.system.Params;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* RunningInstructionsWrapper
|
||||
*/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
|
||||
public interface RunningInstructionsWrapper extends EntityWrapper <RunningInstructionsDTO, RunningInstructions> {
|
||||
|
||||
RunningInstructionsWrapper INSTANCE = Mappers.getMapper ( RunningInstructionsWrapper.class );
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.evotech.hd.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 指令下发异常
|
||||
*
|
||||
* @ClassName:MongoDBException
|
||||
* @date: 2025年04月30日 8:56
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class InstructionException extends Exception{
|
||||
|
||||
public InstructionException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InstructionException(Exception e) {
|
||||
super(e);
|
||||
log.error("instruction 指令下发出现异常============{}", e.getMessage());
|
||||
}
|
||||
|
||||
public InstructionException(String message) {
|
||||
super(message);
|
||||
log.error("instruction 指令下发出现异常============{}", message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.evotech.hd.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 指令下发异常
|
||||
*
|
||||
* @ClassName:MongoDBException
|
||||
* @date: 2025年04月30日 8:56
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class UnauthorizedException extends Exception{
|
||||
|
||||
public UnauthorizedException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public UnauthorizedException(Exception e) {
|
||||
super(e);
|
||||
}
|
||||
|
||||
public UnauthorizedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
34
commoms/core/src/main/java/com/evotech/hd/query/Query.java
Normal file
34
commoms/core/src/main/java/com/evotech/hd/query/Query.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.evotech.hd.query;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 查询字段注解
|
||||
*/
|
||||
@Inherited
|
||||
@Documented
|
||||
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Query {
|
||||
/**
|
||||
* java属性名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String javaField() default "";
|
||||
|
||||
/**
|
||||
* mapper中的数据库字段名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String tableColumn() default "";
|
||||
|
||||
/**
|
||||
* 查询类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
QueryType type() default QueryType.LIKE;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.evotech.hd.query;
|
||||
|
||||
public enum QueryType {
|
||||
EQ,
|
||||
NE,
|
||||
GT,
|
||||
GE,
|
||||
LT,
|
||||
LE,
|
||||
BETWEEN,
|
||||
NOTBETWEEN,
|
||||
LIKE,
|
||||
NOTLIKE,
|
||||
LIKELEFT,
|
||||
LIKERIGHT,
|
||||
IN
|
||||
}
|
||||
318
commoms/core/src/main/java/com/evotech/hd/utils/Collections.java
Normal file
318
commoms/core/src/main/java/com/evotech/hd/utils/Collections.java
Normal file
@ -0,0 +1,318 @@
|
||||
package com.evotech.hd.utils;
|
||||
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @DES 集合类型工具类
|
||||
* @author andy.shi
|
||||
* @createDate 2020年12月25日下午2:16:13
|
||||
* @typeName Collections
|
||||
*/
|
||||
public class Collections implements Serializable{
|
||||
|
||||
static Logger log = LoggerFactory.getLogger(Collections.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -611031509912595162L;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ts
|
||||
* @return
|
||||
*/
|
||||
public static <T> boolean isEmpty(T[] ts) {
|
||||
return ts == null || ts.length == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ts
|
||||
* @return
|
||||
*/
|
||||
public static <T> boolean isNotEmpty(T[] ts) {
|
||||
return ! isEmpty(ts);
|
||||
}
|
||||
|
||||
/************************ 以上为公共方法 以下为list ************************************************/
|
||||
/**
|
||||
* @DES 检查集合为空
|
||||
* @author andy.shi
|
||||
* @createDate 2020年12月25日下午2:14:43
|
||||
* @methodName Collections.isEmpty
|
||||
* @param list
|
||||
* @return
|
||||
* @returnType boolean
|
||||
*/
|
||||
public static boolean isEmpty(Collection list) {
|
||||
return list == null || list.size() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @DES 检查集合不为空
|
||||
* @author andy.shi
|
||||
* @createDate 2020年12月25日下午2:15:07
|
||||
* @methodName Collections.isNotEmpty
|
||||
* @param collection
|
||||
* @return
|
||||
* @returnType boolean
|
||||
*/
|
||||
public static boolean isNotEmpty(Collection collection) {
|
||||
return ! (isEmpty(collection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将list进行分页
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月15日上午9:37:07
|
||||
* @param <T> 泛型, 根据传入的对对象类型,返回类型
|
||||
* @param list 需要分组的集合
|
||||
* @param pageNum 当前页数
|
||||
* @param pageSize 每页显示的条数
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> pageList(List<T> list, Integer pageNum, Integer pageSize){
|
||||
if(isEmpty(list)) {
|
||||
log.warn(String.format("[info " + Collections.class.getName() + " 执行信息] : list info: [%s] 为空", new Object[]{list}));
|
||||
return list;
|
||||
}
|
||||
try {
|
||||
//如果当前页为0, 更改为1
|
||||
if(pageNum == 0)
|
||||
pageNum = 1;
|
||||
//计算formIndex
|
||||
Integer fromIndex = ((pageNum-1)*pageSize);
|
||||
//计算toIndex
|
||||
Integer toIndex = fromIndex + pageSize;
|
||||
//防止下标越界
|
||||
if(toIndex > list.size())
|
||||
toIndex = list.size();
|
||||
log.info(String.format("[info " + Collections.class.getName() + " 执行信息] : list info: [%s] and pageNum info:[%s] and pageSize info: [%s]", new Object[]{list, pageNum, pageSize}));
|
||||
return list.subList(fromIndex, toIndex);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "pageList"}),e);
|
||||
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: list info: [%s] and pageNum info:[%s] and pageSize info: [%s] ", new Object[]{list, pageNum, pageSize}), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建对象
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月15日上午9:37:07
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> emptyList() {
|
||||
return new LinkedList<T>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @DES 数组转对象
|
||||
* @author andy.shi
|
||||
* @createDate 2020年12月25日下午2:09:14
|
||||
* @methodName Collections.asList
|
||||
* @param objs
|
||||
* @return
|
||||
* @returnType List<T>
|
||||
*/
|
||||
public static <T> List<T> asList(T... objs) {
|
||||
if (isEmpty(objs))
|
||||
return emptyList();
|
||||
|
||||
List<T> list = emptyList();
|
||||
for (T obj : objs)
|
||||
list.add(obj);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param objs
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> asList(Collection<T> objs) {
|
||||
if (isEmpty(objs))
|
||||
return emptyList();
|
||||
|
||||
List<T> list = emptyList();
|
||||
list.addAll(objs);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除集合的重复项
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月24日上午9:09:07
|
||||
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() 和 equals()
|
||||
* @param list1 去重的集合1
|
||||
* @param list2 去重的集合2
|
||||
* @return list 去重后的对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> List<T> removeDuplicatesList(List<T> list1, List<T> list2){
|
||||
return removeDuplicatesList(new List[] {list1, list2});
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除集合的重复项
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月24日上午9:13:09
|
||||
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() 和 equals()
|
||||
* @param listArray 去重的集合数组
|
||||
* @return list 去重后的对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> List<T> removeDuplicatesList(List<T>... listArray){
|
||||
try {
|
||||
List<T> listAll = emptyList();
|
||||
if(listArray == null || listArray.length == 0) {
|
||||
log.warn("[info " + Collections.class.getName() + " 执行信息] : 数据集合为空, 返回空对象 ");
|
||||
return emptyList();
|
||||
}
|
||||
for (List<T> list : listArray) {
|
||||
if(isNotEmpty(list)) {
|
||||
listAll.addAll(list);
|
||||
}
|
||||
}
|
||||
return (List<T>) listAll.stream().distinct().collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "removeDuplicatesList"}),e);
|
||||
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: listArray info: [%s] 去除重复数据异常; ", new Object[]{listArray}), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取重复数据
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月24日上午9:46:03
|
||||
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() 和 equals()
|
||||
* @param list1 查重的集合1
|
||||
* @param list2 查重的集合1
|
||||
* @return 并集的数据集合
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> List<T> findDuplicatesList(List<T> list1, List<T> list2){
|
||||
return findDuplicatesList(new List[] {list1, list2});
|
||||
}
|
||||
/**
|
||||
* 获取重复数据
|
||||
* @author Andy.shi
|
||||
* @date 2020年9月24日上午9:44:30
|
||||
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() 和 equals()
|
||||
* @param listArray 需要查重的集合数组
|
||||
* @return 并集的数据集合
|
||||
*/
|
||||
public static <T> List<T> findDuplicatesList(List<T>... listArray){
|
||||
try {
|
||||
if(listArray == null || listArray.length == 0) {
|
||||
log.warn("[info " + Collections.class.getName() + " 执行信息] : 数据集合为空, 返回空对象 ");
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
if(listArray.length == 1) {
|
||||
log.warn("[info " + Collections.class.getName() + " 执行信息] : 集合数组只有一个, 不存在重复数据 ");
|
||||
return listArray[0];
|
||||
}
|
||||
List<T> firstList = listArray[0];
|
||||
|
||||
for (int i = 1; i < listArray.length; i++) {
|
||||
firstList.retainAll(listArray[i]);
|
||||
}
|
||||
return firstList;
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "findDuplicatesList"}),e);
|
||||
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: listArray info: [%s] 获取重复数据异常; ", new Object[]{listArray}), e);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取随机元素
|
||||
* @param list
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public static <T> T getRandomElement(List<T> list) {
|
||||
if(isEmpty(list)) {
|
||||
log.warn("[info " + Collections.class.getName() + " 执行 getRandomElement 信息] : 数据集合为空, 返回null ");
|
||||
return null;
|
||||
}
|
||||
Random random = new Random();
|
||||
int index = random.nextInt(list.size());
|
||||
return list.get(index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************** 以上操作list 以下操作map **************************************/
|
||||
/**
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNotEmpty(Map<?, ?> map) {
|
||||
return ! isEmpty(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public static boolean isEmpty(Map<?, ?> map) {
|
||||
return map == null || map.size() == 0;
|
||||
}
|
||||
/**
|
||||
* @DES 创建空的map对象
|
||||
* @author andy.shi
|
||||
* @company 龙腾工作室
|
||||
* @createDate 2020年12月25日下午1:36:35
|
||||
* @methodName MapLists.emptyMap
|
||||
* @return
|
||||
* @returnType Map<k,v>
|
||||
*/
|
||||
public static final <K, V> Map<K, V> emptyMap() {
|
||||
return new LinkedHashMap<K, V>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @DES 组装map数据对象
|
||||
* @author andy.shi
|
||||
* @createDate 2020年12月25日下午1:37:05
|
||||
* @methodName MapLists.createMap
|
||||
* @param args
|
||||
* @return
|
||||
* @returnType Map<k,v>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <K, V> Map<K, V> asMap(Object... args) {
|
||||
Map<K, V> map = emptyMap();
|
||||
if (args == null || args.length == 0) {
|
||||
log.warn(String.format("[info " + Collections.class.getName() + " 执行信息] : params的参数不为偶数; args length: [%s]; args info: [%s] ", new Object[]{args.length, args}));
|
||||
return map;
|
||||
} else if (args.length % 2 != 0) {
|
||||
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: args must completely match: even param is key, odd param is value, please check your arguments. args length [%s]; args info: [%s]; ", new Object[]{args.length, args}));
|
||||
}
|
||||
for (int i=0; i<args.length;i+=2) {
|
||||
Object key = args[i];
|
||||
Object val = i + 1 < args.length ? args[i+1] : null;
|
||||
map.put( (K) key, (V) val);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/********************** 以上操作map 以下操作公共方法 **************************************/
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.evotech.hd.utils;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class CommonUtil {
|
||||
public static final String BASE_NUMBER = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
public static String swapBatteryOrderNo(String stationCode) {
|
||||
String orderNoPrefix = "YTSO";
|
||||
String orderNoMiddle2 = DateUtils.dateTimeNow("yyyyMMddHHmmss");
|
||||
Integer red = 32-14-4-stationCode.length();
|
||||
String orderNoSuffix="";
|
||||
if(red > 0){
|
||||
orderNoSuffix = randomString(red);
|
||||
}
|
||||
return orderNoPrefix + stationCode + orderNoMiddle2 + orderNoSuffix;
|
||||
}
|
||||
|
||||
public static String randomString(int length) {
|
||||
if (length < 1) {
|
||||
length = 1;
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder(length);
|
||||
final int baseLength = BASE_NUMBER.length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
final int number = ThreadLocalRandom.current().nextInt(baseLength);
|
||||
sb.append(BASE_NUMBER.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
144
commoms/core/src/main/java/com/evotech/hd/utils/DataUtils.java
Normal file
144
commoms/core/src/main/java/com/evotech/hd/utils/DataUtils.java
Normal file
@ -0,0 +1,144 @@
|
||||
package com.evotech.hd.utils;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.lang.model.util.Elements;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:DataUtils
|
||||
* @date: 2025年06月03日 10:25
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
public class DataUtils {
|
||||
|
||||
public static final BigDecimal DEFAULT_VALUE = new BigDecimal(0);
|
||||
|
||||
|
||||
public static <T> T findDefaultValue(T v, T dv){
|
||||
if(ObjectUtils.isNotEmpty(v)){
|
||||
return v;
|
||||
}
|
||||
return dv;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String filePath = "D:\\andy\\文档\\云平台\\站控\\RGVIO.xml"; // 包含XML内容的TXT文件路径
|
||||
|
||||
try {
|
||||
// 1. 读取TXT文件内容
|
||||
String fileContent = readTxtFile(filePath);
|
||||
|
||||
if (fileContent == null || fileContent.isEmpty()) {
|
||||
System.out.println("文件内容为空或读取失败");
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 将文件内容解析为Document对象
|
||||
Document document = parseToDocument(fileContent);
|
||||
|
||||
if (document != null) {
|
||||
System.out.println("文件解析成功!");
|
||||
System.out.println("根节点名称: " + document.getDocumentElement().getNodeName());
|
||||
|
||||
NodeList nodeList = document.getElementsByTagName("IOITEM");
|
||||
int id = 848;
|
||||
for (int i = 0; i < nodeList.getLength(); i++) {
|
||||
Node node = nodeList.item(i);
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
Element element = (Element) node;
|
||||
String name = element.getAttribute("name");
|
||||
String dispname = element.getAttribute("dispname");
|
||||
String dt = element.getAttribute("dt"); // 带命名空间的属性
|
||||
String param = element.getAttribute("param"); // 带命名空间的属性
|
||||
String desc = element.getAttribute("desc");
|
||||
|
||||
// INSERT INTO `zk`.`sc_sys_params` (`id`, `group_id`, `name`, `param_value`, `extendeds`, `create_time`, `param_code`, `description`, `expected_results`, `verify_result`, `err_message`)
|
||||
//
|
||||
// VALUES (838, 2, '电池仓电池数据2', 'BSL:num_BatDataInfo2', '{\"dataType\":\"STRING\"}', '2025-08-22 17:30:13', 'BSL_BatDataInfo2', '软件初始安装时, 直接初始化', NULL, 0, NULL);
|
||||
|
||||
System.out.println("INSERT INTO `zk`.`sc_sys_params` (`id`, `group_id`, `name`, `param_value`, `extendeds`, `create_time`, `param_code`, `description`, `expected_results`, `verify_result`, `err_message`) " +
|
||||
"VALUES ("+(id+i)+", 2, '"+desc+"', '"+param.replaceAll("\\d+",":num")+"', '{\"dataType\":\""+dt+"\"}', now(), '"+dispname.replaceAll("\\d+","")+"', '软件初始安装时, 直接初始化', NULL, 0, NULL);");
|
||||
}
|
||||
}
|
||||
|
||||
// 这里可以添加对Document的进一步操作
|
||||
// 例如:获取节点、修改内容等
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取TXT文件内容
|
||||
* @param filePath 文件路径
|
||||
* @return 文件内容字符串
|
||||
*/
|
||||
private static String readTxtFile(String filePath) {
|
||||
StringBuilder content = new StringBuilder();
|
||||
|
||||
try (BufferedReader br = new BufferedReader(
|
||||
new InputStreamReader(
|
||||
new FileInputStream(filePath),
|
||||
StandardCharsets.UTF_8))) {
|
||||
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
content.append(line).append("\n");
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
System.err.println("文件未找到: " + filePath);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
System.err.println("读取文件时发生错误");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
return content.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串内容解析为Document对象
|
||||
* @param content 包含XML的字符串
|
||||
* @return Document对象
|
||||
* @throws ParserConfigurationException 解析器配置异常
|
||||
* @throws IOException IO异常
|
||||
* @throws SAXException SAX解析异常
|
||||
*/
|
||||
private static Document parseToDocument(String content)
|
||||
throws ParserConfigurationException, IOException, SAXException {
|
||||
|
||||
// 创建DocumentBuilderFactory
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
|
||||
// 创建DocumentBuilder
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
|
||||
// 将字符串内容转换为InputSource
|
||||
InputSource inputSource = new InputSource(new StringReader(content));
|
||||
|
||||
// 解析为Document对象
|
||||
return builder.parse(inputSource);
|
||||
}
|
||||
}
|
||||
321
commoms/core/src/main/java/com/evotech/hd/utils/DateUtils.java
Normal file
321
commoms/core/src/main/java/com/evotech/hd/utils/DateUtils.java
Normal file
@ -0,0 +1,321 @@
|
||||
package com.evotech.hd.utils;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
|
||||
public static String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
|
||||
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
{
|
||||
return new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow(final String format)
|
||||
{
|
||||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String parseDateToStr(final String format, final Date date)
|
||||
{
|
||||
return new SimpleDateFormat(format).format(date);
|
||||
}
|
||||
|
||||
public static final Date dateTime(final String format, final String ts)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat(format).parse(ts);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如20180808
|
||||
*/
|
||||
public static final String dateTime()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
*/
|
||||
public static Date parseDate(Object str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
return parseDate(str.toString(), parsePatterns);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器启动时间
|
||||
*/
|
||||
public static Date getServerStartDate()
|
||||
{
|
||||
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
return new Date(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算相差天数
|
||||
*/
|
||||
public static int differentDaysByMillisecond(Date date1, Date date2)
|
||||
{
|
||||
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算时间差
|
||||
*
|
||||
* @param endDate 最后时间
|
||||
* @param startTime 开始时间
|
||||
* @return 时间差(天/小时/分钟)
|
||||
*/
|
||||
public static String timeDistance(Date endDate, Date startTime)
|
||||
{
|
||||
long nd = 1000 * 24 * 60 * 60;
|
||||
long nh = 1000 * 60 * 60;
|
||||
long nm = 1000 * 60;
|
||||
// long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - startTime.getTime();
|
||||
// 计算差多少天
|
||||
long day = diff / nd;
|
||||
// 计算差多少小时
|
||||
long hour = diff % nd / nh;
|
||||
// 计算差多少分钟
|
||||
long min = diff % nd % nh / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
// long sec = diff % nd % nh % nm / ns;
|
||||
return day + "天" + hour + "小时" + min + "分钟";
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加 LocalDateTime ==> Date
|
||||
*/
|
||||
public static Date toDate(LocalDateTime temporalAccessor)
|
||||
{
|
||||
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加 LocalDate ==> Date
|
||||
*/
|
||||
public static Date toDate(LocalDate temporalAccessor)
|
||||
{
|
||||
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
|
||||
public static Integer getBetweenYear(Date start, Date end, Integer offsetDay){
|
||||
Calendar cal1 = Calendar.getInstance();
|
||||
cal1.setTime(start);
|
||||
Long days = new BigDecimal(getBetweenDays(start, end)).add(new BigDecimal(offsetDay)).longValue();
|
||||
int yearsDiff = 0;
|
||||
long remainingDays = days;
|
||||
while (remainingDays >= 365) {
|
||||
int year = cal1.get(Calendar.YEAR) + yearsDiff;
|
||||
//int daysInYear = ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ? 366 : 365;
|
||||
int daysInYear = 365;
|
||||
if (remainingDays >= daysInYear) {
|
||||
remainingDays -= daysInYear;
|
||||
yearsDiff++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return yearsDiff;
|
||||
}
|
||||
|
||||
public static Integer getBetweenYearByDays(Date start, Date end){
|
||||
return getBetweenYear(start, end, 0);
|
||||
}
|
||||
|
||||
public static Integer getBetweenMonth(Date start, Date end){
|
||||
Calendar currentDate = Calendar.getInstance();
|
||||
currentDate.setTime(start);
|
||||
|
||||
// 将输入的Date转换为Calendar以便获取年月信息
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(end);
|
||||
// 计算年份差和月份差
|
||||
int yearsDiff = endCalendar.get(Calendar.YEAR) - currentDate.get(Calendar.YEAR);
|
||||
int monthsDiff = endCalendar.get(Calendar.MONTH) - currentDate.get(Calendar.MONTH);
|
||||
|
||||
// 调整月份差,考虑到年份差可能影响实际的月份数差异
|
||||
monthsDiff += yearsDiff * 12;
|
||||
|
||||
return monthsDiff;
|
||||
}
|
||||
|
||||
public static Date getMonthFirst(Date date){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getMonthEnd(Date date){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Integer getYear(Date date){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
return calendar.get(Calendar.YEAR);
|
||||
}
|
||||
|
||||
public static Integer getMonth(Date date){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
return calendar.get(Calendar.MONTH)+1;
|
||||
}
|
||||
|
||||
public static Integer getMonthDays(Date date){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.DAY_OF_MONTH,1);
|
||||
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
public static Long getBetweenDays(Date start, Date end){
|
||||
Calendar currentDate = Calendar.getInstance();
|
||||
currentDate.setTime(start);
|
||||
|
||||
// 将输入的Date转换为Calendar以便获取年月信息
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(end);
|
||||
return calculateDifferenceInDays(endCalendar, currentDate);
|
||||
}
|
||||
|
||||
public static Long getBetweenMinutes(Date start, Date end){
|
||||
Calendar currentDate = Calendar.getInstance();
|
||||
currentDate.setTime(start);
|
||||
// 将输入的Date转换为Calendar以便获取年月信息
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(end);
|
||||
long diffInMillis = endCalendar.getTimeInMillis() - currentDate.getTimeInMillis();
|
||||
return diffInMillis / (60 * 1000);
|
||||
}
|
||||
|
||||
public static long calculateDifferenceInDays(Calendar date1, Calendar date2) {
|
||||
long diffInMillies = Math.abs(date1.getTimeInMillis() - date2.getTimeInMillis());
|
||||
return diffInMillies / (24 * 60 * 60 * 1000); // 将毫秒转换为天
|
||||
}
|
||||
|
||||
public static List<String> getCurrentMonthAndDays(){
|
||||
return getMonthAndDays(DateUtils.getNowDate());
|
||||
}
|
||||
public static List<String> getMonthAndDays(Date date){
|
||||
List<String> dayList = new ArrayList<String>();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
SimpleDateFormat sdfm = new SimpleDateFormat("yyyy-MM");
|
||||
for(int p=1;p<=days;p++){
|
||||
try{
|
||||
String rq = sdfm.format(date)+"-";
|
||||
if(p < 10){
|
||||
rq += "0" + p;
|
||||
}else {
|
||||
rq += p;
|
||||
}
|
||||
dayList.add(rq);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return dayList;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.evotech.hd.utils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* EntityUtils
|
||||
*
|
||||
* @author andy.shi
|
||||
* @ClassName:EntityUtils
|
||||
* @date: 2025年09月28日 8:49
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class EntityUtils {
|
||||
|
||||
public static <T> Map<String, Object> converToMap(T t){
|
||||
Map<String, Object> map = Collections.emptyMap();
|
||||
try {
|
||||
Class<?> clazz = t.getClass();
|
||||
while (clazz != null){
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field field : fields){
|
||||
field.setAccessible(true);
|
||||
Object val = field.get(t);
|
||||
map.put(field.getName(), val);
|
||||
}
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("entity 转 Map 出现错误; entity信息为: {}, 错误信息为: {}", t.getClass().getName(), e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
30
commoms/mongodb/pom.xml
Normal file
30
commoms/mongodb/pom.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>commoms</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>mongodb</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>5.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,105 @@
|
||||
package com.evotech.hd.config;
|
||||
|
||||
import com.mongodb.ConnectionString;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.mongodb.MongoDatabaseFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* mongodb基础连接类
|
||||
*
|
||||
* @ClassName:AbstractMongoDbConfig
|
||||
* @date: 2025年08月12日
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
public abstract class AbstractMongoDbConfig{
|
||||
|
||||
// MongoDB Properties
|
||||
@Value("${yt.base_properties.uri:}")
|
||||
private String uri;
|
||||
@Value("${yt.base_properties.user_name:''}")
|
||||
private String userName;
|
||||
@Value("${yt.base_properties.password:''}")
|
||||
private String password;
|
||||
@Value("${yt.base_properties.host:''}")
|
||||
private String host;
|
||||
@Value("${yt.base_properties.authentication-database:''}")
|
||||
private String authenticationDataBase;
|
||||
private String dataBase;
|
||||
@Value("${yt.base_properties.port:''}")
|
||||
private Integer port;
|
||||
|
||||
|
||||
public MongoDatabaseFactory mongoDbFactory(){
|
||||
//String connectionString = "mongodb://" + userName + ":" + password+ "@"+ host+":"+port+"/" + dataBase+"?authSource="+authenticationDataBase;
|
||||
return new SimpleMongoClientDatabaseFactory(getConnectionString());
|
||||
}
|
||||
|
||||
private ConnectionString getConnectionString(){
|
||||
if (StringUtils.hasText(uri)) {
|
||||
return new ConnectionString(uri);
|
||||
}
|
||||
StringBuilder builder = new StringBuilder("mongodb://");
|
||||
if (StringUtils.hasText(userName)) {
|
||||
builder.append(encode(userName));
|
||||
builder.append(":");
|
||||
if (StringUtils.hasText(password)) {
|
||||
builder.append(encode(password));
|
||||
}
|
||||
builder.append("@");
|
||||
}
|
||||
builder.append((StringUtils.hasText(host)) ? host : "localhost");
|
||||
if (port != null) {
|
||||
builder.append(":");
|
||||
builder.append(port);
|
||||
}
|
||||
//集群多地址配置, 具体参考 propertiesMongoConnectionDetails
|
||||
// if (this.properties.getAdditionalHosts() != null) {
|
||||
// builder.append(",");
|
||||
// builder.append(String.join(",", this.properties.getAdditionalHosts()));
|
||||
// }
|
||||
builder.append("/");
|
||||
builder.append(dataBase);
|
||||
List<String> options = getOptions();
|
||||
if (!options.isEmpty()) {
|
||||
builder.append("?");
|
||||
builder.append(String.join("&", options));
|
||||
}
|
||||
return new ConnectionString(builder.toString());
|
||||
}
|
||||
|
||||
private String encode(String input) {
|
||||
return URLEncoder.encode(input, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private List<String> getOptions() {
|
||||
List<String> options = new ArrayList<>();
|
||||
//集群,名称. 具体参考 propertiesMongoConnectionDetails
|
||||
// if (this.properties.getReplicaSetName() != null) {
|
||||
// options.add("replicaSet=" + this.properties.getReplicaSetName());
|
||||
// }
|
||||
if (StringUtils.hasText(userName) && StringUtils.hasText(authenticationDataBase)) {
|
||||
options.add("authSource=" + authenticationDataBase);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
abstract public MongoTemplate getMongoTemplate() throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.evotech.hd.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
|
||||
|
||||
/**
|
||||
* 电表箱类
|
||||
*
|
||||
* @ClassName:BatteryInfoProperties
|
||||
* @date: 2025年04月29日 16:32
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "yt.electricity-meter-box", ignoreInvalidFields = true)
|
||||
public class ElectricityMeterBoxProperties extends AbstractMongoDbConfig {
|
||||
|
||||
@Bean("mongoTemplateBatteryBox")
|
||||
@Override
|
||||
public MongoTemplate getMongoTemplate() throws Exception {
|
||||
return new MongoTemplate(mongoDbFactory());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.evotech.hd.constant;
|
||||
|
||||
/**
|
||||
* MongoDB的静态类
|
||||
* @ClassName:MongoConstant
|
||||
* @date: 2025年04月29日 9:21
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
public class MongoConstant {
|
||||
|
||||
//电表箱子信息数据库
|
||||
public static final String ELECTRICITY_METER_BOX="electricity_meter_box";
|
||||
|
||||
public static final String SEPARATION = "_";
|
||||
/***
|
||||
* 或者查询, 示例
|
||||
* put(OR+"条件名称"+SEPARATION+"条件名称"...,"条件值"+SEPARATION+"条件值"....)
|
||||
*/
|
||||
public static final String OR = "or"+SEPARATION;
|
||||
/***
|
||||
* 条件查询, 示例
|
||||
* put(查询类型+"条件名称","条件值")
|
||||
*/
|
||||
public static final String EQ = "and";
|
||||
public static final String IN = "in";
|
||||
public static final String NOT_IN = "not_in";
|
||||
public static final String GT = "gt";
|
||||
public static final String GE = "ge";
|
||||
public static final String LT = "lt";
|
||||
public static final String LE = "le";
|
||||
public static final String REGEX = "regex";
|
||||
/***
|
||||
* 排序, 示例
|
||||
* put(SORT+SORT_ASC,"条件名称")
|
||||
*/
|
||||
public static final String SORT = "Sort";
|
||||
public static final String SORT_ASC ="asc";
|
||||
public static final String SORT_DESC = "desc";
|
||||
|
||||
/***
|
||||
* 排序, 示例
|
||||
* put(PAGE,"当前页"+SEPARATION+"每页显示的条数")
|
||||
*/
|
||||
public static final String PAGE = "page";
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.evotech.hd.documnet;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
* mongo基础类
|
||||
*
|
||||
* @ClassName:BaseDocumentIdEntity
|
||||
* @date: 2025年08月18日 13:45
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@Document
|
||||
public class BaseDocumentIdEntity {
|
||||
/***
|
||||
* 时间戳做id
|
||||
*/
|
||||
@Id
|
||||
String id;
|
||||
/***
|
||||
* 站端编号
|
||||
*/
|
||||
String stationCode;
|
||||
|
||||
/***
|
||||
* 读取信息
|
||||
*/
|
||||
String value;
|
||||
|
||||
public BaseDocumentIdEntity() {
|
||||
}
|
||||
|
||||
public BaseDocumentIdEntity(String stationCode, String value) {
|
||||
this.id = String.valueOf(System.currentTimeMillis());
|
||||
this.stationCode = stationCode;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.evotech.hd.documnet;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
* 电池实时信息
|
||||
* @ClassName:BatData
|
||||
* @date: 2025年08月18日 9:13
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
@Document
|
||||
public class BatteryInfo extends BaseDocumentIdEntity{
|
||||
/***
|
||||
* 电池编号
|
||||
*/
|
||||
String batteryCode;
|
||||
/***
|
||||
* 电池仓编号
|
||||
*/
|
||||
String batteryCompartmentNo;
|
||||
|
||||
/***
|
||||
* value 内容参考
|
||||
* 电池电量 SOC
|
||||
* 电池健康度 SOH
|
||||
* 电池额定容量 batteryRatedCapacity
|
||||
* 电池单体数量 batteryMonomerNum array[]
|
||||
* 温度探针数量 temperatureProbeNum array[]
|
||||
* 电池总电流 batteryTotalCurrent
|
||||
* 电池总电压 batteryTotalVoltage
|
||||
* 正极绝缘电阻 positivePoleInsulationResistance
|
||||
* 负极绝缘电阻 negativePoleInsulationResistance
|
||||
* 电池请求电压 batteryRequestVoltage
|
||||
* 电池请求电流 batteryRequestCurrent
|
||||
* 充电模块输出电压 chargingModuleOutputVoltage
|
||||
* 充电模块输出电流 chargingModuleOutputCurrent
|
||||
* 最高允许充电电压 maximumAllowableChargingVoltage
|
||||
* 最高允许充电电流 maximumAllowableChargingCurrent
|
||||
*/
|
||||
|
||||
public BatteryInfo() {
|
||||
}
|
||||
|
||||
public BatteryInfo(String batteryCode, String batteryCompartmentNo, String stationCode, String value) {
|
||||
super(stationCode,value);
|
||||
this.batteryCode = batteryCode;
|
||||
this.batteryCompartmentNo = batteryCompartmentNo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.evotech.hd.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:MongoDBException
|
||||
* @date: 2025年04月30日 8:56
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class MongoDBException extends Exception{
|
||||
|
||||
public MongoDBException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MongoDBException(Exception e) {
|
||||
super(e);
|
||||
log.error("mongodb 数据库存储异常============{}", e.getMessage());
|
||||
}
|
||||
|
||||
public MongoDBException(String message) {
|
||||
super(message);
|
||||
log.error("mongodb 数据库存储异常============{}", message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,217 @@
|
||||
package com.evotech.hd.service;
|
||||
|
||||
import com.evotech.hd.constant.MongoConstant;
|
||||
import com.evotech.hd.exception.MongoDBException;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:MongoDBService
|
||||
* @date: 2025年04月29日 8:45
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
public class MongoDBService {
|
||||
|
||||
@Resource
|
||||
private List<MongoTemplate> mongoTemplates;
|
||||
|
||||
private Map<String, MongoTemplate> mongoTemplateMap = new LinkedHashMap<>();
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
if(!CollectionUtils.isEmpty(mongoTemplates)){
|
||||
for (MongoTemplate mongoTemplate: mongoTemplates){
|
||||
mongoTemplateMap.put(mongoTemplate.getDb().getName(),mongoTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 单个对象保存
|
||||
* @param collectionName 保存的集合名称
|
||||
* @param document 保存的文档数据
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> T save(String database, String collectionName, T document) {
|
||||
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = getMongoTemplate(database, collectionName);
|
||||
} catch (MongoDBException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if(!mongoTemplate.collectionExists(collectionName)){
|
||||
mongoTemplate.createCollection(collectionName);
|
||||
}
|
||||
return mongoTemplate.save(document, collectionName);
|
||||
}
|
||||
|
||||
private MongoTemplate getMongoTemplate(String database, String collectionName) throws MongoDBException {
|
||||
Assert.hasText(database, "database name must not be null or empty");
|
||||
Assert.hasText(collectionName, "Collection name must not be null or empty");
|
||||
if(!StringUtils.hasText(database) || !StringUtils.hasText(database)){
|
||||
throw new MongoDBException("请求参数为空");
|
||||
}
|
||||
return mongoTemplateMap.get(database);
|
||||
}
|
||||
|
||||
/***
|
||||
* 批量保存
|
||||
* @param collectionName 保存的集合名称
|
||||
* @param batchToSave 保存的文档数据集合
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> Collection<T> saveBatch(String database, String collectionName, Collection<? extends T> batchToSave){
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = getMongoTemplate(database, collectionName);
|
||||
} catch (MongoDBException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if(!mongoTemplate.collectionExists(collectionName)){
|
||||
mongoTemplate.createCollection(collectionName);
|
||||
}
|
||||
return mongoTemplate.insert(batchToSave, collectionName);
|
||||
}
|
||||
|
||||
public <T> List<T> find(String database, String collectionName, Class<T> entityClass, Map<String,Object> params) {
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = getMongoTemplate(database, collectionName);
|
||||
} catch (MongoDBException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return mongoTemplate.find(buildQuery(params), entityClass, collectionName);
|
||||
}
|
||||
|
||||
public <T> Page<T> findPage(String database, String collectionName, Class<T> entityClass, Map<String,Object> params) {
|
||||
MongoTemplate mongoTemplate = null;
|
||||
try {
|
||||
mongoTemplate = getMongoTemplate(database, collectionName);
|
||||
} catch (MongoDBException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Query query = buildQuery(params);
|
||||
//计算总数
|
||||
long total = mongoTemplate.count(query, entityClass, collectionName);
|
||||
List<T> list = mongoTemplate.find(query, entityClass, collectionName);
|
||||
String pageInfo = String.valueOf(params.get(MongoConstant.PAGE));
|
||||
String[] pages = pageInfo.split(MongoConstant.SEPARATION);
|
||||
return new PageImpl(list, PageRequest.of(Integer.valueOf(pages[0]), Integer.valueOf(pages[1])), total);
|
||||
}
|
||||
|
||||
|
||||
// /***
|
||||
// * 单个对象保存
|
||||
// * @param collectionName 保存的集合名称
|
||||
// * @param document 保存的文档数据
|
||||
// * @return
|
||||
// * @param <T>
|
||||
// */
|
||||
// public <T> T save(String collectionName, T document){
|
||||
// Assert.hasText(collectionName, "Collection name must not be null or empty");
|
||||
// if(!mongoTemplate.collectionExists(collectionName)){
|
||||
// mongoTemplate.createCollection(collectionName);
|
||||
// }
|
||||
// return mongoTemplate.save(document, collectionName);
|
||||
// }
|
||||
//
|
||||
// /***
|
||||
// * 批量保存
|
||||
// * @param collectionName 保存的集合名称
|
||||
// * @param batchToSave 保存的文档数据集合
|
||||
// * @return
|
||||
// * @param <T>
|
||||
// */
|
||||
// public <T> Collection<T> saveBatch(String collectionName, Collection<? extends T> batchToSave){
|
||||
// Assert.hasText(collectionName, "Collection name must not be null or empty");
|
||||
// if(!mongoTemplate.collectionExists(collectionName)){
|
||||
// mongoTemplate.createCollection(collectionName);
|
||||
// }
|
||||
// return mongoTemplate.insert(batchToSave, collectionName);
|
||||
// }
|
||||
//
|
||||
// public <T> List<T> find(String collectionName, Class<T> entityClass, Map<String,Object> params) {
|
||||
// return mongoTemplate.find(buildQuery(params), entityClass, collectionName);
|
||||
// }
|
||||
//
|
||||
// public <T> Page<T> findPage(String collectionName, Class<T> entityClass, Map<String,Object> params) {
|
||||
// Query query = buildQuery(params);
|
||||
// //计算总数
|
||||
// long total = mongoTemplate.count(query, entityClass, collectionName);
|
||||
// List<T> list = mongoTemplate.find(query, entityClass, collectionName);
|
||||
// String pageInfo = String.valueOf(params.get(MongoConstant.PAGE));
|
||||
// String[] pages = pageInfo.split(MongoConstant.SEPARATION);
|
||||
// return new PageImpl(list, PageRequest.of(Integer.valueOf(pages[0]), Integer.valueOf(pages[1])), total);
|
||||
// }
|
||||
|
||||
|
||||
private static Query buildQuery(Map<String, Object> params){
|
||||
Query query = new Query();
|
||||
if(!CollectionUtils.isEmpty(params)){
|
||||
//解析参数中的key
|
||||
Iterator<String> itKey = params.keySet().iterator();
|
||||
while (itKey.hasNext()){
|
||||
String key = itKey.next();
|
||||
//解析查询类型
|
||||
String[] keyAndQueryType = key.split(MongoConstant.SEPARATION);
|
||||
//根据类型做查询
|
||||
switch (keyAndQueryType[0]){
|
||||
case MongoConstant.EQ:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).is(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.IN:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).in(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.NOT_IN:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).nin(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.GT:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).gt(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.GE:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).gte(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.LT:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).lt(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.LE:
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).lte(params.get(key)));
|
||||
break;
|
||||
case MongoConstant.REGEX:
|
||||
Pattern pattern = Pattern.compile(String.valueOf(params.get(key)));
|
||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).regex(pattern));
|
||||
break;
|
||||
case MongoConstant.SORT:
|
||||
query = query.with(Sort.by((MongoConstant.SORT_ASC.equals(keyAndQueryType[1]) ? Sort.Direction.ASC : Sort.Direction.DESC), (String) params.get(key)));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
||||
11
commoms/mongodb/src/main/resources/application-mongo.yml
Normal file
11
commoms/mongodb/src/main/resources/application-mongo.yml
Normal file
@ -0,0 +1,11 @@
|
||||
yt:
|
||||
base_properties:
|
||||
host: localhost
|
||||
port: 27017
|
||||
#用于账号密码验证的库
|
||||
authentication-database: admin
|
||||
user_name: root
|
||||
password:
|
||||
electricity-meter-box:
|
||||
#//数据存储的库
|
||||
data_base: electricity_meter_box
|
||||
11
commoms/mongodb/src/main/resources/application-mongoDev.yml
Normal file
11
commoms/mongodb/src/main/resources/application-mongoDev.yml
Normal file
@ -0,0 +1,11 @@
|
||||
yt:
|
||||
base_properties:
|
||||
host: 192.168.16.128
|
||||
port: 27017
|
||||
#用于账号密码验证的库
|
||||
authentication-database: admin
|
||||
user_name: root
|
||||
password: ythd2025
|
||||
electricity-meter-box:
|
||||
#//数据存储的库
|
||||
data_base: electricity_meter_box
|
||||
19
commoms/pom.xml
Normal file
19
commoms/pom.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>station_control</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>commoms</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>mongodb</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
37
pom.xml
Normal file
37
pom.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.5</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>station_control</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>commoms</module>
|
||||
<module>web-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>17</java.version>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<fastjson.version>2.0.43</fastjson.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
33
web-server/.gitignore
vendored
Normal file
33
web-server/.gitignore
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
268
web-server/pom.xml
Normal file
268
web-server/pom.xml
Normal file
@ -0,0 +1,268 @@
|
||||
<?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>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-parent</artifactId>-->
|
||||
<!-- <version>2.5.5</version>-->
|
||||
<!-- <relativePath/> <!– lookup parent from repository –>-->
|
||||
<!-- </parent>-->
|
||||
<parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>station_control</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<!-- <packaging>pom</packaging>-->
|
||||
</parent>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>web-server</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>web-server</name>
|
||||
<description>web-server</description>
|
||||
<url/>
|
||||
<licenses>
|
||||
<license/>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer/>
|
||||
</developers>
|
||||
<scm>
|
||||
<connection/>
|
||||
<developerConnection/>
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
<!-- <properties>-->
|
||||
<!-- <java.version>17</java.version>-->
|
||||
<!-- <druid.version>1.2.23</druid.version>-->
|
||||
<!-- <fastjson.version>2.0.43</fastjson.version>-->
|
||||
<!-- </properties>-->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.evotech.hd</groupId>
|
||||
<artifactId>mongodb</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlrpc</groupId>
|
||||
<artifactId>xmlrpc-client</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlrpc</groupId>
|
||||
<artifactId>xmlrpc-common</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.ros.rosjava_core</groupId>-->
|
||||
<!-- <artifactId>apache_xmlrpc_client</artifactId>-->
|
||||
<!-- <version>0.2.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 阿里连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>5.3.33</version>
|
||||
</dependency>
|
||||
<!-- 阿里JSON解析器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||
<version>1.9.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>29.0-jre</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.9.22.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.apache.commons</groupId>
|
||||
<artifactId>commons-beanutils2</artifactId>
|
||||
<version>2.0.0-M2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/lib/commons-beanutils2-2.0.0-M2.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>6.1.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.4</version> <!-- 可以使用最新版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.38</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,24 @@
|
||||
package com.evotech.hd.webserver;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
|
||||
@EnableScheduling
|
||||
@ComponentScan("com.evotech.hd.**.**")
|
||||
@MapperScan({"com.evotech.hd.**.**.mapper.**.**"})
|
||||
@EnableCaching
|
||||
public class WebServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WebServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user