diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/data/PgMainJson.java b/src/com/szpg/db/data/PgMainJson.java index 467b663..423b1ea 100644 --- a/src/com/szpg/db/data/PgMainJson.java +++ b/src/com/szpg/db/data/PgMainJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgMainJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgMaintanceList = fromObject.toList(fromObject,PgMaintance.class); - - return pgMaintanceList; + return rows; } public void setRows(List rows) { diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/data/PgMainJson.java b/src/com/szpg/db/data/PgMainJson.java index 467b663..423b1ea 100644 --- a/src/com/szpg/db/data/PgMainJson.java +++ b/src/com/szpg/db/data/PgMainJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgMainJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgMaintanceList = fromObject.toList(fromObject,PgMaintance.class); - - return pgMaintanceList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java new file mode 100644 index 0000000..460ef69 --- /dev/null +++ b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java @@ -0,0 +1,254 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgAssetInSpectionDao; +import com.szpg.db.dao.impl.PgAssetInSpectionImpl; +import com.szpg.task.ReadAssetInSpectionTask; +import org.junit.Test; + +public class ReadAssetInSpectionTaskTest { + @Test + public void insertDB() { + String jsonStr="{\n" + + "\t\"total\": 333,\n" + + "\t\"totalRecords\": 3321,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"problems\": 1,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"6B1BA2FD-A835-439E-9EC3-B268FB02DE06\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_888\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"A5254143-BE91-4284-AB2A-1B8BD88EACE3\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"sunchenglei\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_334\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"ceb11e1c-6565-4423-ab80-3713f7a1813e\",\n" + + "\t\t\"PLAN_ID\": \"\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": null,\n" + + "\t\t\"RECORD_NO\": \"XR_180615_889\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"02D994A2-9466-4E77-8026-EAECFAB7DA4C\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180729_004\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"wangshen-王申,\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"DB57F8D2-077C-4DC1-90E4-B8DF8F637CD4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180730_002\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"liangqingsong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \",D,R,Z\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"tianyun-田云,\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f1701fc9-9e7a-4155-bff3-cf6b106f484b\",\n" + + "\t\t\"PLAN_ID\": \"87daf7b1-336f-4b41-9684-b0d6436255df\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"sundoudou\",\n" + + "\t\t\"PLAN_NAME\": \"日常巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180615_604\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f793de99-c58d-4787-b489-863320e78924\",\n" + + "\t\t\"PLAN_ID\": \"054bce38-374a-45b6-ade3-cfc1e44846b7\",\n" + + "\t\t\"CREATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": \"风机启动数量点检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180524_666\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"baiwenzhong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"problems\": 2,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"457C0017-5F6B-4026-96D3-9BA439723AA5\",\n" + + "\t\t\"PLAN_ID\": \"1d1800d5-0050-4d38-846e-67d81e337387\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"四五标施工进度巡查\",\n" + + "\t\t\"RECORD_NO\": \"XR_180313_130\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \" dujiannan\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AA605983-6F73-41F0-B1FA-FDA2565F15F4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180727_005\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"luxingxing-陆杏兴, \",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AB88779D-02D6-4419-AD0A-147DEE3EC18F\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180725_006\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"caoshixiang\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"liangcang-梁仓, \",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); + new ReadAssetInSpectionTask().insertDB(pgAssetInSpectionDao,jsonStr); + + } + + +} diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/data/PgMainJson.java b/src/com/szpg/db/data/PgMainJson.java index 467b663..423b1ea 100644 --- a/src/com/szpg/db/data/PgMainJson.java +++ b/src/com/szpg/db/data/PgMainJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgMainJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgMaintanceList = fromObject.toList(fromObject,PgMaintance.class); - - return pgMaintanceList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java new file mode 100644 index 0000000..460ef69 --- /dev/null +++ b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java @@ -0,0 +1,254 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgAssetInSpectionDao; +import com.szpg.db.dao.impl.PgAssetInSpectionImpl; +import com.szpg.task.ReadAssetInSpectionTask; +import org.junit.Test; + +public class ReadAssetInSpectionTaskTest { + @Test + public void insertDB() { + String jsonStr="{\n" + + "\t\"total\": 333,\n" + + "\t\"totalRecords\": 3321,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"problems\": 1,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"6B1BA2FD-A835-439E-9EC3-B268FB02DE06\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_888\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"A5254143-BE91-4284-AB2A-1B8BD88EACE3\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"sunchenglei\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_334\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"ceb11e1c-6565-4423-ab80-3713f7a1813e\",\n" + + "\t\t\"PLAN_ID\": \"\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": null,\n" + + "\t\t\"RECORD_NO\": \"XR_180615_889\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"02D994A2-9466-4E77-8026-EAECFAB7DA4C\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180729_004\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"wangshen-王申,\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"DB57F8D2-077C-4DC1-90E4-B8DF8F637CD4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180730_002\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"liangqingsong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \",D,R,Z\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"tianyun-田云,\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f1701fc9-9e7a-4155-bff3-cf6b106f484b\",\n" + + "\t\t\"PLAN_ID\": \"87daf7b1-336f-4b41-9684-b0d6436255df\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"sundoudou\",\n" + + "\t\t\"PLAN_NAME\": \"日常巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180615_604\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f793de99-c58d-4787-b489-863320e78924\",\n" + + "\t\t\"PLAN_ID\": \"054bce38-374a-45b6-ade3-cfc1e44846b7\",\n" + + "\t\t\"CREATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": \"风机启动数量点检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180524_666\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"baiwenzhong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"problems\": 2,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"457C0017-5F6B-4026-96D3-9BA439723AA5\",\n" + + "\t\t\"PLAN_ID\": \"1d1800d5-0050-4d38-846e-67d81e337387\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"四五标施工进度巡查\",\n" + + "\t\t\"RECORD_NO\": \"XR_180313_130\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \" dujiannan\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AA605983-6F73-41F0-B1FA-FDA2565F15F4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180727_005\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"luxingxing-陆杏兴, \",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AB88779D-02D6-4419-AD0A-147DEE3EC18F\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180725_006\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"caoshixiang\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"liangcang-梁仓, \",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); + new ReadAssetInSpectionTask().insertDB(pgAssetInSpectionDao,jsonStr); + + } + + +} diff --git a/src/com/szpg/db/test/ReadMaintanceTaskTest.java b/src/com/szpg/db/test/ReadMaintanceTaskTest.java new file mode 100644 index 0000000..c7f7022 --- /dev/null +++ b/src/com/szpg/db/test/ReadMaintanceTaskTest.java @@ -0,0 +1,154 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgMaintanceDao; +import com.szpg.db.dao.impl.PgMaintanceDaoImpl; +import com.szpg.task.ReadMaintanceTask; +import org.junit.Test; + +public class ReadMaintanceTaskTest { + @Test + public void insertDB() { + + String jsonStr="{\n" + + "\t\"total\": 20,\n" + + "\t\"totalRecords\": 199,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0567B2C1-CEAC-4C3B-AD34-9A9BC61E5F80\",\n" + + "\t\t\"PLAN_KEY_ID\": \"afec56e0-8db7-4a78-a1c8-a255d2e10fbf\",\n" + + "\t\t\"PLAN_NAME\": \"EPS设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-101004-3945\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-05-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"07EE7B85-C868-481A-B446-EDD928C9A6EF\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102446-2491\",\n" + + "\t\t\"REOAIRMAN\": \"panshijin\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",Q\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0863F267-51EC-451E-AC2F-B2964C81611A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"9b0311c9-b5a5-402c-a888-f6e83f43ca01\",\n" + + "\t\t\"PLAN_NAME\": \"风管、通风口保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-152000-3389\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0B5A58EB-5A43-4DD7-B251-AFD8EE9EC7DC\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102543-9023\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-09-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"147C5CE2-B1F7-48B9-B9B0-7A3549AB5088\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165641-5849\",\n" + + "\t\t\"REOAIRMAN\": \"邹盛\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-16\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 2,\n" + + "\t\t\"KEY_ID\": \"16D18621-B2B6-4726-8301-E4EC04E5B366\",\n" + + "\t\t\"PLAN_KEY_ID\": \"a09e5100-c45e-4e3e-8699-f3d420475357\",\n" + + "\t\t\"PLAN_NAME\": \"低压配电箱(柜)保养计划(季度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1B763BDF-65AA-4F61-ACB8-1F9AAD8B94C7\",\n" + + "\t\t\"PLAN_KEY_ID\": \"3e8a6adb-2721-441a-8703-ce86e10bbe84\",\n" + + "\t\t\"PLAN_NAME\": \"水喷淋设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-151334-8577\",\n" + + "\t\t\"REOAIRMAN\": \"yuweihua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-06-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 1,\n" + + "\t\t\"KEY_ID\": \"20054191-2C9B-4134-B15B-672497761ECD\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"200AE813-FB83-49E5-BED1-E18436ECB35A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165809-3203\",\n" + + "\t\t\"REOAIRMAN\": \"杜建男\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-11\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1EE38C22-7DD4-43B7-882E-F8A11118B839\",\n" + + "\t\t\"PLAN_KEY_ID\": \"57dadeeb-8e71-40ef-a2ba-f990771c40fd\",\n" + + "\t\t\"PLAN_NAME\": \"潜水泵及潜水泵控制柜\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-145450-4697\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-01-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + + PgMaintanceDao pgMaintanceDao=new PgMaintanceDaoImpl(); + new ReadMaintanceTask().insertDB(pgMaintanceDao,jsonStr); + + } +} \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/data/PgMainJson.java b/src/com/szpg/db/data/PgMainJson.java index 467b663..423b1ea 100644 --- a/src/com/szpg/db/data/PgMainJson.java +++ b/src/com/szpg/db/data/PgMainJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgMainJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgMaintanceList = fromObject.toList(fromObject,PgMaintance.class); - - return pgMaintanceList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java new file mode 100644 index 0000000..460ef69 --- /dev/null +++ b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java @@ -0,0 +1,254 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgAssetInSpectionDao; +import com.szpg.db.dao.impl.PgAssetInSpectionImpl; +import com.szpg.task.ReadAssetInSpectionTask; +import org.junit.Test; + +public class ReadAssetInSpectionTaskTest { + @Test + public void insertDB() { + String jsonStr="{\n" + + "\t\"total\": 333,\n" + + "\t\"totalRecords\": 3321,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"problems\": 1,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"6B1BA2FD-A835-439E-9EC3-B268FB02DE06\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_888\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"A5254143-BE91-4284-AB2A-1B8BD88EACE3\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"sunchenglei\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_334\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"ceb11e1c-6565-4423-ab80-3713f7a1813e\",\n" + + "\t\t\"PLAN_ID\": \"\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": null,\n" + + "\t\t\"RECORD_NO\": \"XR_180615_889\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"02D994A2-9466-4E77-8026-EAECFAB7DA4C\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180729_004\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"wangshen-王申,\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"DB57F8D2-077C-4DC1-90E4-B8DF8F637CD4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180730_002\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"liangqingsong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \",D,R,Z\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"tianyun-田云,\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f1701fc9-9e7a-4155-bff3-cf6b106f484b\",\n" + + "\t\t\"PLAN_ID\": \"87daf7b1-336f-4b41-9684-b0d6436255df\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"sundoudou\",\n" + + "\t\t\"PLAN_NAME\": \"日常巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180615_604\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f793de99-c58d-4787-b489-863320e78924\",\n" + + "\t\t\"PLAN_ID\": \"054bce38-374a-45b6-ade3-cfc1e44846b7\",\n" + + "\t\t\"CREATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": \"风机启动数量点检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180524_666\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"baiwenzhong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"problems\": 2,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"457C0017-5F6B-4026-96D3-9BA439723AA5\",\n" + + "\t\t\"PLAN_ID\": \"1d1800d5-0050-4d38-846e-67d81e337387\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"四五标施工进度巡查\",\n" + + "\t\t\"RECORD_NO\": \"XR_180313_130\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \" dujiannan\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AA605983-6F73-41F0-B1FA-FDA2565F15F4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180727_005\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"luxingxing-陆杏兴, \",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AB88779D-02D6-4419-AD0A-147DEE3EC18F\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180725_006\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"caoshixiang\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"liangcang-梁仓, \",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); + new ReadAssetInSpectionTask().insertDB(pgAssetInSpectionDao,jsonStr); + + } + + +} diff --git a/src/com/szpg/db/test/ReadMaintanceTaskTest.java b/src/com/szpg/db/test/ReadMaintanceTaskTest.java new file mode 100644 index 0000000..c7f7022 --- /dev/null +++ b/src/com/szpg/db/test/ReadMaintanceTaskTest.java @@ -0,0 +1,154 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgMaintanceDao; +import com.szpg.db.dao.impl.PgMaintanceDaoImpl; +import com.szpg.task.ReadMaintanceTask; +import org.junit.Test; + +public class ReadMaintanceTaskTest { + @Test + public void insertDB() { + + String jsonStr="{\n" + + "\t\"total\": 20,\n" + + "\t\"totalRecords\": 199,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0567B2C1-CEAC-4C3B-AD34-9A9BC61E5F80\",\n" + + "\t\t\"PLAN_KEY_ID\": \"afec56e0-8db7-4a78-a1c8-a255d2e10fbf\",\n" + + "\t\t\"PLAN_NAME\": \"EPS设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-101004-3945\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-05-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"07EE7B85-C868-481A-B446-EDD928C9A6EF\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102446-2491\",\n" + + "\t\t\"REOAIRMAN\": \"panshijin\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",Q\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0863F267-51EC-451E-AC2F-B2964C81611A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"9b0311c9-b5a5-402c-a888-f6e83f43ca01\",\n" + + "\t\t\"PLAN_NAME\": \"风管、通风口保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-152000-3389\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0B5A58EB-5A43-4DD7-B251-AFD8EE9EC7DC\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102543-9023\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-09-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"147C5CE2-B1F7-48B9-B9B0-7A3549AB5088\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165641-5849\",\n" + + "\t\t\"REOAIRMAN\": \"邹盛\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-16\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 2,\n" + + "\t\t\"KEY_ID\": \"16D18621-B2B6-4726-8301-E4EC04E5B366\",\n" + + "\t\t\"PLAN_KEY_ID\": \"a09e5100-c45e-4e3e-8699-f3d420475357\",\n" + + "\t\t\"PLAN_NAME\": \"低压配电箱(柜)保养计划(季度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1B763BDF-65AA-4F61-ACB8-1F9AAD8B94C7\",\n" + + "\t\t\"PLAN_KEY_ID\": \"3e8a6adb-2721-441a-8703-ce86e10bbe84\",\n" + + "\t\t\"PLAN_NAME\": \"水喷淋设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-151334-8577\",\n" + + "\t\t\"REOAIRMAN\": \"yuweihua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-06-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 1,\n" + + "\t\t\"KEY_ID\": \"20054191-2C9B-4134-B15B-672497761ECD\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"200AE813-FB83-49E5-BED1-E18436ECB35A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165809-3203\",\n" + + "\t\t\"REOAIRMAN\": \"杜建男\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-11\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1EE38C22-7DD4-43B7-882E-F8A11118B839\",\n" + + "\t\t\"PLAN_KEY_ID\": \"57dadeeb-8e71-40ef-a2ba-f990771c40fd\",\n" + + "\t\t\"PLAN_NAME\": \"潜水泵及潜水泵控制柜\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-145450-4697\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-01-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + + PgMaintanceDao pgMaintanceDao=new PgMaintanceDaoImpl(); + new ReadMaintanceTask().insertDB(pgMaintanceDao,jsonStr); + + } +} \ No newline at end of file diff --git a/src/com/szpg/task/ReadAssetInSpectionTask.java b/src/com/szpg/task/ReadAssetInSpectionTask.java index 9d40755..f5fa62c 100644 --- a/src/com/szpg/task/ReadAssetInSpectionTask.java +++ b/src/com/szpg/task/ReadAssetInSpectionTask.java @@ -1,13 +1,15 @@ package com.szpg.task; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.szpg.db.dao.PgAssetInSpectionDao; import com.szpg.db.dao.impl.PgAssetInSpectionImpl; import com.szpg.db.data.PgAssetInSpection; import com.szpg.db.data.PgAssetJson; import com.szpg.util.HttpRequest; -import net.sf.json.JSONObject; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.List; @@ -15,14 +17,16 @@ final String tableName="V_ASSET_INSPECTION_RECORD"; final String url="http://10.10.2.31:9056/GLYW/api/Common/LoadIndexData"; + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public void run(){ PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String startTime=pgAssetInSpectionDao.findLastRecordTime();//上次同步数据最后记录时间 String endTime= dateFormat.format(new Date());//当前时间 + if(startTime==null) + startTime=getYestodayStr(); StringBuilder sb = new StringBuilder(); sb.append("tableName = ").append(tableName); @@ -34,16 +38,30 @@ String jsonStr = HttpRequest.sendPostByHttp(url, sb.toString()); - PgAssetJson pgAssetJson=getAssetJsonByJsonString(jsonStr); - List pgAssetInSpectionList=pgAssetJson.getRows(); + insertDB(pgAssetInSpectionDao,jsonStr); + } + + public void insertDB(PgAssetInSpectionDao pgAssetInSpectionDao,String jsonStr) + { + List pgAssetInSpectionList= getAssetByJsonString(jsonStr); pgAssetInSpectionDao.addAssetInSpectionRecord(pgAssetInSpectionList); } - private PgAssetJson getAssetJsonByJsonString(String jsonStr){ - JSONObject jsonObject=JSONObject.fromObject(jsonStr); - PgAssetJson pgAssetJson=(PgAssetJson)JSONObject.toBean(jsonObject, PgAssetJson.class); - - return pgAssetJson; + private List getAssetByJsonString(String jsonStr){ + PgAssetJson pgAssetJson = JSON.parseObject(jsonStr, new TypeReference() {}); + List pgAssetInSpectionList=pgAssetJson.getRows(); + return pgAssetInSpectionList; } + public String getYestodayStr() { + Date dt = new Date(); + String yesToday = ""; + Date dtt = (Date) dt.clone(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dtt); + calendar.add(Calendar.DAY_OF_MONTH, -1); + yesToday = dateFormat.format(calendar.getTime()); + + return yesToday; + } } \ No newline at end of file diff --git a/.idea/artifacts/pgdsc.xml b/.idea/artifacts/pgdsc.xml new file mode 100644 index 0000000..245ed37 --- /dev/null +++ b/.idea/artifacts/pgdsc.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/../out/artifacts/pgdsc + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/c3p0_0_9_5_2.xml b/.idea/libraries/c3p0_0_9_5_2.xml new file mode 100644 index 0000000..0611c19 --- /dev/null +++ b/.idea/libraries/c3p0_0_9_5_2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/freemarker_2_3_26_incubating.xml b/.idea/libraries/freemarker_2_3_26_incubating.xml new file mode 100644 index 0000000..40133b1 --- /dev/null +++ b/.idea/libraries/freemarker_2_3_26_incubating.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/javassist_3_20_0_GA.xml b/.idea/libraries/javassist_3_20_0_GA.xml new file mode 100644 index 0000000..01900a7 --- /dev/null +++ b/.idea/libraries/javassist_3_20_0_GA.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml new file mode 100644 index 0000000..318b17f --- /dev/null +++ b/.idea/libraries/json.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_4_7.xml b/.idea/libraries/junit_4_7.xml new file mode 100644 index 0000000..e282133 --- /dev/null +++ b/.idea/libraries/junit_4_7.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml deleted file mode 100644 index b57715d..0000000 --- a/.idea/libraries/lib.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml new file mode 100644 index 0000000..2002bc8 --- /dev/null +++ b/.idea/libraries/log4j_1_2_17.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ed21f8e..8c54902 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,7 @@ - + + + \ No newline at end of file diff --git a/.idea/pgdsc.iml b/.idea/pgdsc.iml index 9aa6047..573b33d 100644 --- a/.idea/pgdsc.iml +++ b/.idea/pgdsc.iml @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -7,9 +19,14 @@ - + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar b/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar deleted file mode 100644 index 3aa6b2a..0000000 --- a/WebRoot/WEB-INF/lib/json-lib-2.1-rev2.jar +++ /dev/null Binary files differ diff --git a/WebRoot/WEB-INF/lib/junit-4.7.jar b/WebRoot/WEB-INF/lib/junit-4.7.jar new file mode 100644 index 0000000..700ad69 --- /dev/null +++ b/WebRoot/WEB-INF/lib/junit-4.7.jar Binary files differ diff --git a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java index b49c688..62c4548 100644 --- a/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java +++ b/src/com/szpg/db/dao/impl/PgAssetInSpectionImpl.java @@ -22,10 +22,10 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ASSET_INSPECTION_RECORD " + - "(KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + + "(ID,KEY_ID, PLAN_ID, CREATE_DATE, STATE,CREATOR,PLAN_NAME,RECORD_NO,PLAN_NO,RESPONSIBIE_DEPT," + "INSPECTION_PERSON,PATROL_MAN,OPERATE_DATE,REMARK,BUILD_CABIN,PROJECT,START_PILE_NO,END_PILE_NO," + "INSPECTION_PRACE,OTHER_PATROL_MAN) " + - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "VALUES (SEQ_PG_ASSET_RECORD_ID.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgAssetInSpection pgAssetInSpection:pgAssetInSpectionList){ @@ -91,7 +91,7 @@ queryStr, new BeanListHandler(PgAssetInSpection.class)); if (null != pgAssetInSpectionList && pgAssetInSpectionList.isEmpty() == false) { - logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList.size() + "]"); + logger.debug("获取最新巡检记录成功[" + pgAssetInSpectionList + "]"); return pgAssetInSpectionList.get(0).getCREATE_DATE(); } else diff --git a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java index 227587c..6cd27c4 100644 --- a/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgMaintanceDaoImpl.java @@ -22,12 +22,12 @@ Connection conn = null; String insertStr = "INSERT INTO PG_MAINTANCERECORD_HEAD " + - "(KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + - "CREATOR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "(ID,KEY_ID, PLAN_KEY_ID, PLAN_NAME, RECORD_NO,REOAIRMAN,MAINTENANCE_DATE,BUILD_CABIN,PROJECT,CREATEDATE," + + "CREATOR) VALUES (SEQ_PG_MAINTANCERECORD_HEAD_ID.nextval,?,?,?,?,?,?,?,?,?,?)"; List paramObjectList=new ArrayList(); for(PgMaintance pgMaintance:pgMaintanceList){ - Object[] params = new Object[19]; + Object[] params = new Object[10]; params[0] = pgMaintance.getKEY_ID(); params[1] = pgMaintance.getPLAN_KEY_ID(); params[2] = pgMaintance.getPLAN_NAME(); @@ -80,7 +80,7 @@ queryStr, new BeanListHandler(PgMaintance.class)); if (null != pgMaintanceList && pgMaintanceList.isEmpty() == false) { - logger.debug("获取最新维护记录成功[" + pgMaintanceList.size() + "]"); + logger.debug("获取最新维护记录成功[" + pgMaintanceList + "]"); return pgMaintanceList.get(0).getMAINTENANCE_DATE(); } else diff --git a/src/com/szpg/db/data/PgAssetJson.java b/src/com/szpg/db/data/PgAssetJson.java index 2c801ae..b5d6dd6 100644 --- a/src/com/szpg/db/data/PgAssetJson.java +++ b/src/com/szpg/db/data/PgAssetJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgAssetJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgAssetInSpectionList = fromObject.toList(fromObject,PgAssetInSpection.class); - - return pgAssetInSpectionList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/data/PgMainJson.java b/src/com/szpg/db/data/PgMainJson.java index 467b663..423b1ea 100644 --- a/src/com/szpg/db/data/PgMainJson.java +++ b/src/com/szpg/db/data/PgMainJson.java @@ -1,7 +1,5 @@ package com.szpg.db.data; -import net.sf.json.JSONArray; - import java.util.List; public class PgMainJson { @@ -45,10 +43,7 @@ } public List getRows() { - JSONArray fromObject = JSONArray.fromObject(rows); - List pgMaintanceList = fromObject.toList(fromObject,PgMaintance.class); - - return pgMaintanceList; + return rows; } public void setRows(List rows) { diff --git a/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java new file mode 100644 index 0000000..460ef69 --- /dev/null +++ b/src/com/szpg/db/test/ReadAssetInSpectionTaskTest.java @@ -0,0 +1,254 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgAssetInSpectionDao; +import com.szpg.db.dao.impl.PgAssetInSpectionImpl; +import com.szpg.task.ReadAssetInSpectionTask; +import org.junit.Test; + +public class ReadAssetInSpectionTaskTest { + @Test + public void insertDB() { + String jsonStr="{\n" + + "\t\"total\": 333,\n" + + "\t\"totalRecords\": 3321,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"problems\": 1,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"6B1BA2FD-A835-439E-9EC3-B268FB02DE06\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_888\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"A5254143-BE91-4284-AB2A-1B8BD88EACE3\",\n" + + "\t\t\"PLAN_ID\": \"a28285cd-c023-4caf-81e5-3d186fcf5898\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"sunchenglei\",\n" + + "\t\t\"PLAN_NAME\": \"一标燃气舱巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180305_334\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wangrui\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-05\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"ceb11e1c-6565-4423-ab80-3713f7a1813e\",\n" + + "\t\t\"PLAN_ID\": \"\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": null,\n" + + "\t\t\"RECORD_NO\": \"XR_180615_889\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"02D994A2-9466-4E77-8026-EAECFAB7DA4C\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180729_004\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-29\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"wangshen-王申,\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"DB57F8D2-077C-4DC1-90E4-B8DF8F637CD4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180730_002\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"liangqingsong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-30\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \",D,R,Z\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"tianyun-田云,\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f1701fc9-9e7a-4155-bff3-cf6b106f484b\",\n" + + "\t\t\"PLAN_ID\": \"87daf7b1-336f-4b41-9684-b0d6436255df\",\n" + + "\t\t\"CREATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"sundoudou\",\n" + + "\t\t\"PLAN_NAME\": \"日常巡检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180615_604\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"zousheng\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-06-15\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": \"R\",\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"f793de99-c58d-4787-b489-863320e78924\",\n" + + "\t\t\"PLAN_ID\": \"054bce38-374a-45b6-ade3-cfc1e44846b7\",\n" + + "\t\t\"CREATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"admin\",\n" + + "\t\t\"PLAN_NAME\": \"风机启动数量点检\",\n" + + "\t\t\"RECORD_NO\": \"XR_180524_666\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"baiwenzhong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-05-24\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"problems\": 2,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"457C0017-5F6B-4026-96D3-9BA439723AA5\",\n" + + "\t\t\"PLAN_ID\": \"1d1800d5-0050-4d38-846e-67d81e337387\",\n" + + "\t\t\"CREATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"STATE\": null,\n" + + "\t\t\"CREATOR\": \"wangrui\",\n" + + "\t\t\"PLAN_NAME\": \"四五标施工进度巡查\",\n" + + "\t\t\"RECORD_NO\": \"XR_180313_130\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \" dujiannan\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-03-13\",\n" + + "\t\t\"REMARK\": null,\n" + + "\t\t\"BUILD_CABIN\": null,\n" + + "\t\t\"PROJECT\": null,\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": null,\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AA605983-6F73-41F0-B1FA-FDA2565F15F4\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180727_005\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"wudong\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-27\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"luxingxing-陆杏兴, \",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"problems\": 0,\n" + + "\t\t\"finish\": 0,\n" + + "\t\t\"KEY_ID\": \"AB88779D-02D6-4419-AD0A-147DEE3EC18F\",\n" + + "\t\t\"PLAN_ID\": \"feea9e81-fe9a-4b73-b528-4b7a09381b68\",\n" + + "\t\t\"CREATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"STATE\": 0,\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"PLAN_NAME\": \"吴中太湖新城内部巡检计划-一期\",\n" + + "\t\t\"RECORD_NO\": \"XR_180725_006\",\n" + + "\t\t\"PLAN_NO\": null,\n" + + "\t\t\"RESPONSIBLE_DEPT\": null,\n" + + "\t\t\"INSPECTION_PERSON\": null,\n" + + "\t\t\"PATROL_MAN\": \"caoshixiang\",\n" + + "\t\t\"OPERATE_DATE\": \"2018-07-25\",\n" + + "\t\t\"REMARK\": \"\",\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"THXC\",\n" + + "\t\t\"START_PILE_NO\": null,\n" + + "\t\t\"END_PILE_NO\": null,\n" + + "\t\t\"INSPECTION_PRACE\": null,\n" + + "\t\t\"OTHER_PATROL_MAN\": \"liangcang-梁仓, \",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); + new ReadAssetInSpectionTask().insertDB(pgAssetInSpectionDao,jsonStr); + + } + + +} diff --git a/src/com/szpg/db/test/ReadMaintanceTaskTest.java b/src/com/szpg/db/test/ReadMaintanceTaskTest.java new file mode 100644 index 0000000..c7f7022 --- /dev/null +++ b/src/com/szpg/db/test/ReadMaintanceTaskTest.java @@ -0,0 +1,154 @@ +package com.szpg.db.test; + +import com.szpg.db.dao.PgMaintanceDao; +import com.szpg.db.dao.impl.PgMaintanceDaoImpl; +import com.szpg.task.ReadMaintanceTask; +import org.junit.Test; + +public class ReadMaintanceTaskTest { + @Test + public void insertDB() { + + String jsonStr="{\n" + + "\t\"total\": 20,\n" + + "\t\"totalRecords\": 199,\n" + + "\t\"page\": 1,\n" + + "\t\"records\": 10,\n" + + "\t\"rows\": [{\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0567B2C1-CEAC-4C3B-AD34-9A9BC61E5F80\",\n" + + "\t\t\"PLAN_KEY_ID\": \"afec56e0-8db7-4a78-a1c8-a255d2e10fbf\",\n" + + "\t\t\"PLAN_NAME\": \"EPS设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-101004-3945\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-05-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 1\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"07EE7B85-C868-481A-B446-EDD928C9A6EF\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102446-2491\",\n" + + "\t\t\"REOAIRMAN\": \"panshijin\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",Q\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 2\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0863F267-51EC-451E-AC2F-B2964C81611A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"9b0311c9-b5a5-402c-a888-f6e83f43ca01\",\n" + + "\t\t\"PLAN_NAME\": \"风管、通风口保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-152000-3389\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-08-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 3\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"0B5A58EB-5A43-4DD7-B251-AFD8EE9EC7DC\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180911-102543-9023\",\n" + + "\t\t\"REOAIRMAN\": \"dujiannan\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-09-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-11\",\n" + + "\t\t\"CREATOR\": \"haojing\",\n" + + "\t\t\"rowNum\": 4\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"147C5CE2-B1F7-48B9-B9B0-7A3549AB5088\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165641-5849\",\n" + + "\t\t\"REOAIRMAN\": \"邹盛\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-16\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 5\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 2,\n" + + "\t\t\"KEY_ID\": \"16D18621-B2B6-4726-8301-E4EC04E5B366\",\n" + + "\t\t\"PLAN_KEY_ID\": \"a09e5100-c45e-4e3e-8699-f3d420475357\",\n" + + "\t\t\"PLAN_NAME\": \"低压配电箱(柜)保养计划(季度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \"\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 6\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1B763BDF-65AA-4F61-ACB8-1F9AAD8B94C7\",\n" + + "\t\t\"PLAN_KEY_ID\": \"3e8a6adb-2721-441a-8703-ce86e10bbe84\",\n" + + "\t\t\"PLAN_NAME\": \"水喷淋设备保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-151334-8577\",\n" + + "\t\t\"REOAIRMAN\": \"yuweihua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-06-01\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 7\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 1,\n" + + "\t\t\"KEY_ID\": \"20054191-2C9B-4134-B15B-672497761ECD\",\n" + + "\t\t\"PLAN_KEY_ID\": \"1725b07b-c467-4cc3-b0c9-f090aba0b38d\",\n" + + "\t\t\"PLAN_NAME\": \"火灾自动报警设备保养计划(月度)\",\n" + + "\t\t\"RECORD_NO\": null,\n" + + "\t\t\"REOAIRMAN\": null,\n" + + "\t\t\"MAINTENANCE_DATE\": null,\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-11-01\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 8\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"200AE813-FB83-49E5-BED1-E18436ECB35A\",\n" + + "\t\t\"PLAN_KEY_ID\": \"4874f602-83a2-4e9c-a05f-da1cad9a0427\",\n" + + "\t\t\"PLAN_NAME\": \"弱电间保养计划\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-181016-165809-3203\",\n" + + "\t\t\"REOAIRMAN\": \"杜建男\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-10-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-10-11\",\n" + + "\t\t\"CREATOR\": \"system\",\n" + + "\t\t\"rowNum\": 9\n" + + "\t}, {\n" + + "\t\t\"FINISH\": 0,\n" + + "\t\t\"KEY_ID\": \"1EE38C22-7DD4-43B7-882E-F8A11118B839\",\n" + + "\t\t\"PLAN_KEY_ID\": \"57dadeeb-8e71-40ef-a2ba-f990771c40fd\",\n" + + "\t\t\"PLAN_NAME\": \"潜水泵及潜水泵控制柜\",\n" + + "\t\t\"RECORD_NO\": \"WXBY-180910-145450-4697\",\n" + + "\t\t\"REOAIRMAN\": \"zhangronghua\",\n" + + "\t\t\"MAINTENANCE_DATE\": \"2018-01-02\",\n" + + "\t\t\"BUILD_CABIN\": \",D,P,Q,R,S\",\n" + + "\t\t\"PROJECT\": \"CBL\",\n" + + "\t\t\"CREATEDATE\": \"2018-09-10\",\n" + + "\t\t\"CREATOR\": \"wuping\",\n" + + "\t\t\"rowNum\": 10\n" + + "\t}]\n" + + "}"; + + PgMaintanceDao pgMaintanceDao=new PgMaintanceDaoImpl(); + new ReadMaintanceTask().insertDB(pgMaintanceDao,jsonStr); + + } +} \ No newline at end of file diff --git a/src/com/szpg/task/ReadAssetInSpectionTask.java b/src/com/szpg/task/ReadAssetInSpectionTask.java index 9d40755..f5fa62c 100644 --- a/src/com/szpg/task/ReadAssetInSpectionTask.java +++ b/src/com/szpg/task/ReadAssetInSpectionTask.java @@ -1,13 +1,15 @@ package com.szpg.task; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.szpg.db.dao.PgAssetInSpectionDao; import com.szpg.db.dao.impl.PgAssetInSpectionImpl; import com.szpg.db.data.PgAssetInSpection; import com.szpg.db.data.PgAssetJson; import com.szpg.util.HttpRequest; -import net.sf.json.JSONObject; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.List; @@ -15,14 +17,16 @@ final String tableName="V_ASSET_INSPECTION_RECORD"; final String url="http://10.10.2.31:9056/GLYW/api/Common/LoadIndexData"; + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public void run(){ PgAssetInSpectionDao pgAssetInSpectionDao=new PgAssetInSpectionImpl(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String startTime=pgAssetInSpectionDao.findLastRecordTime();//上次同步数据最后记录时间 String endTime= dateFormat.format(new Date());//当前时间 + if(startTime==null) + startTime=getYestodayStr(); StringBuilder sb = new StringBuilder(); sb.append("tableName = ").append(tableName); @@ -34,16 +38,30 @@ String jsonStr = HttpRequest.sendPostByHttp(url, sb.toString()); - PgAssetJson pgAssetJson=getAssetJsonByJsonString(jsonStr); - List pgAssetInSpectionList=pgAssetJson.getRows(); + insertDB(pgAssetInSpectionDao,jsonStr); + } + + public void insertDB(PgAssetInSpectionDao pgAssetInSpectionDao,String jsonStr) + { + List pgAssetInSpectionList= getAssetByJsonString(jsonStr); pgAssetInSpectionDao.addAssetInSpectionRecord(pgAssetInSpectionList); } - private PgAssetJson getAssetJsonByJsonString(String jsonStr){ - JSONObject jsonObject=JSONObject.fromObject(jsonStr); - PgAssetJson pgAssetJson=(PgAssetJson)JSONObject.toBean(jsonObject, PgAssetJson.class); - - return pgAssetJson; + private List getAssetByJsonString(String jsonStr){ + PgAssetJson pgAssetJson = JSON.parseObject(jsonStr, new TypeReference() {}); + List pgAssetInSpectionList=pgAssetJson.getRows(); + return pgAssetInSpectionList; } + public String getYestodayStr() { + Date dt = new Date(); + String yesToday = ""; + Date dtt = (Date) dt.clone(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dtt); + calendar.add(Calendar.DAY_OF_MONTH, -1); + yesToday = dateFormat.format(calendar.getTime()); + + return yesToday; + } } \ No newline at end of file diff --git a/src/com/szpg/task/ReadMaintanceTask.java b/src/com/szpg/task/ReadMaintanceTask.java index 7c4ddb1..a2daaa3 100644 --- a/src/com/szpg/task/ReadMaintanceTask.java +++ b/src/com/szpg/task/ReadMaintanceTask.java @@ -1,11 +1,12 @@ package com.szpg.task; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.szpg.db.dao.PgMaintanceDao; import com.szpg.db.dao.impl.PgMaintanceDaoImpl; import com.szpg.db.data.PgMainJson; import com.szpg.db.data.PgMaintance; import com.szpg.util.HttpRequest; -import net.sf.json.JSONObject; import java.text.SimpleDateFormat; import java.util.Date; @@ -15,14 +16,18 @@ final String tableName="V_MaintanceRecord_Head"; final String url="http://10.10.2.31:9056/GLYW/api/Common/LoadIndexData"; + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public void run(){ PgMaintanceDao pgMaintanceDao=new PgMaintanceDaoImpl(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = new Date(); String startTime=pgMaintanceDao.findLastRecordTime();//上次同步数据最后记录时间 - String endTime= dateFormat.format(new Date());//当前时间 + String endTime= dateFormat.format(date);//当前时间 + + if(startTime==null) + startTime=new ReadAssetInSpectionTask().getYestodayStr(); StringBuilder sb = new StringBuilder(); sb.append("tableName = ").append(tableName); @@ -34,16 +39,20 @@ String jsonStr = HttpRequest.sendPostByHttp(url, sb.toString()); - PgMainJson pgMainJson=getMintanceJsonByJsonString(jsonStr); - List pgMaintanceList=pgMainJson.getRows(); + insertDB(pgMaintanceDao,jsonStr); + } + + public void insertDB(PgMaintanceDao pgMaintanceDao,String jsonStr){ + List pgMaintanceList= getMintanceByJsonString(jsonStr); pgMaintanceDao.addMaintanceRecord(pgMaintanceList); } - private PgMainJson getMintanceJsonByJsonString(String jsonStr){ - JSONObject jsonObject=JSONObject.fromObject(jsonStr); - PgMainJson pgMainJson=(PgMainJson)JSONObject.toBean(jsonObject, PgMainJson.class); + private List getMintanceByJsonString(String jsonStr){ + PgMainJson pgMainJson = JSON.parseObject(jsonStr, new TypeReference() {}); + List pgMaintanceList=pgMainJson.getRows(); - return pgMainJson; + return pgMaintanceList; } + } \ No newline at end of file