forked from floraachy/xiuos_IoT
add socket server code
This commit is contained in:
parent
91d73dba24
commit
3810a7777d
|
@ -1,483 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BranchesTreeState">
|
||||
<expand>
|
||||
<path>
|
||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="83c94538-6ad4-4e72-85cf-eabaa1e6c548" name="Default Changelist" comment="add plc manage part">
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/ChatGPTController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/XiuosApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/XiuosApplication.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/LoginController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/LoginController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/UserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/UserController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/scheduled/TaskScheduled.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/scheduled/TaskScheduled.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/socket/SocketServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/aiit/xiuos/socket/SocketServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/application-local.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-local.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/application-prod.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-prod.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/xiuosiot" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/xiuosiot.iml" beforeDir="false" afterPath="$PROJECT_DIR$/xiuosiot.iml" afterDir="false" />
|
||||
</list>
|
||||
<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="CodeStyleSettingsInfer">
|
||||
<option name="done" value="true" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="spring-beans.schema" />
|
||||
<option value="Interface" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/tdengine/TDengineJDBCUtil.java" root0="SKIP_INSPECTION" />
|
||||
</component>
|
||||
<component name="JsFlowSettings">
|
||||
<service-enabled>true</service-enabled>
|
||||
<exe-path />
|
||||
<other-services-enabled>true</other-services-enabled>
|
||||
<auto-save>true</auto-save>
|
||||
</component>
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="localRepository" value="F:\apache-maven-3.6.0-bin\apache-maven-3.6.0\xiuosrepo" />
|
||||
<option name="mavenHome" value="$PROJECT_DIR$/../../../apache-maven-3.6.0-bin/apache-maven-3.6.0" />
|
||||
<option name="userSettingsFile" value="F:\apache-maven-3.6.0-bin\apache-maven-3.6.0\conf\settings-xiuos.xml" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectCodeStyleSettingsMigration">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="ProjectId" id="2DnTHBDiOL6Bix3tTHzGHtSi6sm" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
|
||||
<property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
<property name="DatabaseDriversLRU" value="postgresql" />
|
||||
<property name="ExpandSpringBootJavaOptionsPanel" value="true" />
|
||||
<property name="RequestMappingsPanelOrder0" value="0" />
|
||||
<property name="RequestMappingsPanelOrder1" value="1" />
|
||||
<property name="RequestMappingsPanelWidth0" value="75" />
|
||||
<property name="RequestMappingsPanelWidth1" value="75" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../backed" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
<property name="project.structure.last.edited" value="Global Libraries" />
|
||||
<property name="project.structure.proportion" value="0.15" />
|
||||
<property name="project.structure.side.proportion" value="0.2" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
|
||||
</component>
|
||||
<component name="ReactorSettings">
|
||||
<option name="notificationShown" value="true" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="F:\IdeaProject\xiuos_IoT\xiuosiot-backend\src\main\resources\mappers" />
|
||||
<recent name="F:\IdeaProject\xiuos_IoT\xiuosiot-backend\src\main\java\com\aiit\xiuos\dao\mappers" />
|
||||
<recent name="F:\IdeaProject\xiuosiot\src\main\resources\mappers" />
|
||||
<recent name="F:\IdeaProject\xiuosiot\src\main\java\com\aiit\xiuos\dao\mappers" />
|
||||
<recent name="F:\IdeaProject\xiuosiot\src\main\java\com\aiit\xiuos\model" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="com.aiit.xiuos.socket" />
|
||||
</key>
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="F:\IdeaProject\xiuos_IoT\xiuosiot-backend\src\main\resources" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Spring Boot.XiuosApplication">
|
||||
<configuration name="MyUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.aiit.xiuos.Utils.MyUtils" />
|
||||
<module name="xiuosiot" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.aiit.xiuos.tdengine.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="TDengineJDBCUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.aiit.xiuos.tdengine.TDengineJDBCUtil" />
|
||||
<module name="xiuosiot" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.aiit.xiuos.tdengine.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="TaskScheduled" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.aiit.xiuos.scheduled.TaskScheduled" />
|
||||
<module name="xiuosiot" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.aiit.xiuos.scheduled.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="MqttTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
|
||||
<module name="xiuosiot" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.aiit.xiuos.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="com.aiit.xiuos" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.aiit.xiuos.MqttTest" />
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="MqttTest.pushlish" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
|
||||
<module name="xiuosiot" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.aiit.xiuos.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="com.aiit.xiuos" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.aiit.xiuos.MqttTest" />
|
||||
<option name="METHOD_NAME" value="pushlish" />
|
||||
<option name="TEST_OBJECT" value="method" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
<option name="BSP.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="XiuosApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||
<module name="xiuosiot" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.aiit.xiuos.XiuosApplication" />
|
||||
<option name="VM_PARAMETERS" value="-Dspring.profiles.active=local" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="Application.MyUtils" />
|
||||
<item itemvalue="Application.TaskScheduled" />
|
||||
<item itemvalue="Application.TDengineJDBCUtil" />
|
||||
<item itemvalue="JUnit.MqttTest" />
|
||||
<item itemvalue="JUnit.MqttTest.pushlish" />
|
||||
<item itemvalue="Spring Boot.XiuosApplication" />
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.MyUtils" />
|
||||
<item itemvalue="JUnit.MqttTest.pushlish" />
|
||||
<item itemvalue="JUnit.MqttTest" />
|
||||
<item itemvalue="Application.TDengineJDBCUtil" />
|
||||
<item itemvalue="Application.TaskScheduled" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration>C:\Users\XIOS\AppData\Roaming\Subversion</configuration>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="83c94538-6ad4-4e72-85cf-eabaa1e6c548" name="Default Changelist" comment="" />
|
||||
<created>1661333758208</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1661333758208</updated>
|
||||
<workItem from="1661333765657" duration="280000" />
|
||||
<workItem from="1661334061009" duration="151000" />
|
||||
<workItem from="1661334238308" duration="194000" />
|
||||
<workItem from="1661334484199" duration="27000" />
|
||||
<workItem from="1661335230016" duration="352000" />
|
||||
<workItem from="1661335594847" duration="83000" />
|
||||
<workItem from="1661335693515" duration="7157000" />
|
||||
<workItem from="1661417909497" duration="5257000" />
|
||||
<workItem from="1661423357781" duration="21664000" />
|
||||
<workItem from="1661735687440" duration="26565000" />
|
||||
<workItem from="1661839398271" duration="69462000" />
|
||||
<workItem from="1662708416578" duration="3597000" />
|
||||
<workItem from="1663118139588" duration="4935000" />
|
||||
<workItem from="1663148821833" duration="14033000" />
|
||||
<workItem from="1663291666287" duration="9816000" />
|
||||
<workItem from="1663665174349" duration="48164000" />
|
||||
<workItem from="1664433648329" duration="51730000" />
|
||||
<workItem from="1666071998596" duration="6786000" />
|
||||
<workItem from="1666143007785" duration="92465000" />
|
||||
<workItem from="1667351495892" duration="33098000" />
|
||||
<workItem from="1667470518622" duration="19355000" />
|
||||
<workItem from="1667892470010" duration="150000" />
|
||||
<workItem from="1667892743178" duration="2935000" />
|
||||
<workItem from="1667959096843" duration="15311000" />
|
||||
<workItem from="1668044105794" duration="8837000" />
|
||||
<workItem from="1668060856912" duration="24089000" />
|
||||
<workItem from="1668391474765" duration="27822000" />
|
||||
<workItem from="1668763658498" duration="9290000" />
|
||||
<workItem from="1669690598297" duration="26287000" />
|
||||
<workItem from="1669864625320" duration="5166000" />
|
||||
<workItem from="1669972095205" duration="5504000" />
|
||||
<workItem from="1670222235849" duration="16000" />
|
||||
<workItem from="1670222734040" duration="1768000" />
|
||||
<workItem from="1670480572838" duration="7573000" />
|
||||
<workItem from="1673336807089" duration="2852000" />
|
||||
<workItem from="1674972538723" duration="4628000" />
|
||||
<workItem from="1675132295155" duration="19122000" />
|
||||
<workItem from="1675649197683" duration="10081000" />
|
||||
<workItem from="1676253690511" duration="3211000" />
|
||||
<workItem from="1676281331855" duration="5241000" />
|
||||
<workItem from="1676859233700" duration="19433000" />
|
||||
<workItem from="1677461463503" duration="3020000" />
|
||||
<workItem from="1677811781056" duration="19553000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="init">
|
||||
<created>1661504382339</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1661504382340</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="init">
|
||||
<created>1661505205169</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1661505205169</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00003" summary="新增 日平均数据新增定时器以及查询接口">
|
||||
<created>1663209401377</created>
|
||||
<option name="number" value="00003" />
|
||||
<option name="presentableId" value="LOCAL-00003" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1663209401377</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00004" summary="add plc manage part">
|
||||
<created>1663925693595</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1663925693595</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="5" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="oldMeFiltersMigrated" value="true" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<ignored-roots>
|
||||
<path value="$PROJECT_DIR$" />
|
||||
</ignored-roots>
|
||||
<MESSAGE value="init" />
|
||||
<MESSAGE value="新增 日平均数据新增定时器以及查询接口" />
|
||||
<MESSAGE value="add plc manage part" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="add plc manage part" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="-1124" y="382" key="#Notifications" timestamp="1678434158364">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1124" y="382" key="#Notifications/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678434158364" />
|
||||
<state x="-1467" y="91" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1677059198349">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1467" y="91" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1677059198349" />
|
||||
<state x="362" y="72" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1674976716612" />
|
||||
<state x="-1201" y="150" key="#com.intellij.ide.util.MemberChooser" timestamp="1677050373525">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1201" y="150" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1677050373525" />
|
||||
<state x="575" y="119" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669794680996" />
|
||||
<state x="-1230" y="266" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1677050117288">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1230" y="266" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1677050117288" />
|
||||
<state x="-1232" y="211" key="FileChooserDialogImpl" timestamp="1676272012091">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1232" y="211" key="FileChooserDialogImpl/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1676272012091" />
|
||||
<state x="550" y="167" key="FileChooserDialogImpl/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669706382687" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.bottom" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.bottom/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.0.bottom/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.center" timestamp="1678759361756">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.center/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361756" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.0.center/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.left" timestamp="1678759361756">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.left/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361756" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.0.left/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795193" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.right" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.0.right/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.0.right/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.bottom" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.bottom/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.1.bottom/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1670814821598" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.center" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.center/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.1.center/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.left" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.left/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.1.left/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1670814821597" />
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.right" timestamp="1678759361757">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="474" key="GridCell.Tab.1.right/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1678759361757" />
|
||||
<state width="1493" height="357" key="GridCell.Tab.1.right/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669890795194" />
|
||||
<state width="1493" height="402" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1670814821598" />
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.bottom" timestamp="1675393728233">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.bottom/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1675393728233" />
|
||||
<state width="1493" height="286" key="GridCell.Tab.2.bottom/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669864548644" />
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.center" timestamp="1675393728233">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.center/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1675393728233" />
|
||||
<state width="1493" height="286" key="GridCell.Tab.2.center/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669864548643" />
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.left" timestamp="1675393728233">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.left/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1675393728233" />
|
||||
<state width="1493" height="286" key="GridCell.Tab.2.left/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669864548643" />
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.right" timestamp="1675393728233">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="317" key="GridCell.Tab.2.right/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1675393728233" />
|
||||
<state width="1493" height="286" key="GridCell.Tab.2.right/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669864548644" />
|
||||
<state width="216" height="477" key="HiddenNamespacesPopup" timestamp="1674975197665">
|
||||
<screen x="0" y="0" width="1536" height="824" />
|
||||
</state>
|
||||
<state width="216" height="477" key="HiddenNamespacesPopup/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1674975197665" />
|
||||
<state x="400" y="0" key="SettingsEditor" timestamp="1669270250979">
|
||||
<screen x="0" y="0" width="1536" height="824" />
|
||||
</state>
|
||||
<state x="400" y="0" key="SettingsEditor/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669270250979" />
|
||||
<state x="-1115" y="139" width="866" height="891" key="find.popup" timestamp="1677120401774">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1115" y="139" width="866" height="891" key="find.popup/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1677120401774" />
|
||||
<state x="-1381" y="183" width="840" height="857" key="search.everywhere.popup" timestamp="1677051398004">
|
||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="-1381" y="183" width="840" height="857" key="search.everywhere.popup/0.0.1536.824/-1920.0.1920.1040@-1920.0.1920.1040" timestamp="1677051398004" />
|
||||
<state x="431" y="145" width="672" height="679" key="search.everywhere.popup/0.0.1536.824/-1920.0.1920.1040@0.0.1536.824" timestamp="1669689709927" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/Utils/GenerateIdUtil.java</url>
|
||||
<line>27</line>
|
||||
<option name="timeStamp" value="22" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/controller/DeviceController.java</url>
|
||||
<line>65</line>
|
||||
<option name="timeStamp" value="24" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/service/impl/RequestLogInfoServiceImpl.java</url>
|
||||
<line>36</line>
|
||||
<option name="timeStamp" value="35" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-method">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/service/DataForwardService.java</url>
|
||||
<line>7</line>
|
||||
<properties class="com.aiit.xiuos.service.DataForwardService" method="addRecord">
|
||||
<option name="EMULATED" value="true" />
|
||||
</properties>
|
||||
<option name="timeStamp" value="36" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-method">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/service/DataForwardService.java</url>
|
||||
<line>8</line>
|
||||
<properties class="com.aiit.xiuos.service.DataForwardService" method="selectRecord">
|
||||
<option name="EMULATED" value="true" />
|
||||
</properties>
|
||||
<option name="timeStamp" value="46" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-method">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/aiit/xiuos/service/AlarmInfoService.java</url>
|
||||
<line>15</line>
|
||||
<properties class="com.aiit.xiuos.service.AlarmInfoService" method="addAlarmInfo">
|
||||
<option name="EMULATED" value="true" />
|
||||
</properties>
|
||||
<option name="timeStamp" value="49" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<watches-manager>
|
||||
<configuration name="SpringBootApplicationConfigurationType">
|
||||
<watch expression="request" />
|
||||
<watch expression="request" language="JAVA" />
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
</project>
|
|
@ -20,12 +20,24 @@ public class CsvUtils {
|
|||
JSONObject items =jsonArray.getJSONObject(i);
|
||||
stringBuffer.append(items.getString("value_name")).append(",")
|
||||
.append(items.getString("area_char")).append(",")
|
||||
.append(items.getInteger("data_type")).append(",")
|
||||
.append(items.getInteger("start_address")).append(",")
|
||||
.append(items.getInteger("bit_address")).append(",")
|
||||
.append(items.getInteger("data_length")).append("\n");
|
||||
.append(items.getString("data_type")).append(",")
|
||||
.append(items.getString("start_address")).append(",")
|
||||
.append(items.getString("bit_address")).append(",")
|
||||
.append(items.getString("data_length")).append("\n");
|
||||
}
|
||||
return stringBuffer;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]){
|
||||
double a=67155434.21;
|
||||
double b=98531205.19;
|
||||
while(a/b>0.25){
|
||||
a=a-3.5;
|
||||
b=b+1;
|
||||
}
|
||||
String A=String.format("%.2f", a);
|
||||
String B =String.format("%.2f", b);
|
||||
System.out.println("a="+A+"b="+B);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.aiit.xiuos;
|
||||
|
||||
import com.aiit.xiuos.socket.SocketClient;
|
||||
import com.aiit.xiuos.socket.SocketServer;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
@ -17,6 +19,12 @@ public class XiuosApplication {
|
|||
public static void main(String[] args) {
|
||||
try {
|
||||
SpringApplication.run(XiuosApplication.class, args);
|
||||
|
||||
//启动208的客户端
|
||||
// Thread clientThread = new Thread(() -> {
|
||||
// SocketClient.main(new String[] {}); // 替换成你的 Socket Client 主类
|
||||
// });
|
||||
// clientThread.start();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -91,15 +91,15 @@ public class RedisUtil {
|
|||
/**
|
||||
* listOperations使用
|
||||
*/
|
||||
public void lset(String key, List<Object> list, long expire){
|
||||
listOperations.leftPush(key,list);
|
||||
public void lset(String key, String value, long expire){
|
||||
listOperations.leftPush(key,value);
|
||||
if(expire != NOT_EXPIRE){
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
public void lset(String key, List<Object> list){
|
||||
lset(key, list, DEFAULT_EXPIRE);
|
||||
public void lset(String key, String value){
|
||||
lset(key, value, DEFAULT_EXPIRE);
|
||||
}
|
||||
|
||||
public List<Object> lget(String key, long expire) {
|
||||
|
@ -114,6 +114,14 @@ public class RedisUtil {
|
|||
return lget(key, NOT_EXPIRE);
|
||||
}
|
||||
|
||||
public long lsize(String key){
|
||||
return listOperations.size(key);
|
||||
}
|
||||
|
||||
public void ltrim(String key,long size){
|
||||
listOperations.trim(key,0,size-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* hashOperations的使用
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.aiit.xiuos.scheduled;
|
|||
import com.aiit.xiuos.Utils.DingUtil;
|
||||
import com.aiit.xiuos.Utils.EmailUtil;
|
||||
import com.aiit.xiuos.Utils.MyUtils;
|
||||
import com.aiit.xiuos.socket.QJDQDetailWebSocketServer;
|
||||
import com.aiit.xiuos.socket.QJDQWebSocketServer;
|
||||
import com.aiit.xiuos.tdengine.TDengineJDBCUtil;
|
||||
import com.aiit.xiuos.model.*;
|
||||
|
@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
|
@ -40,6 +42,8 @@ public class TaskScheduled {
|
|||
QjdqElectricService qjdqElectricService;
|
||||
@Autowired
|
||||
QJDQWebSocketServer qjdqWebSocketServer;
|
||||
@Autowired
|
||||
QJDQDetailWebSocketServer qjdqDetailWebSocketServer;
|
||||
@Scheduled(cron = "0 0 */1 * * ?")//every hour
|
||||
public void insertAvgDayData() throws ParseException {
|
||||
AvgDayData avgDayData =new AvgDayData();
|
||||
|
@ -253,6 +257,49 @@ public class TaskScheduled {
|
|||
// }
|
||||
// }
|
||||
|
||||
@Scheduled(cron = "0 */1 8-20 * * ?")//every minute 8-20 clock
|
||||
public void mockQJDQData() throws IOException {
|
||||
Random rand = new Random();
|
||||
HashMap<String,Integer> detail = new HashMap<>();
|
||||
detail.put("A1",rand.nextInt(100));
|
||||
detail.put("A2",rand.nextInt(100));
|
||||
detail.put("A3",rand.nextInt(100));
|
||||
detail.put("A4",rand.nextInt(100));
|
||||
detail.put("B1",rand.nextInt(100));
|
||||
detail.put("B2",rand.nextInt(100));
|
||||
detail.put("B3",rand.nextInt(100));
|
||||
detail.put("B4",rand.nextInt(100));
|
||||
detail.put("B5",rand.nextInt(100));
|
||||
detail.put("B6",rand.nextInt(100));
|
||||
detail.put("B7",rand.nextInt(100));
|
||||
detail.put("B8",rand.nextInt(100));
|
||||
detail.put("B9",rand.nextInt(100));
|
||||
detail.put("C1",rand.nextInt(100));
|
||||
detail.put("C2",rand.nextInt(100));
|
||||
detail.put("C3",rand.nextInt(100));
|
||||
detail.put("C4",rand.nextInt(100));
|
||||
detail.put("C5",rand.nextInt(100));
|
||||
detail.put("C6",rand.nextInt(100));
|
||||
detail.put("C7",rand.nextInt(100));
|
||||
detail.put("D1",rand.nextInt(100));
|
||||
detail.put("D2",rand.nextInt(100));
|
||||
detail.put("D3",rand.nextInt(100));
|
||||
detail.put("D4",rand.nextInt(100));
|
||||
detail.put("D5",rand.nextInt(100));
|
||||
detail.put("D6",rand.nextInt(100));
|
||||
detail.put("D7",rand.nextInt(100));
|
||||
detail.put("D8",rand.nextInt(100));
|
||||
detail.put("D9",rand.nextInt(100));
|
||||
detail.put("D10",rand.nextInt(100));
|
||||
detail.put("D11",rand.nextInt(100));
|
||||
detail.put("D12",rand.nextInt(100));
|
||||
qjdqDetailWebSocketServer.sendInfo(JSONObject.toJSONString(detail));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
package com.aiit.xiuos.socket;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@ServerEndpoint(value = "/websocket/qjdqdetail/{clientId}")
|
||||
@Component
|
||||
@Slf4j
|
||||
public class QJDQDetailWebSocketServer {
|
||||
/**
|
||||
* 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
|
||||
*/
|
||||
private static int onlineCount = 0;
|
||||
|
||||
/**
|
||||
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
|
||||
*/
|
||||
public static ConcurrentHashMap<String, QJDQDetailWebSocketServer> webSocketSet = new ConcurrentHashMap<String, QJDQDetailWebSocketServer>();
|
||||
|
||||
public HashMap<String,Integer> cntofParam=new HashMap<String,Integer>();
|
||||
|
||||
public HashMap<String,Integer> numofAccount=new HashMap<String,Integer>();
|
||||
|
||||
/**
|
||||
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
|
||||
*/
|
||||
private Session session;
|
||||
|
||||
/**
|
||||
* 传过来的id
|
||||
*/
|
||||
private String name = "";
|
||||
|
||||
/**
|
||||
* 连接建立成功调用的方法*/
|
||||
@OnOpen
|
||||
public void onOpen(@PathParam(value = "clientId") String clientId, Session session) {
|
||||
//接收到发送消息的人员编号
|
||||
name = clientId;
|
||||
this.session = session;
|
||||
/**加入set中*/
|
||||
webSocketSet.put(clientId,this);
|
||||
/**在线数加1*/
|
||||
addOnlineCount();
|
||||
log.info("有新连接"+clientId+"加入!当前在线人数为" + getOnlineCount());
|
||||
try {
|
||||
sendMessage(clientId+"-连接已建立-");
|
||||
} catch (IOException e) {
|
||||
log.error("IO异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接关闭调用的方法
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
if (name != null && name != "") {
|
||||
/** 从set中删除 */
|
||||
webSocketSet.remove(name);
|
||||
/** 在线数减1 */
|
||||
subOnlineCount();
|
||||
log.info("有一连接"+name+"关闭!当前在线人数为" + getOnlineCount());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到客户端消息后调用的方法
|
||||
*
|
||||
* @param message 客户端发送过来的消息*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("来自客户端的消息:" + message);
|
||||
try {
|
||||
this.sendMessage("收到!");
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发生错误时调用
|
||||
* **/
|
||||
@OnError
|
||||
public void onError(Session session, Throwable error) {
|
||||
log.error("发生错误");
|
||||
error.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
public void sendMessage(String message) throws IOException {
|
||||
synchronized (session) {
|
||||
getSession().getBasicRemote().sendText(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给指定的人发送消息
|
||||
* @param message
|
||||
*/
|
||||
public void sendToMessageById(String id,String message) {
|
||||
try {
|
||||
if (webSocketSet.get(id) != null) {
|
||||
webSocketSet.get(id).sendMessage(message);
|
||||
} else {
|
||||
System.out.println("webSocketSet中没有此key,不推送消息");
|
||||
log.info("webSocketSet中没有此key,不推送消息");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 群发自定义消息
|
||||
* */
|
||||
public static void sendInfo(String message) {
|
||||
try {
|
||||
for (Map.Entry<String, QJDQDetailWebSocketServer> entry : webSocketSet.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
log.info("发送信息至客户端:"+name);
|
||||
QJDQDetailWebSocketServer value = entry.getValue();
|
||||
value.sendMessage(message);
|
||||
}
|
||||
}catch(IOException e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
public static synchronized int getOnlineCount() {
|
||||
return onlineCount;
|
||||
}
|
||||
|
||||
public static synchronized void addOnlineCount() {
|
||||
QJDQDetailWebSocketServer.onlineCount++;
|
||||
}
|
||||
|
||||
public static synchronized void subOnlineCount() {
|
||||
QJDQDetailWebSocketServer.onlineCount--;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
package com.aiit.xiuos.socket;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
|
||||
public class SocketClient {
|
||||
public static String _pattern = "yyyy-MM-dd HH:mm:ss SSS";
|
||||
public static SimpleDateFormat format = new SimpleDateFormat(_pattern);
|
||||
|
||||
public static void main(String[] args) {
|
||||
int num =0;
|
||||
try {
|
||||
while (true) {
|
||||
// 与服务端建立连接
|
||||
System.out.println("start client");
|
||||
Socket socket = new Socket("localhost", 9900);
|
||||
System.out.println("connected 9900");
|
||||
// 获得输出流,给服务端发送信息
|
||||
OutputStream dout = socket.getOutputStream();
|
||||
String str = "a0000,hello\n";
|
||||
dout.write(str.getBytes());
|
||||
// 通过shutdownOutput告诉服务器已经发送完数据,后续只能接受数据
|
||||
//socket.shutdownOutput();
|
||||
|
||||
// 接收服务端发送的消息
|
||||
InputStream din = socket.getInputStream();
|
||||
byte[] outPut = new byte[4096];
|
||||
while (din.read(outPut) > 0) {
|
||||
String result = new String(outPut);
|
||||
System.out.println("服务端返回的的消息是:" + result);
|
||||
}
|
||||
din.close();
|
||||
dout.close();
|
||||
socket.close();
|
||||
Thread.sleep(6000);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.aiit.xiuos.socket;
|
||||
import com.aiit.xiuos.redis.RedisConfig;
|
||||
import com.aiit.xiuos.redis.RedisUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.integration.IntegrationProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.*;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SocketServer {
|
||||
@Autowired RedisUtil redisUtil;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 启动 SocketServer 的初始化操作,例如监听端口等
|
||||
// 这里可以编写你的 SocketServer 的启动逻辑
|
||||
new Thread(() -> {
|
||||
ServerSocket serverSocket =null;
|
||||
int port =10208;
|
||||
try {
|
||||
serverSocket = new ServerSocket(port);
|
||||
log.info("Server started. Waiting for clients...");
|
||||
while (true) {
|
||||
Socket socket = serverSocket.accept();
|
||||
socket.setSoTimeout(60000);
|
||||
log.info("connected with socket "+socket.getInetAddress().getHostAddress());
|
||||
PrintWriter writer= new PrintWriter(socket.getOutputStream(), true);
|
||||
try{
|
||||
InputStream inputStream = socket.getInputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int byteRead;
|
||||
String data ="";
|
||||
if ((byteRead = inputStream.read(buffer)) != -1) {
|
||||
log.info("byteRead="+byteRead);
|
||||
// if (buffer[byteRead - 1] == '\n') {
|
||||
// data=new String(buffer,0,byteRead-1);
|
||||
// log.info("获取到结束换行符,断开连接");
|
||||
// break;
|
||||
// }else{
|
||||
// log.info("已读取1024k数据");
|
||||
// data=new String(buffer,0,byteRead);
|
||||
// }
|
||||
data=new String(buffer,0,byteRead-1);
|
||||
|
||||
}
|
||||
log.info("Received data: " + data);
|
||||
redisUtil.lset("ch32v208_datalist", data,-1);
|
||||
int index = data.indexOf(',');
|
||||
String dataId="" ;
|
||||
if(index>0){
|
||||
dataId= data.substring(0,index);
|
||||
}
|
||||
|
||||
// 回应客户端
|
||||
writer.println(dataId);
|
||||
socket.close();
|
||||
log.info("socket closed");
|
||||
}catch (SocketTimeoutException e){
|
||||
log.error("socket read time out");
|
||||
}catch (IOException e){
|
||||
log.error("IO异常"+e.getMessage());
|
||||
}finally {
|
||||
writer.println("client error");
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error closing socket: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if(serverSocket!=null){
|
||||
try {
|
||||
serverSocket.close();
|
||||
} catch (IOException e) {
|
||||
log.info("Error closing server socket: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -62,13 +62,13 @@ mybatis:
|
|||
#MQTT Config
|
||||
mqtt:
|
||||
#MQTT-服务器连接地
|
||||
hostUrl: tcp://8.140.53.225:1883
|
||||
hostUrl: tcp://115.238.53.59:1883
|
||||
#MQTT-连接服务器默认客户端ID
|
||||
clientId: local-xiuosiot
|
||||
#MQTT-用户名
|
||||
username: xiuos
|
||||
username: xiuosiot
|
||||
#MQTT-密码
|
||||
password: xiuos
|
||||
password: xiuosiot
|
||||
#连接超时
|
||||
timeout: 100
|
||||
#设置会话心跳时间
|
||||
|
@ -76,11 +76,11 @@ mqtt:
|
|||
#默认主题
|
||||
default-topic: xiuosiot/#
|
||||
#api key
|
||||
apikey: ac527c699ec31245
|
||||
apikey: 13e1c0be6d573f86
|
||||
#secret key
|
||||
secretkey: UEqxxgyY9Ba3Kebl2zlEu9Bq67n9AR9CdxDQ0iYz802XsbO
|
||||
secretkey: 9BLxyWslygS5oFTz8TX5ssJ7JMiBY9CefU9B35uWx3ltqN
|
||||
#api url
|
||||
apiurl: http://8.140.53.225:18083
|
||||
apiurl: http://115.238.53.59:18083
|
||||
|
||||
tdengine:
|
||||
url: jdbc:TAOS://taosnode1:6030/xiuosiot?user=root&password=taosdata
|
||||
|
|
|
@ -33,7 +33,7 @@ spring:
|
|||
|
||||
redis:
|
||||
database: 1
|
||||
host: 115.238.53.59
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: abc123
|
||||
jedis:
|
||||
|
|
|
@ -18,7 +18,7 @@ public class MqttTest {
|
|||
@Test
|
||||
void pushlish() {
|
||||
Random random =new Random();
|
||||
for (int i = 0; i < 1; i++) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
JSONObject jsonObject =new JSONObject();
|
||||
jsonObject.put("co2",19);
|
||||
jsonObject.put("so2",19);
|
||||
|
|
|
@ -0,0 +1,152 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
<sourceRoots>
|
||||
<root url="file://$MODULE_DIR$/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/src/main/resources" />
|
||||
</sourceRoots>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.postgresql:postgresql:42.3.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.24" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.7.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.7.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.7.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.7.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.4.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:2.4.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:9.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.22.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.12.13" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.12.13" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:3.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.3.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.generator:mybatis-generator-core:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.32" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.taosdata.jdbc:taos-jdbcdriver:3.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:30.1.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.java-websocket:Java-WebSocket:1.5.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-stream:5.5.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-core:5.5.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.integration:spring-integration-mqtt:5.5.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-integration:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:1.5.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.7.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.7.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.7.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.4.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.ejlchina:okhttps-fastjson:3.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.ejlchina:okhttps:3.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.ejlchina:data-core:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:4.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.ejlchina:data-fastjson:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.6.21" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-mail:2.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.mail:jakarta.mail:1.6.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
|
||||
</component>
|
||||
</module>
|
Loading…
Reference in New Issue