Compare commits
4 Commits
main
...
cd8bcb8ba0
Author | SHA1 | Date | |
---|---|---|---|
cd8bcb8ba0 | |||
e800558a32 | |||
b993638e5b | |||
6671cb69c9 |
35
code/java/DisasterWarning/disaster_warning.iml
Normal file
35
code/java/DisasterWarning/disaster_warning.iml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<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="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library" scope="TEST">
|
||||
<library name="JUnit4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/junit-4.13.1.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: com.oracle:ojdbc8:19.3.0.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.8" level="project" />
|
||||
</component>
|
||||
</module>
|
348
code/java/DisasterWarning/disaster_warning.ipr
Normal file
348
code/java/DisasterWarning/disaster_warning.ipr
Normal file
@@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CodeStyleManager">
|
||||
<option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true" />
|
||||
<option name="CODE_STYLE_SCHEME" value="" />
|
||||
</component>
|
||||
<component name="CompilerConfiguration">
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="!?*.java" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="disaster_warning" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="disaster_warning" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
<component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="PRINT_LINE_NUMBERS" value="false" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
<option name="OUTPUT_DIRECTORY" />
|
||||
</component>
|
||||
<component name="ImportConfiguration">
|
||||
<option name="VENDOR" />
|
||||
<option name="RELEASE_TAG" />
|
||||
<option name="LOG_MESSAGE" />
|
||||
<option name="CHECKOUT_AFTER_IMPORT" value="true" />
|
||||
</component>
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
</profile>
|
||||
<version value="1.0" />
|
||||
</component>
|
||||
<component name="JUnitGeneratorProjectSettings">
|
||||
<option name="selectedTemplateKey" value="JUnit 4" />
|
||||
<option name="vmTemplates">
|
||||
<map>
|
||||
<entry key="JUnit 3" value="######################################################################################## ## ## Available variables: ## $entryList.methodList - List of method composites ## $entryList.privateMethodList - List of private method composites ## $entryList.fieldList - ArrayList of class scope field names ## $entryList.className - class name ## $entryList.packageName - package name ## $today - Todays date in MM/dd/yyyy format ## ## MethodComposite variables: ## $method.name - Method Name ## $method.signature - Full method signature in String form ## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) ## $method.paramNames - List of Strings representing the method's parameters' names ## $method.paramClasses - List of Strings representing the method's parameters' classes ## ## You can configure the output class name using "testClass" variable below. ## Here are some examples: ## Test${entry.ClassName} - will produce TestSomeClass ## ${entry.className}Test - will produce SomeClassTest ## ######################################################################################## ## #macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end ## Iterate through the list and generate testcase for every entry. #foreach ($entry in $entryList) #set( $testClass="${entry.className}Test") ## package test.$entry.packageName; import junit.framework.Test; import junit.framework.TestSuite; import junit.framework.TestCase; /** * ${entry.className} Tester. * * @author <Authors name> * @since <pre>$today</pre> * @version 1.0 */ public class $testClass extends TestCase { public $testClass(String name) { super(name); } public void setUp() throws Exception { super.setUp(); } public void tearDown() throws Exception { super.tearDown(); } #foreach($method in $entry.methodList) /** * * Method: $method.signature * */ public void test#cap(${method.name})() throws Exception { //TODO: Test goes here... } #end #foreach($method in $entry.privateMethodList) /** * * Method: $method.signature * */ public void test#cap(${method.name})() throws Exception { //TODO: Test goes here... #foreach($string in $method.reflectionCode) $string #end } #end public static Test suite() { return new TestSuite(${testClass}.class); } } #end" />
|
||||
<entry key="JUnit 4" value="######################################################################################## ## ## Available variables: ## $entryList.methodList - List of method composites ## $entryList.privateMethodList - List of private method composites ## $entryList.fieldList - ArrayList of class scope field names ## $entryList.className - class name ## $entryList.packageName - package name ## $today - Todays date in MM/dd/yyyy format ## ## MethodComposite variables: ## $method.name - Method Name ## $method.signature - Full method signature in String form ## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) ## $method.paramNames - List of Strings representing the method's parameters' names ## $method.paramClasses - List of Strings representing the method's parameters' classes ## ## You can configure the output class name using "testClass" variable below. ## Here are some examples: ## Test${entry.ClassName} - will produce TestSomeClass ## ${entry.className}Test - will produce SomeClassTest ## ######################################################################################## ## #macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end ## Iterate through the list and generate testcase for every entry. #foreach ($entry in $entryList) #set( $testClass="${entry.className}Test") ## package $entry.packageName; import org.junit.Test; import org.junit.Before; import org.junit.After; /** * ${entry.className} Tester. * * @author <Authors name> * @since <pre>$date</pre> * @version 1.0 */ public class $testClass { @Before public void before() throws Exception { } @After public void after() throws Exception { } #foreach($method in $entry.methodList) /** * * Method: $method.signature * */ @Test public void test#cap(${method.name})() throws Exception { //TODO: Test goes here... } #end #foreach($method in $entry.privateMethodList) /** * * Method: $method.signature * */ @Test public void test#cap(${method.name})() throws Exception { //TODO: Test goes here... #foreach($string in $method.reflectionCode) $string #end } #end } #end" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JUnitProjectSettings">
|
||||
<option name="TEST_RUNNER" value="UI" />
|
||||
</component>
|
||||
<component name="JavadocGenerationManager">
|
||||
<option name="OPTION_HIERARCHY" value="false" />
|
||||
<option name="OPTION_NAVIGATOR" value="false" />
|
||||
<option name="OPTION_INDEX" value="false" />
|
||||
<option name="OPTION_SEPARATE_INDEX" value="false" />
|
||||
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="false" />
|
||||
<option name="OPTION_DEPRECATED_LIST" value="false" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
</component>
|
||||
<component name="JikesSettings">
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="DEPRECATION" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="GENERATE_MAKE_FILE_DEPENDENCIES" value="false" />
|
||||
<option name="DO_FULL_DEPENDENCE_CHECK" value="false" />
|
||||
<option name="IS_INCREMENTAL_MODE" value="false" />
|
||||
<option name="IS_EMACS_ERRORS_MODE" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
<option name="MAXIMUM_HEAP_SIZE" value="128" />
|
||||
</component>
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/disaster_warning.iml" filepath="$PROJECT_DIR$/disaster_warning.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" />
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
<component name="SwUserDefinedSpecifications">
|
||||
<option name="specTypeByUrl">
|
||||
<map />
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
|
||||
</component>
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.8">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.8/jackson-annotations-2.9.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.8/jackson-annotations-2.9.8-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.8/jackson-annotations-2.9.8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: com.oracle:ojdbc8:19.3.0.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/oracle/ojdbc8/19.3.0.0.0/ojdbc8-19.3.0.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/oracle/ojdbc8/19.3.0.0.0/ojdbc8-19.3.0.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/oracle/ojdbc8/19.3.0.0.0/ojdbc8-19.3.0.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: commons-codec:commons-codec:1.11">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: commons-logging:commons-logging:1.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: junit:junit:4.13.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.2/junit-4.13.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.2/junit-4.13.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.2/junit-4.13.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: org.apache.httpcomponents:httpclient:4.5.13">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: org.apache.httpcomponents:httpcore:4.4.13">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
</project>
|
@@ -1,7 +1,5 @@
|
||||
<?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">
|
||||
<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>
|
||||
<groupId>com.cpic.xim</groupId>
|
||||
<artifactId>disaster_warning</artifactId>
|
||||
@@ -10,80 +8,33 @@
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/ojdbc8.jar</systemPath>
|
||||
<version>19.3.0.0.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>20040616</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.ezmorph</groupId>
|
||||
<artifactId>ezmorph</artifactId>
|
||||
<version>1.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15</classifier>
|
||||
</dependency> -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.18.2</version>
|
||||
<version>2.9.8</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.9.8</version>
|
||||
</dependency> -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.18.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.18.2</version>
|
||||
<version>2.9.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-04-22 10:53:49
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2022-05-10 16:28:07
|
||||
* @LastEditTime: 2022-05-12 09:52:45
|
||||
* @FilePath: \DisasterWarning\src\main\java\AppMain.java
|
||||
* @Description: 和风天气预警推送厦门太保公众号主程序!
|
||||
*
|
||||
@@ -11,6 +11,7 @@
|
||||
import com.cpic.xim.config.AppConfigManager;
|
||||
import com.cpic.xim.config.City;
|
||||
import com.cpic.xim.notify.disaster.QWeatherDisasterWarning;
|
||||
import com.cpic.xim.notify.disaster.QWeatherDisasterWarningItem;
|
||||
import com.cpic.xim.notify.disaster.WeatherDisasterWarningGrabber;
|
||||
import com.cpic.xim.wechat.officalAccount.sendMessage;
|
||||
import com.cpic.xim.config.WeatherDisasterNotifyConfig;
|
||||
@@ -79,24 +80,41 @@ public class AppMain
|
||||
logger.log( Level.INFO, "查询{0}天气预警,结果:{1}。", new Object[]
|
||||
{ city.getCityName(), json} );
|
||||
|
||||
// 判断是否有警报
|
||||
if ( warning.getWarning().isEmpty() == true)
|
||||
Vector<QWeatherDisasterWarningItem> warningItems = warning.getWarning();
|
||||
|
||||
// 判断是否有警报,没有警报就结束当前城市的处理
|
||||
if ( warningItems.isEmpty() == true)
|
||||
{
|
||||
logger.log( Level.INFO, "查询{0}天气预警,无警报!。", new Object[]
|
||||
{ city.getCityName()} );
|
||||
continue;
|
||||
}
|
||||
|
||||
logger.log( Level.INFO, "查询{0}天气预警,发送日志。", new Object[]
|
||||
{ city.getCityName()} );
|
||||
// 有警报,就遍历警报数组
|
||||
for ( QWeatherDisasterWarningItem item : warningItems )
|
||||
{
|
||||
// 先检查是否已经发送过
|
||||
if ( sendMessage.checkWarningHasSended( item.getId() ) == false)
|
||||
{
|
||||
logger.log( Level.INFO, "查询{0}天气预警,ID:{1},已有发送记录,跳过。", new Object[]
|
||||
{ city.getCityName(), item.getId()} );
|
||||
|
||||
sendMessage.sendWeatherDisasterWarning( config.getWechatOfficalAccountURL(),
|
||||
warning );
|
||||
continue;
|
||||
}
|
||||
|
||||
logger.log( Level.INFO, "{0}天气预警,日志发送成功。", new Object[]
|
||||
{ city.getCityName()} );
|
||||
// 没有发送过
|
||||
logger.log( Level.INFO, "查询{0}天气预警,发送日志。", new Object[]
|
||||
{ city.getCityName()} );
|
||||
|
||||
sendMessage.saveWeatherDisasterWarning( city.getCityName(), warning );
|
||||
sendMessage.sendWeatherDisasterWarning( config.getWechatOfficalAccountURL(),
|
||||
item );
|
||||
|
||||
logger.log( Level.INFO, "{0}天气预警,日志发送成功。", new Object[]
|
||||
{ city.getCityName()} );
|
||||
|
||||
// 将发送的警报,保存起来
|
||||
sendMessage.saveWeatherDisasterWarning( city.getCityName(), item );
|
||||
}
|
||||
}
|
||||
catch ( IOException error )
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-04-22 10:53:49
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2022-05-06 11:14:32
|
||||
* @LastEditTime: 2022-05-12 09:51:13
|
||||
* @FilePath: \DisasterWarning\src\main\java\com\cpic\xim\wechat\officalAccount\sendMessage.java
|
||||
* @Description: 用来推送公众号消息的程序库。
|
||||
*
|
||||
@@ -14,22 +14,23 @@ import com.cpic.xim.config.db.OracleConfigManager;
|
||||
import com.cpic.xim.config.db.OracleConfig;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.cpic.xim.notify.disaster.*;
|
||||
import com.cpic.xim.httpUtil.HttpUtils;
|
||||
|
||||
/**
|
||||
* 推送微信公众号消息。
|
||||
*
|
||||
*
|
||||
* @author Kane
|
||||
*/
|
||||
public class sendMessage
|
||||
@@ -39,13 +40,14 @@ public class sendMessage
|
||||
/**
|
||||
* 推送天气灾害预警!接口文档参考 彭奕洁 编写《消息发送接口调用文档》
|
||||
* 使用 post 方式,请求体内容以最基础的 post 格式。
|
||||
*
|
||||
* @param officalAccountURL 产险厦门分公司公众号接口网址
|
||||
* @param warning 灾害预警对象
|
||||
* @param warningItem 灾害预警对象
|
||||
*/
|
||||
public static void sendWeatherDisasterWarning( String officalAccountURL,
|
||||
QWeatherDisasterWarning warning )
|
||||
QWeatherDisasterWarningItem warningItem )
|
||||
{
|
||||
Vector<QWeatherDisasterWarningItem> warningItems = warning.getWarning();
|
||||
// Vector<QWeatherDisasterWarningItem> warningItems = warningItem.getWarning();
|
||||
StringBuilder requestBody = null;
|
||||
|
||||
// 设置请求头参数
|
||||
@@ -56,36 +58,36 @@ public class sendMessage
|
||||
headers.put( "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" );
|
||||
|
||||
// 遍历消息,将消息推送出去。
|
||||
for ( QWeatherDisasterWarningItem item : warningItems )
|
||||
|
||||
// 拼接消息内容
|
||||
String title = warningItem.getTitle();
|
||||
String text = warningItem.getText();
|
||||
String color = warningLevel.keySet().contains( warningItem.getLevel() )
|
||||
? warningLevel.get( warningItem.getLevel() )
|
||||
: "#000000";
|
||||
requestBody = new StringBuilder();
|
||||
|
||||
requestBody.append( "tplid=57&groupid=1&first=尊敬的#realname#,您好!&" );
|
||||
requestBody.append( "keyword1=" ).append( title ).append( "&" );
|
||||
requestBody.append( "keyword1color=" ).append( color ).append( "&" );
|
||||
requestBody.append( "keyword2=" ).append( text );
|
||||
|
||||
try
|
||||
{
|
||||
// 拼接消息内容
|
||||
String title = item.getTitle();
|
||||
String text = item.getText();
|
||||
String color = warningLevel.keySet().contains( item.getLevel() )
|
||||
? warningLevel.get( item.getLevel() )
|
||||
: "#000000";
|
||||
requestBody = new StringBuilder();
|
||||
|
||||
requestBody.append( "tplid=57&groupid=1&first=尊敬的#realname#,您好!&" );
|
||||
requestBody.append( "keyword1=" ).append( title ).append( "&" );
|
||||
requestBody.append( "keyword1color=" ).append( color ).append( "&" );
|
||||
requestBody.append( "keyword2=" ).append( text );
|
||||
|
||||
try
|
||||
{
|
||||
HttpUtils.postHttpRequest( officalAccountURL, headers, requestBody.toString() );
|
||||
}
|
||||
catch ( MalformedURLException error )
|
||||
{
|
||||
error.printStackTrace();
|
||||
}
|
||||
HttpUtils.postHttpRequest( officalAccountURL, headers, requestBody.toString() );
|
||||
}
|
||||
catch ( MalformedURLException error )
|
||||
{
|
||||
error.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查预警是否已经推送过,通过 QWeatherDisasterWarningItem 对象的 id 属性。
|
||||
* 查询 oracle xmcx1 数据库 wechat 表空间下 weather_disaster_notify 表,
|
||||
* 统计 warningID 的数量,如果不为0,说明该预警已经保存过,视为已经推送过。
|
||||
*
|
||||
* @param warningID 预警的id
|
||||
* @return 如果推送过,返回false,否则返回 true。
|
||||
*/
|
||||
@@ -94,16 +96,17 @@ public class sendMessage
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();;
|
||||
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
|
||||
;
|
||||
|
||||
Connection conn = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
ResultSet rs = null;
|
||||
|
||||
String jdbcURL = dbConfig.getJdbcURL();
|
||||
String jdbcURL = dbConfig.getJdbcURL();
|
||||
String userName = dbConfig.getUserName();
|
||||
String password = dbConfig.getPassword();
|
||||
String sql = "select count(*) from weather_disaster_notify where notify_id = ?";
|
||||
String sql = "select count(*) from weather_disaster_notify where notify_id = ?";
|
||||
|
||||
// Logger logger = Logger.getLogger( "com.cpicxim.wechat.officalAccount.sendMessage" );
|
||||
|
||||
@@ -117,7 +120,7 @@ public class sendMessage
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
if ( rs.next() && rs.getInt( 1 ) == 0)
|
||||
if ( rs.next() && rs.getInt( 1 ) == 0 )
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
@@ -126,7 +129,7 @@ public class sendMessage
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( rs != null)
|
||||
if ( rs != null )
|
||||
{
|
||||
rs.close();
|
||||
}
|
||||
@@ -138,7 +141,7 @@ public class sendMessage
|
||||
|
||||
try
|
||||
{
|
||||
if ( stmt != null)
|
||||
if ( stmt != null )
|
||||
{
|
||||
stmt.close();
|
||||
}
|
||||
@@ -150,7 +153,7 @@ public class sendMessage
|
||||
|
||||
try
|
||||
{
|
||||
if ( conn != null)
|
||||
if ( conn != null )
|
||||
{
|
||||
conn.close();
|
||||
}
|
||||
@@ -168,16 +171,18 @@ public class sendMessage
|
||||
* 保存天气预警警报数据。
|
||||
* 保存至 oracle xmcx1 数据库 wechat 表空间下 weather_disaster_notify 表。
|
||||
* 保存的数据用来判断预警是否已经推送过,以防止反复推送数据。
|
||||
* @param city 城市名称
|
||||
* @param warning 预警数据,为 QWeatherDisasterWarningItem 对象。
|
||||
* @throws SQLException 执行sql时可能抛出的异常。出现sql异常,就回滚事务。
|
||||
* @throws IOException 读取数据库配置文件时可能抛出的异常。
|
||||
*
|
||||
* @param city 城市名称
|
||||
* @param warnings 预警数据,为 QWeatherDisasterWarningItem 对象。
|
||||
* @throws SQLException 执行sql时可能抛出的异常。出现sql异常,就回滚事务。
|
||||
* @throws IOException 读取数据库配置文件时可能抛出的异常。
|
||||
* @throws ClassNotFoundException 加载oracle jdbc驱动时可能抛出的异常。
|
||||
*/
|
||||
public static void saveWeatherDisasterWarning( String city, QWeatherDisasterWarning warnings )
|
||||
public static void saveWeatherDisasterWarning( String city,
|
||||
QWeatherDisasterWarningItem warning )
|
||||
throws SQLException, IOException, ClassNotFoundException
|
||||
{
|
||||
Connection conn = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
|
||||
String sql = "insert into weather_disaster_notify(notify_id, sender, city,"
|
||||
@@ -186,7 +191,7 @@ public class sendMessage
|
||||
|
||||
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
|
||||
|
||||
String jdbcURL = dbConfig.getJdbcURL();
|
||||
String jdbcURL = dbConfig.getJdbcURL();
|
||||
String userName = dbConfig.getUserName();
|
||||
String password = dbConfig.getPassword();
|
||||
|
||||
@@ -197,23 +202,21 @@ public class sendMessage
|
||||
conn = DriverManager.getConnection( jdbcURL, userName, password );
|
||||
stmt = conn.prepareStatement( sql );
|
||||
|
||||
for ( QWeatherDisasterWarningItem warning : warnings.getWarning() )
|
||||
{
|
||||
java.sql.Timestamp pubTime =
|
||||
new java.sql.Timestamp( warning.getPubTime().getTime() );
|
||||
conn.setAutoCommit( false );
|
||||
|
||||
stmt.setString( 1, warning.getId() );
|
||||
stmt.setString( 2, warning.getSender() );
|
||||
stmt.setString( 3, city );
|
||||
stmt.setString( 4, warning.getLevel() );
|
||||
stmt.setString( 5, warning.getType() );
|
||||
stmt.setString( 6, warning.getTypeName() );
|
||||
stmt.setString( 7, warning.getTitle() );
|
||||
stmt.setString( 8, warning.getText() );
|
||||
stmt.setTimestamp( 9, pubTime );
|
||||
java.sql.Timestamp pubTime = new java.sql.Timestamp( warning.getPubTime().getTime() );
|
||||
|
||||
stmt.execute();
|
||||
}
|
||||
stmt.setString( 1, warning.getId() );
|
||||
stmt.setString( 2, warning.getSender() );
|
||||
stmt.setString( 3, city );
|
||||
stmt.setString( 4, warning.getLevel() );
|
||||
stmt.setString( 5, warning.getType() );
|
||||
stmt.setString( 6, warning.getTypeName() );
|
||||
stmt.setString( 7, warning.getTitle() );
|
||||
stmt.setString( 8, warning.getText() );
|
||||
stmt.setTimestamp( 9, pubTime );
|
||||
|
||||
stmt.execute();
|
||||
|
||||
// 没有问题就提交
|
||||
conn.commit();
|
||||
@@ -221,7 +224,7 @@ public class sendMessage
|
||||
catch ( SQLException error )
|
||||
{
|
||||
// 出现sql错误,就回滚!
|
||||
if ( conn != null)
|
||||
if ( conn != null )
|
||||
{
|
||||
conn.rollback();
|
||||
}
|
||||
@@ -232,7 +235,7 @@ public class sendMessage
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( stmt != null)
|
||||
if ( stmt != null )
|
||||
{
|
||||
stmt.close();
|
||||
}
|
||||
@@ -244,7 +247,7 @@ public class sendMessage
|
||||
|
||||
try
|
||||
{
|
||||
if ( conn != null)
|
||||
if ( conn != null )
|
||||
{
|
||||
conn.close();
|
||||
}
|
||||
@@ -275,44 +278,44 @@ class WechatOfficalAccountMessageParameter
|
||||
|
||||
WechatOfficalAccountMessageParameter()
|
||||
{
|
||||
tplID = 57;
|
||||
tplID = 57;
|
||||
groupID = 1;
|
||||
}
|
||||
|
||||
@JsonProperty( "tplid")
|
||||
@JsonProperty("tplid")
|
||||
private int tplID;
|
||||
|
||||
@JsonProperty( "groupid")
|
||||
@JsonProperty("groupid")
|
||||
private int groupID;
|
||||
|
||||
@JsonProperty( "first")
|
||||
@JsonProperty("first")
|
||||
private String first;
|
||||
|
||||
@JsonProperty( "keyword1")
|
||||
@JsonProperty("keyword1")
|
||||
private String keyword1;
|
||||
|
||||
@JsonProperty( "keyword1color")
|
||||
@JsonProperty("keyword1color")
|
||||
private String keyword1Color;
|
||||
|
||||
@JsonProperty( "keyword2")
|
||||
@JsonProperty("keyword2")
|
||||
private String keyword2;
|
||||
|
||||
@JsonProperty( "keyword2color")
|
||||
@JsonProperty("keyword2color")
|
||||
private String keyword2Color;
|
||||
|
||||
@JsonProperty( "remark")
|
||||
@JsonProperty("remark")
|
||||
private String remark;
|
||||
|
||||
@JsonProperty( "remarkcolor")
|
||||
@JsonProperty("remarkcolor")
|
||||
private String remarkColor;
|
||||
|
||||
@JsonProperty( "url")
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
|
||||
@JsonProperty( "appid")
|
||||
@JsonProperty("appid")
|
||||
private String appid;
|
||||
|
||||
@JsonProperty( "pagepath")
|
||||
@JsonProperty("pagepath")
|
||||
private String pagePath;
|
||||
|
||||
public int getTplID()
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-04-22 10:53:49
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2022-05-10 11:33:41
|
||||
* @LastEditTime: 2022-05-12 09:54:36
|
||||
* @FilePath: \DisasterWarning\src\test\java\com\cpic\xim\wechat\officalAccount\sendMessageTest.java
|
||||
* @Description:
|
||||
*
|
||||
@@ -75,7 +75,7 @@ public class sendMessageTest
|
||||
String city = "东山县";
|
||||
|
||||
|
||||
sendMessage.saveWeatherDisasterWarning( city, warning );
|
||||
// sendMessage.saveWeatherDisasterWarning( city, warning );
|
||||
}
|
||||
catch ( Exception error )
|
||||
{
|
||||
|
2
应用/1.0/run.bat
Normal file
2
应用/1.0/run.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
java -jar disaster_warning-1.0-SNAPSHOT-jar-with-dependencies.jar
|
||||
pause
|
Reference in New Issue
Block a user